diff options
Diffstat (limited to 'meta/recipes-devtools/libdnf')
9 files changed, 320 insertions, 0 deletions
diff --git a/meta/recipes-devtools/libdnf/libdnf/0001-Add-WITH_TESTS-option.patch b/meta/recipes-devtools/libdnf/libdnf/0001-Add-WITH_TESTS-option.patch new file mode 100644 index 0000000000..607995a394 --- /dev/null +++ b/meta/recipes-devtools/libdnf/libdnf/0001-Add-WITH_TESTS-option.patch @@ -0,0 +1,49 @@ +From 7d60d62b5c5374156703ca7262fb2f85ec5db119 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Tue, 6 Nov 2018 13:54:43 +0100 +Subject: [PATCH] Add WITH_TESTS option + +This makes a dependency on cppunit optional. + +Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/1382] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> + +--- + CMakeLists.txt | 3 +++ + python/hawkey/CMakeLists.txt | 2 ++ + 2 files changed, 5 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9c6e1b2f..8599c540 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,6 +33,7 @@ option(WITH_MAN "Enables hawkey man page generation" ON) + option(WITH_ZCHUNK "Build with zchunk support" ON) + option(ENABLE_RHSM_SUPPORT "Build with Red Hat Subscription Manager support?" OFF) + option(ENABLE_SOLV_URPMREORDER "Build with support for URPM-like solution reordering?" OFF) ++option(WITH_TESTS "Enables unit tests" ON) + + + # build options - debugging +@@ -179,8 +180,10 @@ endif() + + + # build tests ++IF (WITH_TESTS) + enable_testing() + add_subdirectory(tests) ++ENDIF() + if(WITH_BINDINGS) + add_subdirectory(python/hawkey) + endif() +diff --git a/python/hawkey/CMakeLists.txt b/python/hawkey/CMakeLists.txt +index d9645346..84d17204 100644 +--- a/python/hawkey/CMakeLists.txt ++++ b/python/hawkey/CMakeLists.txt +@@ -50,4 +50,6 @@ target_link_libraries(_hawkeymodule ${PYTHON_LIBRARY}) + install(FILES __init__.py DESTINATION ${PYTHON_INSTALL_DIR}/hawkey) + install(TARGETS _hawkeymodule LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}/hawkey) + ++IF (WITH_TESTS) + add_subdirectory(tests) ++ENDIF() diff --git a/meta/recipes-devtools/libdnf/libdnf/0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch b/meta/recipes-devtools/libdnf/libdnf/0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch new file mode 100644 index 0000000000..791a32e748 --- /dev/null +++ b/meta/recipes-devtools/libdnf/libdnf/0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch @@ -0,0 +1,31 @@ +From 9bb7630915c3e787732463a3e2064fe0e177101b Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Thu, 24 Nov 2016 14:33:07 +0200 +Subject: [PATCH 1/4] FindGtkDoc.cmake: drop the requirement for + GTKDOC_SCANGOBJ_WRAPPER + +For some reason cmake is not able to find it when building in openembedded, +and it's bundled with the source code anyway. + +Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/312] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + cmake/modules/FindGtkDoc.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/modules/FindGtkDoc.cmake b/cmake/modules/FindGtkDoc.cmake +index 92b2cc7..39f34bd 100644 +--- a/cmake/modules/FindGtkDoc.cmake ++++ b/cmake/modules/FindGtkDoc.cmake +@@ -52,7 +52,7 @@ find_program(GTKDOC_MKHTML_EXE gtkdoc-mkhtml PATH "${GLIB_PREFIX}/bin") + find_program(GTKDOC_FIXXREF_EXE gtkdoc-fixxref PATH "${GLIB_PREFIX}/bin") + + find_package_handle_standard_args(GtkDoc +- REQUIRED_VARS GTKDOC_SCAN_EXE GTKDOC_SCANGOBJ_EXE GTKDOC_SCANGOBJ_WRAPPER GTKDOC_MKDB_EXE GTKDOC_MKHTML_EXE GTKDOC_FIXXREF_EXE ++ REQUIRED_VARS GTKDOC_SCAN_EXE GTKDOC_SCANGOBJ_EXE GTKDOC_MKDB_EXE GTKDOC_MKHTML_EXE GTKDOC_FIXXREF_EXE + VERSION_VAR GtkDoc_VERSION) + + # :: +-- +2.11.0 + diff --git a/meta/recipes-devtools/libdnf/libdnf/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch b/meta/recipes-devtools/libdnf/libdnf/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch new file mode 100644 index 0000000000..10450defbe --- /dev/null +++ b/meta/recipes-devtools/libdnf/libdnf/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch @@ -0,0 +1,27 @@ +From 9294cd19e5e3121fb8d37b44ee82dd7c4b3ab2c7 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Tue, 7 Feb 2017 12:16:03 +0200 +Subject: [PATCH] Get parameters for both libsolv and libsolvext (libdnf is + + using both) + +Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/312] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b722d4fb..ce88b9e3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -45,7 +45,7 @@ endif() + + # build dependencies + find_package(Gpgme REQUIRED) +-PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv) ++PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv libsolvext) + set(LIBSOLV_LIBRARY ${LIBSOLV_LIBRARIES}) + find_package(OpenSSL REQUIRED) + diff --git a/meta/recipes-devtools/libdnf/libdnf/0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch b/meta/recipes-devtools/libdnf/libdnf/0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch new file mode 100644 index 0000000000..2d8213cc87 --- /dev/null +++ b/meta/recipes-devtools/libdnf/libdnf/0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch @@ -0,0 +1,42 @@ +From b570c7f8bd089deec7da2b108aa789a27025a473 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Tue, 19 Nov 2019 13:46:09 +0100 +Subject: [PATCH] Look fo sphinx only if documentation is actually enabled + +Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/1383] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + docs/hawkey/CMakeLists.txt | 20 +++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + +diff --git a/docs/hawkey/CMakeLists.txt b/docs/hawkey/CMakeLists.txt +index 52cc35c6..63c7672f 100644 +--- a/docs/hawkey/CMakeLists.txt ++++ b/docs/hawkey/CMakeLists.txt +@@ -2,15 +2,17 @@ + # tell sphinx-build to do them both in one go: + + +-find_program(SPHINX_PROGRAM NAMES "sphinx-build-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") +-if(NOT EXISTS ${SPHINX_PROGRAM}) +- find_program(SPHINX_PROGRAM NAMES sphinx-build-${PYTHON_VERSION_MAJOR}) +-endif() +-if(NOT EXISTS ${SPHINX_PROGRAM}) +- find_program(SPHINX_PROGRAM NAMES sphinx-build) +-endif() +-if(NOT EXISTS ${SPHINX_PROGRAM}) +- message(FATAL_ERROR "Sphinx program not found." ) ++if (WITH_HTML OR WITH_MAN) ++ find_program(SPHINX_PROGRAM NAMES "sphinx-build-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") ++ if(NOT EXISTS ${SPHINX_PROGRAM}) ++ find_program(SPHINX_PROGRAM NAMES sphinx-build-${PYTHON_VERSION_MAJOR}) ++ endif() ++ if(NOT EXISTS ${SPHINX_PROGRAM}) ++ find_program(SPHINX_PROGRAM NAMES sphinx-build) ++ endif() ++ if(NOT EXISTS ${SPHINX_PROGRAM}) ++ message(FATAL_ERROR "Sphinx program not found." ) ++ endif() + endif() + + if(WITH_HTML) diff --git a/meta/recipes-devtools/libdnf/libdnf/0001-drop-FindPythonInstDir.cmake.patch b/meta/recipes-devtools/libdnf/libdnf/0001-drop-FindPythonInstDir.cmake.patch new file mode 100644 index 0000000000..d483dd410b --- /dev/null +++ b/meta/recipes-devtools/libdnf/libdnf/0001-drop-FindPythonInstDir.cmake.patch @@ -0,0 +1,42 @@ +From c0a465ccae395871ab10932975e37894220bc6a1 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Tue, 1 Jun 2021 10:23:59 +0800 +Subject: [PATCH] drop FindPythonInstDir.cmake + +Since commit [1] applied, PYTHON_INSTALL_DIR is not right +on nativesdk build +... +|Building for python3 +|-- Python install dir is +|tmp-glibc/work/x86_64-nativesdk-wrlinuxsdk-linux/nativesdk-libdnf/0.63.0-r0/ +recipe-sysroot-native/usr/lib/python3.9/site-packages +... + +Yocto manually set PYTHON_INSTALL_DIR from recipe, it is not +necessary to call FindPythonInstDir.cmake which will override +Yocto setting + +[1] https://github.com/rpm-software-management/libdnf/commit/f1cffbfb9f338da827e233c2d8ac3a25a6a59a69 + +Upstream-Status: Inappropriate [Yocto specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + cmake/modules/FindPythonInstDir.cmake | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/cmake/modules/FindPythonInstDir.cmake b/cmake/modules/FindPythonInstDir.cmake +index ed098ded..8b137891 100644 +--- a/cmake/modules/FindPythonInstDir.cmake ++++ b/cmake/modules/FindPythonInstDir.cmake +@@ -1,6 +1 @@ +-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c " +-from sys import stdout +-from sysconfig import get_path +-path=get_path(name='platlib', vars={'platbase':'${CMAKE_INSTALL_PREFIX}'}) +-stdout.write(path)" +-OUTPUT_VARIABLE PYTHON_INSTALL_DIR) ++ +-- +2.18.1 + diff --git a/meta/recipes-devtools/libdnf/libdnf/0001-libdnf-dnf-context.cpp-do-not-try-to-access-BDB-data.patch b/meta/recipes-devtools/libdnf/libdnf/0001-libdnf-dnf-context.cpp-do-not-try-to-access-BDB-data.patch new file mode 100644 index 0000000000..6f8a3dcb50 --- /dev/null +++ b/meta/recipes-devtools/libdnf/libdnf/0001-libdnf-dnf-context.cpp-do-not-try-to-access-BDB-data.patch @@ -0,0 +1,37 @@ +From 2f7382b35d59fe08034603497e82ffb943fedef1 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Wed, 30 Jun 2021 15:31:16 +0200 +Subject: [PATCH] libdnf/dnf-context.cpp: do not try to access BDB database + +Upstream-Status: Inappropriate [upstream needs to rework this to support +sqlite] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + libdnf/dnf-context.cpp | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp +index 86f71a79..9cdcf769 100644 +--- a/libdnf/dnf-context.cpp ++++ b/libdnf/dnf-context.cpp +@@ -2264,20 +2264,6 @@ dnf_context_setup(DnfContext *context, + !dnf_context_set_os_release(context, error)) + return FALSE; + +- /* setup a file monitor on the rpmdb, if we're operating on the native / */ +- if (g_strcmp0(priv->install_root, "/") == 0) { +- rpmdb_path = g_build_filename(priv->install_root, "var/lib/rpm/Packages", NULL); +- file_rpmdb = g_file_new_for_path(rpmdb_path); +- priv->monitor_rpmdb = g_file_monitor_file(file_rpmdb, +- G_FILE_MONITOR_NONE, +- NULL, +- error); +- if (priv->monitor_rpmdb == NULL) +- return FALSE; +- g_signal_connect(priv->monitor_rpmdb, "changed", +- G_CALLBACK(dnf_context_rpmdb_changed_cb), context); +- } +- + /* copy any vendor distributed cached metadata */ + if (!dnf_context_copy_vendor_cache(context, error)) + return FALSE; diff --git a/meta/recipes-devtools/libdnf/libdnf/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch b/meta/recipes-devtools/libdnf/libdnf/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch new file mode 100644 index 0000000000..475c8f120b --- /dev/null +++ b/meta/recipes-devtools/libdnf/libdnf/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch @@ -0,0 +1,28 @@ +From 18c2c06017784cd641cc8a3deee5fc472008f7f4 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Fri, 30 Dec 2016 18:24:50 +0200 +Subject: [PATCH] Set libsolv variables with pkg-config (cmake's own module + + doesn't work properly). + +Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/312] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> + +--- + CMakeLists.txt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 16b63308..b722d4fb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -45,7 +45,8 @@ endif() + + # build dependencies + find_package(Gpgme REQUIRED) +-find_package(LibSolv 0.6.30 REQUIRED COMPONENTS ext) ++PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv) ++set(LIBSOLV_LIBRARY ${LIBSOLV_LIBRARIES}) + find_package(OpenSSL REQUIRED) + + 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 @@ +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) diff --git a/meta/recipes-devtools/libdnf/libdnf_0.65.0.bb b/meta/recipes-devtools/libdnf/libdnf_0.65.0.bb new file mode 100644 index 0000000000..03c56e934a --- /dev/null +++ b/meta/recipes-devtools/libdnf/libdnf_0.65.0.bb @@ -0,0 +1,38 @@ +SUMMARY = "Library providing simplified C and Python API to libsolv" +HOMEPAGE = "https://github.com/rpm-software-management/libdnf" +DESCRIPTION = "This library provides a high level package-manager. It's core library of dnf, PackageKit and rpm-ostree. It's replacement for deprecated hawkey library which it contains inside and uses librepo under the hood." +LICENSE = "LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" + +SRC_URI = "git://github.com/rpm-software-management/libdnf;branch=dnf-4-master;protocol=https \ + file://0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch \ + file://0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch \ + 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 \ + file://0001-drop-FindPythonInstDir.cmake.patch \ + file://0001-libdnf-dnf-context.cpp-do-not-try-to-access-BDB-data.patch \ + " + +SRCREV = "cee3e1c59f849d9be1bb8d7db3090cea5c59f4b6" +UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(?!4\.90)\d+(\.\d+)+)" + +S = "${WORKDIR}/git" + +DEPENDS = "glib-2.0 libsolv libcheck librepo rpm gtk-doc libmodulemd json-c swig-native" + +inherit gtk-doc gobject-introspection cmake pkgconfig setuptools3-base + +EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DWITH_MAN=OFF -DPYTHON_DESIRED=3 \ + ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DWITH_GIR=ON', '-DWITH_GIR=OFF', d)} \ + -DWITH_TESTS=OFF \ + -DWITH_ZCHUNK=OFF \ + -DWITH_HTML=OFF \ + " +EXTRA_OECMAKE:append:class-native = " -DWITH_GIR=OFF" +EXTRA_OECMAKE:append:class-nativesdk = " -DWITH_GIR=OFF" + +BBCLASSEXTEND = "native nativesdk" +SKIP_RECIPE[libdnf] ?= "${@bb.utils.contains('PACKAGE_CLASSES', 'package_rpm', '', 'Does not build without package_rpm in PACKAGE_CLASSES due disabled rpm support in libsolv', d)}" + |