Skip to contentSkip to conversation

libsolv: don't pick up bundled db from host rpm

PATCH Superseded Max Krummenacher 2 participants 3 messages May 17, 2017 – May 18, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsolv: don't pick up bundled db from host rpm

With rpm v4 in openembedded but on a host with existing /usr/include/rpm/db.h the build fails to compile.

---
 ...01-don-t-pick-up-bundled-db-from-host-rpm.patch | 38 ++++++++++++++++++++++
 meta/recipes-extended/libsolv/libsolv_0.6.26.bb    |  3 +-
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/libsolv/libsolv/0001-don-t-pick-up-bundled-db-from-host-rpm.patch
meta/recipes-extended/libsolv/libsolv/0001-don-t-pick-up-bundled-db-from-host-rpm.patch new file +38 -0
new file mode 100644
index 0000000..e0eb36e
@@ -0,0 +1,38 @@
+From 7bd5f609ce63876e2d52dea26cd40cbd2cfb4532 Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <[email protected]>
+Date: Sat, 7 May 2017 20:28:11 +0100
+Subject: [PATCH] don't pick up bundled db from host rpm
+
+With rpm v4 in openembedded but on a host with existing /usr/include/rpm/db.h
+the build is configured to have HAVE_RPM_DB_H but fails to compile.
+
+Fixes the following link errors:
+| ../ext/libsolvext.so.0: undefined reference to `db_create_rpmdb'
+| ../ext/libsolvext.so.0: undefined reference to `db_env_create_rpmdb'
+
+Observed on a openSUSE Leap 42.1 build host with rpm-devel installed.
+
+Upstream-Status: Inappropriate [cross build specific]
+
+Signed-off-by: Max Krummenacher <[email protected]>
+---
+ CMakeLists.txt | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 838f9d0..b64bcd9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -205,8 +205,7 @@ IF (ENABLE_RPMDB)
+     ENDIF (RPMMISC_LIBRARY)
+   ENDIF (RPM5)
+ 
+-  # check if rpm contains a bundled berkeley db
+-  CHECK_INCLUDE_FILE(rpm/db.h HAVE_RPM_DB_H)
++  set(HAVE_RPM_DB_H 0)
+   IF (NOT HAVE_RPM_DB_H)
+     FIND_LIBRARY (DB_LIBRARY NAMES db)
+     IF (DB_LIBRARY)
+-- 
+2.6.6
+
meta/recipes-extended/libsolv/libsolv_0.6.26.bb +2 -1
index a33c251..ccd9cfa 100644
@@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8"
 DEPENDS = "expat zlib rpm"
 
 SRC_URI = "git://github.com/openSUSE/libsolv.git \
-           "
+           file://0001-don-t-pick-up-bundled-db-from-host-rpm.patch \
+          "
 SRC_URI_append_libc-musl = " file://0001-Add-fallback-fopencookie-implementation.patch \
                              file://0002-Fixes-to-internal-fopencookie-implementation.patch \
                            "
Signature · 1 line
2.9.3
#1 lore raw
Quoted 5 lines · Max Krummenacher

With rpm v4 in openembedded but on a host with existing /usr/include/rpm/db.h the build fails to compile.

+-  # check if rpm contains a bundled berkeley db
+-  CHECK_INCLUDE_FILE(rpm/db.h HAVE_RPM_DB_H)
++  set(HAVE_RPM_DB_H 0)

The problem seems to be that CHECK_INCLUDE_FILE is incorrectly looking for headers in host's /usr/include. Perhaps you could look into why that is happening and if it can be fixed, rather than fix one specific instance in libsolv where it is known to cause trouble?

Alex

#2 lore raw

Hi Alex

Am Donnerstag, den 18.05.2017, 08:37 +0300 schrieb Alexander Kanavin:

Quoted 11 lines · Max Krummenacher
Quoted 5 lines

With rpm v4 in openembedded but on a host with existing /usr/include/rpm/db.h the build fails to compile.

+-  # check if rpm contains a bundled berkeley db
+-  CHECK_INCLUDE_FILE(rpm/db.h HAVE_RPM_DB_H)
++  set(HAVE_RPM_DB_H 0)

The problem seems to be that CHECK_INCLUDE_FILE is incorrectly looking for headers in host's /usr/include. Perhaps you could look into why that is happening and if it can be fixed, rather than fix one specific instance in libsolv where it is known to cause trouble?

Ok, will try to find a more generic solution.

Max

Quoted 3 lines

Alex