Skip to contentSkip to conversation

libmusicbrainz: Rework native and target pieces

PATCH New Khem Raj 2 participants 3 messages May 8, 2021 – May 10, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 libmusicbrainz: Rework native and target pieces

Build the native tools via a proper native recipe
Once done this way we do not need any patches

Bump SRCREV to latest which brings in one fix [1]

[1] https://github.com/metabrainz/libmusicbrainz/commit/8be45b12a86bc0e46f2f836c8ac88e1e98d82aee

Cc Andreas Müller <[email protected]>

---
v2: Improve commit msg

 .../files/allow-libdir-override.patch         | 21 ------------
 .../musicbrainz/libmusicbrainz_git.bb         | 34 +++++--------------
 2 files changed, 9 insertions(+), 46 deletions(-)
 delete mode 100644 meta-multimedia/recipes-multimedia/musicbrainz/files/allow-libdir-override.patch
meta-multimedia/recipes-multimedia/musicbrainz/files/allow-libdir-override.patch deleted +0 -21
deleted file mode 100644
index db4d6e8c99..0000000000
@@ -1,21 +0,0 @@
-Allow LIB_INSTALL_DIR to be set by the the cmake configure invocation.  We dont
-easily have a way of determining something that patches ${LIB_SUFFIX} so we'll
-set LIB_INSTALL_DIR.
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Kumar Gala <[email protected]>
-
-Index: git/CMakeLists.txt
-===================================================================
---- git.orig/CMakeLists.txt
-+++ git/CMakeLists.txt
-@@ -36,7 +36,7 @@ FIND_PACKAGE(LibXml2 REQUIRED)
- SET(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
- SET(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Installation prefix for executables and object code libraries" FORCE)
- SET(BIN_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/bin CACHE PATH "Installation prefix for user executables" FORCE)
--SET(LIB_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE PATH  "Installation prefix for object code libraries" FORCE)
-+SET(LIB_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE PATH  "Installation prefix for object code libraries")
- SET(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include CACHE PATH "Installation prefix for C header files" FORCE)
- 
- CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libmusicbrainz5.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libmusicbrainz5.pc)
meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb +9 -25
index ca9d94a19c..f5ea36da91 100644
@@ -3,38 +3,22 @@ DESCRIPTION = "The MusicBrainz client is a library which can be built into other
 HOMEPAGE = "http://musicbrainz.org"
 LICENSE = "LGPLv2.1+"
 LIC_FILES_CHKSUM = "file://COPYING.txt;md5=fbc093901857fcd118f065f900982c24"
-DEPENDS = "expat libxml2 libxml2-native neon neon-native"
+DEPENDS = "expat libxml2 libxml2-native neon neon-native libmusicbrainz-native"
 
 PV = "5.1.0+git${SRCPV}"
 
-SRCREV = "44c05779dd996035758f5ec426766aeedce29cc3"
-SRC_URI = "git://github.com/metabrainz/libmusicbrainz.git \
-           file://allow-libdir-override.patch "
+SRCREV = "8be45b12a86bc0e46f2f836c8ac88e1e98d82aee"
+SRC_URI = "git://github.com/metabrainz/libmusicbrainz.git"
 
 S = "${WORKDIR}/git"
 
 inherit cmake pkgconfig
 
-do_configure_prepend() {
-    # The native build really doesn't like being rebuilt, so delete
-    # it if it's already present. Also delete all other files not
-    # known to Git to fix subsequent invocations of do_configure.
-    git clean -dfx -e /.pc/ -e /patches/ .
-    mkdir build-native
-    cd build-native
-    LDFLAGS="${BUILD_LDFLAGS}" \
-          cmake -DCMAKE_C_FLAGS=${BUILD_CFLAGS} \
-          -DCMAKE_C_COMPILER=${BUILD_CC} \
-          -DCMAKE_CXX_FLAGS=${BUILD_CXXFLAGS} \
-          -DCMAKE_CXX_COMPILER=${BUILD_CXX} \
-          -DCMAKE_EXE_LINKER_FLAGS=${BUILD_LDFLAGS} \
-          ..
-    make make-c-interface
-    cd ..
-}
+EXTRA_OECMAKE_append_class-target = " -DIMPORT_EXECUTABLES=${STAGING_LIBDIR_NATIVE}/cmake/${BPN}/ImportExecutables.cmake"
 
-EXTRA_OECMAKE = "-DLIB_INSTALL_DIR:PATH=${libdir} \
-                 -DIMPORT_EXECUTABLES=build-native/ImportExecutables.cmake"
+do_install_append_class-native() {
+    install -Dm 0644 ${B}/ImportExecutables.cmake ${D}${libdir}/cmake/${BPN}/ImportExecutables.cmake
+    sed -e "s#${B}/src/##g" ${D}${libdir}/cmake/${BPN}/ImportExecutables.cmake
+}
 
-# out-of-tree building doesn't appear to work for this package.
-B = "${S}"
+BBCLASSEXTEND = "native"
Signature · 1 line
2.31.1
author
#1 lore raw

PATCH v2 1/1 python3-m2crypto: Pass correct ABI defines to swig

This ensures that WORDSIZE is as per the target, currently this does not get it right for cross-compilation env, and OE uses multilib headers by default ( even when you do not use multilib ) which means if WORDSIZE is wrong it will go on to include wrong headers due to these artificial stubs

Fixes
swig -python -py3 -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot-native/usr/bin/aarch64-oe-linux/../../lib/aarch64-oe-linux/gcc/aarch64-oe-linux/11.1.0/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot-native/usr/bin/aarch64-oe-linux/../../lib/aarch64-oe-linux/gcc/aarch64-oe-linux/11.1.0/include-fixed -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/lib/aarch64-oe-linux/11.1.0/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include/python3.9 -I/usr/include/openssl -includeall -modern -builtin -outdir TOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/M2Crypto-0.37.1/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
TOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include/openssl/opensslconf.h:23: Error: Unable to find 'openssl/opensslconf-32.h'

Cc Martin Jansa <[email protected]>

---
v1->v2:
- Fix typos in commit
- Drop do_configure_prepend as its no longer needed

 .../python/python3-m2crypto_0.37.1.bb         | 28 ++-----------------
 1 file changed, 3 insertions(+), 25 deletions(-)
meta-python/recipes-devtools/python/python3-m2crypto_0.37.1.bb +3 -25
index 896d9d2cc4..ef123075c7 100644
@@ -33,31 +33,9 @@ DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR}"
 
 SWIG_FEATURES_x86 = "-D__i386__"
 SWIG_FEATURES_x32 = "-D__ILP32__"
