diff options
author | Joe Slater <joe.slater@windriver.com> | 2020-07-22 13:31:11 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-07-25 15:11:05 +0100 |
commit | d88024e7837f572448181ed57db69a8580ea2e84 (patch) | |
tree | 1ee0c9553e32dd75fb64fc2646340a37403b6a45 /meta/recipes-devtools/libdnf | |
parent | 38519b6f4acef41d3d6d08e457f5b3cd880866c5 (diff) | |
download | poky-d88024e7837f572448181ed57db69a8580ea2e84.tar.gz |
libdnf: allow reproducible binary builds
Use a static TESTDATADIR if tests are disabled. Allow
override of TESTDATADIR if tests are enabled since the
default will be wrong for target builds.
(From OE-Core rev: 43d24a3726dc1b639261429cc6537e947281143c)
Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/libdnf')
-rw-r--r-- | meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch | 26 | ||||
-rw-r--r-- | meta/recipes-devtools/libdnf/libdnf_0.48.0.bb | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch b/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch new file mode 100644 index 0000000000..e3784cc9e4 --- /dev/null +++ b/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | libdnf: allow reproducible binary builds | ||
2 | |||
3 | Use a dummy directory for test data if not built WITH_TESTS. Allow for overriding | ||
4 | TESTDATADIR, since the default is guaranteed to be wrong for target builds. | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Joe Slater <joe.slater@windriver.com> | ||
9 | |||
10 | |||
11 | --- a/CMakeLists.txt | ||
12 | +++ b/CMakeLists.txt | ||
13 | @@ -133,7 +133,12 @@ add_definitions(-DG_LOG_DOMAIN=\\"libdnf | ||
14 | add_definitions(-D_FILE_OFFSET_BITS=64) | ||
15 | |||
16 | # tests | ||
17 | -add_definitions(-DTESTDATADIR=\\"${CMAKE_SOURCE_DIR}/data/tests\\") | ||
18 | +if(NOT WITH_TESTS) | ||
19 | + set(TEST_DATA_DIR "/notests") | ||
20 | +elseif(NOT DEFINED TEST_DATA_DIR) | ||
21 | + set(TEST_DATA_DIR "${CMAKE_SOURCE_DIR}/data/tests") | ||
22 | +endif() | ||
23 | +add_definitions(-DTESTDATADIR=\\"${TEST_DATA_DIR}\\") | ||
24 | |||
25 | # librhsm | ||
26 | if(ENABLE_RHSM_SUPPORT) | ||
diff --git a/meta/recipes-devtools/libdnf/libdnf_0.48.0.bb b/meta/recipes-devtools/libdnf/libdnf_0.48.0.bb index 947b2f2348..37991e6d80 100644 --- a/meta/recipes-devtools/libdnf/libdnf_0.48.0.bb +++ b/meta/recipes-devtools/libdnf/libdnf_0.48.0.bb | |||
@@ -8,6 +8,7 @@ SRC_URI = "git://github.com/rpm-software-management/libdnf;branch=dnf-4-master \ | |||
8 | file://0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch \ | 8 | file://0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch \ |
9 | file://0001-Add-WITH_TESTS-option.patch \ | 9 | file://0001-Add-WITH_TESTS-option.patch \ |
10 | file://0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch \ | 10 | file://0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch \ |
11 | file://enable_test_data_dir_set.patch \ | ||
11 | " | 12 | " |
12 | 13 | ||
13 | SRCREV = "46a28d0cf09277fffc11392e5e362a2eda0d53a8" | 14 | SRCREV = "46a28d0cf09277fffc11392e5e362a2eda0d53a8" |