From 9061c3a52d355e478cbf83a6110b4cc3d2330ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marczewski?= Date: Fri, 10 Dec 2021 14:26:37 +0100 Subject: wrap: Add support for applying a list of patch files Co-authored-by: Xavier Claessens --- .../153 wrap file should not failed/meson.build | 7 +++++ .../patchfile/0001-Change-foo-to-executable.patch | 33 ++++++++++++++++++++++ .../patchfile/0001-Change-return-value-to-43.patch | 21 ++++++++++++++ .../patchfile/0002-Change-return-value-to-44.patch | 21 ++++++++++++++ .../subprojects/patchfile.wrap | 14 +++++++++ 5 files changed, 96 insertions(+) create mode 100644 test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0001-Change-foo-to-executable.patch create mode 100644 test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0001-Change-return-value-to-43.patch create mode 100644 test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0002-Change-return-value-to-44.patch create mode 100644 test cases/common/153 wrap file should not failed/subprojects/patchfile.wrap (limited to 'test cases') diff --git a/test cases/common/153 wrap file should not failed/meson.build b/test cases/common/153 wrap file should not failed/meson.build index 48d1068..5448502 100644 --- a/test cases/common/153 wrap file should not failed/meson.build +++ b/test cases/common/153 wrap file should not failed/meson.build @@ -2,6 +2,10 @@ project('mainproj', 'c', default_options : ['wrap_mode=nodownload'], ) +if not find_program('patch', required : false).found() and not find_program('git', required : false).found() + error('MESON_SKIP_TEST: patch/git not found.') +endif + subproject('zlib') foo = subproject('foo') bar = subproject('bar') @@ -14,3 +18,6 @@ executable('grabprog2', files('src/subprojects/foo/prog2.c')) subdir('src') subproject('patchdir') + +exe = subproject('patchfile').get_variable('foo_exe') +test('test_foo', exe) diff --git a/test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0001-Change-foo-to-executable.patch b/test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0001-Change-foo-to-executable.patch new file mode 100644 index 0000000..a29fb6c --- /dev/null +++ b/test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0001-Change-foo-to-executable.patch @@ -0,0 +1,33 @@ +From b79f6cc4a096f6c2888f73b947b652491885896a Mon Sep 17 00:00:00 2001 +From: Xavier Claessens +Date: Fri, 30 Nov 2018 14:13:47 -0500 +Subject: [PATCH] Change foo to executable + +--- + foo.c | 4 ++++ + meson.build | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/foo.c b/foo.c +index 54f9119..468f033 100644 +--- a/foo.c ++++ b/foo.c +@@ -1,3 +1,7 @@ + int dummy_func(void) { + return 44; + } ++ ++int main(void) { ++ return dummy_func() == 44 ? 0 : 1; ++} +diff --git a/meson.build b/meson.build +index 318e81d..4a281d9 100644 +--- a/meson.build ++++ b/meson.build +@@ -1,2 +1,2 @@ + project('static lib patchdir', 'c') +-libfoo = static_library('foo', 'foo.c') ++foo_exe = executable('foo', 'foo.c') +-- +2.17.1 + diff --git a/test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0001-Change-return-value-to-43.patch b/test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0001-Change-return-value-to-43.patch new file mode 100644 index 0000000..49cf1e9 --- /dev/null +++ b/test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0001-Change-return-value-to-43.patch @@ -0,0 +1,21 @@ +From 7001dcc738e5ae7dfa8af20ed582b9a985804f72 Mon Sep 17 00:00:00 2001 +From: Xavier Claessens +Date: Fri, 30 Nov 2018 10:15:33 -0500 +Subject: [PATCH 1/2] Change return value to 43 + +--- + foo.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/foo.c b/foo.c +index 019f2ba..e4577b8 100644 +--- a/foo.c ++++ b/foo.c +@@ -1,3 +1,3 @@ + int dummy_func(void) { +- return 42; ++ return 43; + } +-- +2.17.1 + diff --git a/test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0002-Change-return-value-to-44.patch b/test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0002-Change-return-value-to-44.patch new file mode 100644 index 0000000..4794cea --- /dev/null +++ b/test cases/common/153 wrap file should not failed/subprojects/packagefiles/patchfile/0002-Change-return-value-to-44.patch @@ -0,0 +1,21 @@ +From c2da2e490b09f2e251c7f4ef7c1240acee215fec Mon Sep 17 00:00:00 2001 +From: Xavier Claessens +Date: Fri, 30 Nov 2018 10:15:47 -0500 +Subject: [PATCH 2/2] Change return value to 44 + +--- + foo.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/foo.c b/foo.c +index e4577b8..54f9119 100644 +--- a/foo.c ++++ b/foo.c +@@ -1,3 +1,3 @@ + int dummy_func(void) { +- return 43; ++ return 44; + } +-- +2.17.1 + diff --git a/test cases/common/153 wrap file should not failed/subprojects/patchfile.wrap b/test cases/common/153 wrap file should not failed/subprojects/patchfile.wrap new file mode 100644 index 0000000..3d446fe --- /dev/null +++ b/test cases/common/153 wrap file should not failed/subprojects/patchfile.wrap @@ -0,0 +1,14 @@ +[wrap-file] +directory = foo-1.0-patchfile + +source_url = http://something.invalid +source_filename = foo-1.0.tar.xz +source_hash = 9ed8f67d75e43d3be161efb6eddf30dd01995a958ca83951ea64234bac8908c1 +lead_directory_missing = true + +patch_directory = foo-1.0 + +diff_files = + patchfile/0001-Change-return-value-to-43.patch, + patchfile/0002-Change-return-value-to-44.patch, + patchfile/0001-Change-foo-to-executable.patch -- cgit v1.1