summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2025-01-02 23:09:27 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-04 12:34:04 +0000
commitfa9e0cf4b1644e08428c75656ff0d4fb7c057e4c (patch)
tree3edd75b2e0804c6c2aea03558609553ebfdfc258
parent02ea18bc689c92e7fa609c7bc65eafd6fe1b79ec (diff)
downloadpoky-fa9e0cf4b1644e08428c75656ff0d4fb7c057e4c.tar.gz
rpm: avoid empty plugindir error
When using dnf/rpm, we'll see error messages like below: error: /usr/lib64/rpm/macros: line 1183: Macro %__plugindir has empty body The problem was introduced by the following commit in RPM upstream: https://github.com/rpm-software-management/rpm/commit/ab28534f9e68aff8be65cd1adbac86b5a2cafde4 We'll need to move RPM_PLUGINDIR definition to top-level CMakefile.txt to solve this problem. (From OE-Core rev: 3a54d93052cb7f3d591517a873e516136e965ba8) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Set-RPM_PLUGINDIR-in-top-level-CMakeLists.txt.patch57
-rw-r--r--meta/recipes-devtools/rpm/rpm_4.20.0.bb1
2 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/files/0001-Set-RPM_PLUGINDIR-in-top-level-CMakeLists.txt.patch b/meta/recipes-devtools/rpm/files/0001-Set-RPM_PLUGINDIR-in-top-level-CMakeLists.txt.patch
new file mode 100644
index 0000000000..5db69340ad
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-Set-RPM_PLUGINDIR-in-top-level-CMakeLists.txt.patch
@@ -0,0 +1,57 @@
1From 2d6beb620896a59cfd685b51a19057e5c5c4ab41 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 19 Dec 2024 11:54:54 +0800
4Subject: [PATCH] Set RPM_PLUGINDIR in top level CMakeLists.txt
5
6We have in macros.in:
7 %__plugindir @RPM_PLUGINDIR@
8
9This means, if RPM_PLUGINDIR is not set, %__plugindir will be empty.
10This in turn results in error message when running 'dnf'.
11
12e.g.,
13dnf --help >/dev/null
14error: /usr/lib64/rpm/macros: line 1183: Macro %__plugindir has empty body
15error: /usr/lib64/rpm/macros: line 1183: Macro %__plugindir has empty body
16
17So we should move this directory setting into the top level CMakeLists.txt.
18
19Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/3496]
20
21Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
22---
23 CMakeLists.txt | 3 +++
24 plugins/CMakeLists.txt | 3 ---
25 2 files changed, 3 insertions(+), 3 deletions(-)
26
27diff --git a/CMakeLists.txt b/CMakeLists.txt
28index 758ba73f4..e694b9650 100644
29--- a/CMakeLists.txt
30+++ b/CMakeLists.txt
31@@ -453,6 +453,9 @@ if (ENABLE_PYTHON)
32 add_subdirectory(python)
33 endif()
34
35+set(RPM_PLUGINDIR ${CMAKE_INSTALL_FULL_LIBDIR}/rpm-plugins
36+ CACHE PATH "rpm plugin directory")
37+
38 if (ENABLE_PLUGINS)
39 add_subdirectory(plugins)
40 endif()
41diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
42index a44056fe3..6e61a7c20 100644
43--- a/plugins/CMakeLists.txt
44+++ b/plugins/CMakeLists.txt
45@@ -42,9 +42,6 @@ if (HAVE_UNSHARE)
46 add_library(unshare MODULE unshare.c)
47 endif()
48
49-set(RPM_PLUGINDIR ${CMAKE_INSTALL_FULL_LIBDIR}/rpm-plugins
50- CACHE PATH "rpm plugin directory")
51-
52 get_property(plugins DIRECTORY PROPERTY BUILDSYSTEM_TARGETS)
53 foreach(plugin ${plugins})
54 target_link_libraries(${plugin} PRIVATE librpmio librpm ${Intl_LIBRARIES})
55--
562.25.1
57
diff --git a/meta/recipes-devtools/rpm/rpm_4.20.0.bb b/meta/recipes-devtools/rpm/rpm_4.20.0.bb
index 97483f7ddd..6c995ff50c 100644
--- a/meta/recipes-devtools/rpm/rpm_4.20.0.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.20.0.bb
@@ -38,6 +38,7 @@ SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.20.x;protoc
38 file://0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch \ 38 file://0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch \
39 file://0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch \ 39 file://0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch \
40 file://0001-CMakeLists.txt-set-libdir-to-CMAKE_INSTALL_FULL_LIBD.patch \ 40 file://0001-CMakeLists.txt-set-libdir-to-CMAKE_INSTALL_FULL_LIBD.patch \
41 file://0001-Set-RPM_PLUGINDIR-in-top-level-CMakeLists.txt.patch \
41 " 42 "
42 43
43PE = "1" 44PE = "1"