-SWIG_FEATURES ?= "-D__${HOST_ARCH}__"
-export SWIG_FEATURES
 
-# Get around a problem with swig, but only if the
-# multilib header file exists.
-#
-do_configure_prepend() {
-    ${CPP} -dM - < /dev/null | grep -v '__\(STDC\|REGISTER_PREFIX\|GNUC\|STDC_HOSTED\)__' \
-    | sed 's/^\(#define \([^ ]*\) .*\)$/#undef \2\n\1/' > ${S}/SWIG/gcc_macros.h
-
-    if [ "${SITEINFO_BITS}" = "64" ];then
-        bit="64"
-    else
-        bit="32"
-    fi
-
-    if [ -e ${STAGING_INCDIR}/openssl/opensslconf-${bit}.h ] ;then
-        for i in SWIG/_ec.i SWIG/_evp.i; do
-            sed -i -e "s/opensslconf.*\./opensslconf-${bit}\./" "${S}/$i"
-        done
-    elif [ -e ${STAGING_INCDIR}/openssl/opensslconf-n${bit}.h ] ;then
-        for i in SWIG/_ec.i SWIG/_evp.i; do
-            sed -i -e "s/opensslconf.*\./opensslconf-n${bit}\./" "${S}/$i"
-        done
-    fi
-}
+SWIG_FEATURES ?= "-D__${HOST_ARCH}__ ${@['-D__ILP32__','-D__LP64__'][d.getVar('SITEINFO_BITS') != '32']}"
+
+export SWIG_FEATURES
 
 BBCLASSEXTEND = "native"
Signature · 1 line
2.31.1
Acked-by on v2 1/1
#2 lore raw

Re: [meta-oe][PATCH v2] python3-m2crypto: Pass correct ABI defines to swig

Quoted 9 lines · Khem Raj

This ensures that WORDSIZE is as per the target, currently this does not get it right for cross-compilation env, and OE uses multilib headers by default ( even when you do not use multilib ) which means if WORDSIZE is wrong it will go on to include wrong headers due to these artificial stubs

Fixes
swig -python -py3 -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot-native/usr/bin/aarch64-oe-linux/../../lib/aarch64-oe-linux/gcc/aarch64-oe-linux/11.1.0/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot-native/usr/bin/aarch64-oe-linux/../../lib/aarch64-oe-linux/gcc/aarch64-oe-linux/11.1.0/include-fixed -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/lib/aarch64-oe-linux/11.1.0/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include/python3.9 -I/usr/include/openssl -includeall -modern -builtin -outdir TOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/M2Crypto-0.37.1/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
TOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include/openssl/opensslconf.h:23: Error: Unable to find 'openssl/opensslconf-32.h'

Quoted 6 lines
Cc Martin Jansa <[email protected]>

---
v1->v2:
- Fix typos in commit
- Drop do_configure_prepend as its no longer needed

Thanks Khem