mirror of
https://git.yoctoproject.org/poky
synced 2026-04-26 18:32:13 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
38519b6f4a
commit
d88024e783
@@ -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)
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user