Skip to content

Commit 8c9a17f

Browse files
committed
Add test case for source patching.
1 parent 7d8e310 commit 8c9a17f

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@ downloads/
22
archives/
33
*.orig
44
*.swp
5+
venv*/
6+
.venv/
57

68
# lib_check downloads these
79
*-stamp
10+
arch_tmp/
811
arb*/
912
bzip2*/
1013
cfitsio/
1114
flex*/
1215
freetype*/
1316
giflib*/
17+
harfbuzz*/
1418
hdf5*/
1519
jpeg*/
1620
lcms2*/

common_utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ function fetch_unpack {
290290
rsync --delete -ah * ..)
291291

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This is a completely cosmetic patch to validate that source patching works as expected.
2+
#
3+
diff -ur harfbuzz-2.7.4-orig/README harfbuzz-2.7.4/README
4+
--- harfbuzz-2.7.4-orig/README 2024-12-12 09:23:15
5+
+++ harfbuzz-2.7.4/README 2024-12-12 09:23:02
6+
@@ -13,3 +13,5 @@
7+
For test execution, see https://github.com/harfbuzz/harfbuzz/blob/master/TESTING.md
8+
9+
Documentation: https://harfbuzz.github.io
10+
+
11+
+Harfbuzz has been patched by multibuild

tests/test_library_builders.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ source tests/utils.sh
2121

2222
start_spinner
2323

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

2729
suppress build_bzip2
2830
suppress build_openssl

0 commit comments

Comments
 (0)