]> code.ossystems Code Review - openembedded-core.git/commitdiff
libdnf: allow reproducible binary builds
authorJoe Slater <joe.slater@windriver.com>
Wed, 22 Jul 2020 20:31:11 +0000 (13:31 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 25 Jul 2020 14:11:00 +0000 (15:11 +0100)
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.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch [new file with mode: 0644]
meta/recipes-devtools/libdnf/libdnf_0.48.0.bb

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 (file)
index 0000000..e3784cc
--- /dev/null
@@ -0,0 +1,26 @@
+libdnf: allow reproducible binary builds
+
+Use a dummy directory for test data if not built WITH_TESTS.  Allow for overriding
+TESTDATADIR, since the default is guaranteed to be wrong for target builds.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -133,7 +133,12 @@ add_definitions(-DG_LOG_DOMAIN=\\"libdnf
+ add_definitions(-D_FILE_OFFSET_BITS=64)
+ # tests
+-add_definitions(-DTESTDATADIR=\\"${CMAKE_SOURCE_DIR}/data/tests\\")
++if(NOT WITH_TESTS)
++  set(TEST_DATA_DIR "/notests")
++elseif(NOT DEFINED TEST_DATA_DIR)
++  set(TEST_DATA_DIR "${CMAKE_SOURCE_DIR}/data/tests")
++endif()
++add_definitions(-DTESTDATADIR=\\"${TEST_DATA_DIR}\\")
+ # librhsm
+ if(ENABLE_RHSM_SUPPORT)
index 947b2f23484ce8429c3ea74551ea4740a2bfccf9..37991e6d8096677b61a8d0a8c12357a3813d52d3 100644 (file)
@@ -8,6 +8,7 @@ SRC_URI = "git://github.com/rpm-software-management/libdnf;branch=dnf-4-master \
            file://0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch \
            file://0001-Add-WITH_TESTS-option.patch \
            file://0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch \
+           file://enable_test_data_dir_set.patch \
            "
 
 SRCREV = "46a28d0cf09277fffc11392e5e362a2eda0d53a8"