diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2025-01-02 23:09:27 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-01-04 12:34:04 +0000 |
commit | fa9e0cf4b1644e08428c75656ff0d4fb7c057e4c (patch) | |
tree | 3edd75b2e0804c6c2aea03558609553ebfdfc258 | |
parent | 02ea18bc689c92e7fa609c7bc65eafd6fe1b79ec (diff) | |
download | poky-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.patch | 57 | ||||
-rw-r--r-- | meta/recipes-devtools/rpm/rpm_4.20.0.bb | 1 |
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 @@ | |||
1 | From 2d6beb620896a59cfd685b51a19057e5c5c4ab41 Mon Sep 17 00:00:00 2001 | ||
2 | From: Chen Qi <Qi.Chen@windriver.com> | ||
3 | Date: Thu, 19 Dec 2024 11:54:54 +0800 | ||
4 | Subject: [PATCH] Set RPM_PLUGINDIR in top level CMakeLists.txt | ||
5 | |||
6 | We have in macros.in: | ||
7 | %__plugindir @RPM_PLUGINDIR@ | ||
8 | |||
9 | This means, if RPM_PLUGINDIR is not set, %__plugindir will be empty. | ||
10 | This in turn results in error message when running 'dnf'. | ||
11 | |||
12 | e.g., | ||
13 | dnf --help >/dev/null | ||
14 | error: /usr/lib64/rpm/macros: line 1183: Macro %__plugindir has empty body | ||
15 | error: /usr/lib64/rpm/macros: line 1183: Macro %__plugindir has empty body | ||
16 | |||
17 | So we should move this directory setting into the top level CMakeLists.txt. | ||
18 | |||
19 | Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/3496] | ||
20 | |||
21 | Signed-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 | |||
27 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
28 | index 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() | ||
41 | diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt | ||
42 | index 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 | -- | ||
56 | 2.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 | ||
43 | PE = "1" | 44 | PE = "1" |