Skip to content

Commit

Permalink
Add test case for source patching.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Dec 12, 2024
1 parent 7d8e310 commit 8c9a17f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ downloads/
archives/
*.orig
*.swp
venv*/
.venv/

# lib_check downloads these
*-stamp
arch_tmp/
arb*/
bzip2*/
cfitsio/
flex*/
freetype*/
giflib*/
harfbuzz*/
hdf5*/
jpeg*/
lcms2*/
Expand Down
4 changes: 2 additions & 2 deletions common_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@ function fetch_unpack {
rsync --delete -ah * ..)

# If a patch exists, apply it
if [ -e "${PATCH_DIR}/${name}-${version}.patch" ]; then
if [ -e "$(pwd)/${PATCH_DIR}/${archive_fname}.patch" ]; then
# The arch_tmp folder will contain the name of folder that was just
# unpacked from the archive. Apply the patch in that directory.
local package_dir=$(ls -1c arch_tmp)
patch --force -i "${PATCH_DIR}/${name}-${version}.patch" -d $package_dir
patch --force -i "$(pwd)/${PATCH_DIR}/${archive_fname}.patch" -d $package_dir
fi
}

Expand Down
11 changes: 11 additions & 0 deletions tests/patches/harfbuzz-2.7.4.tar.xz.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This is a completely cosmetic patch to validate that source patching works as expected.
#
diff -ur harfbuzz-2.7.4-orig/README harfbuzz-2.7.4/README
--- harfbuzz-2.7.4-orig/README 2024-12-12 09:23:15
+++ harfbuzz-2.7.4/README 2024-12-12 09:23:02
@@ -13,3 +13,5 @@
For test execution, see https://github.com/harfbuzz/harfbuzz/blob/master/TESTING.md

Documentation: https://harfbuzz.github.io
+
+Harfbuzz has been patched by multibuild
2 changes: 2 additions & 0 deletions tests/test_library_builders.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ source tests/utils.sh

start_spinner

PATCH_DIR=tests/patches
fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/2.7.4/harfbuzz-2.7.4.tar.xz
[ -d harfbuzz-2.7.4 ] || ingest ".tar.xz should have been unpacked"
[ -n "$(grep 'Harfbuzz has been patched by multibuild' harfbuzz-2.7.4/README)" ] || ingest "Harfbuzz should have been patched"

suppress build_bzip2
suppress build_openssl
Expand Down

0 comments on commit 8c9a17f

Please sign in to comment.