poky/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch
Alexander Kanavin 3060a76799 libdnf: upgrade 0.73.2 -> 0.73.3
(From OE-Core rev: c90628632e0e73de1883463a85e1629a5c6136a9)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-28 09:14:27 +01:00

34 lines
1.1 KiB
Diff

From 3d77c2ff41b1a65d0f4852ed21d7a8ec41b368a8 Mon Sep 17 00:00:00 2001
From: Joe Slater <joe.slater@windriver.com>
Date: Wed, 22 Jul 2020 13:31:11 -0700
Subject: [PATCH] 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>
---
CMakeLists.txt | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 60c66e94..1459dfbf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -132,7 +132,12 @@ add_definitions(-DGETTEXT_DOMAIN=\\"libdnf\\")
add_definitions(-DG_LOG_DOMAIN=\\"libdnf\\")
# 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)