diff mbox series

[meta-oe,PATCHv2] wavpack: add PACKAGECONFIG for shared and enable it by default

Message ID 20231222140048.3772170-1-martin.jansa@gmail.com
State Under Review
Headers show
Series [meta-oe,PATCHv2] wavpack: add PACKAGECONFIG for shared and enable it by default | expand

Commit Message

Martin Jansa Dec. 22, 2023, 2 p.m. UTC
* fixes gstreamer1.0-plugins-good build with wavpack enabled:
  PACKAGECONFIG:append:pn-gstreamer1.0-plugins-good = " wavpack"

* 5.1.0 built shared libs by default, 5.6.0 build with CMake doesn't, causing:
  http://errors.yoctoproject.org/Errors/Details/748247/

TOPDIR/tmp-glibc/work/cortexa57-oe-linux/gstreamer1.0-plugins-good/1.22.7/recipe-sysroot-native/usr/bin/aarch64-oe-linux/../../libexec/aarch64-oe-linux/gcc/aarch64-oe-linux/13.2.0/ld: TOPDIR/tmp-glibc/work/cortexa57-oe-linux/gstreamer1.0-plugins-good/1.22.7/recipe-sysroot/usr/lib/libwavpack.a(read_words.c.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `bitset' which may bind externally can not be used when making a shared object; recompile with -fPIC
/usr/src/debug/wavpack/5.6.0/src/read_words.c:592:(.text+0xb88): dangerous relocation: unsupported relocation
collect2: error: ld returned 1 exit status

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
 ...reate-wavpack-as-versioned-shared-li.patch | 26 +++++++++++++++++++
 .../wavpack/wavpack_5.6.0.bb                  |  7 ++++-
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-multimedia/wavpack/wavpack/0001-CMakeLists.txt-create-wavpack-as-versioned-shared-li.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-multimedia/wavpack/wavpack/0001-CMakeLists.txt-create-wavpack-as-versioned-shared-li.patch b/meta-oe/recipes-multimedia/wavpack/wavpack/0001-CMakeLists.txt-create-wavpack-as-versioned-shared-li.patch
new file mode 100644
index 0000000000..145483d05c
--- /dev/null
+++ b/meta-oe/recipes-multimedia/wavpack/wavpack/0001-CMakeLists.txt-create-wavpack-as-versioned-shared-li.patch
@@ -0,0 +1,26 @@ 
+From 0cebb83c7bccf990aaec446d021b697eaeef9f7e Mon Sep 17 00:00:00 2001
+From: Martin Jansa <martin.jansa@gmail.com>
+Date: Fri, 22 Dec 2023 14:57:20 +0100
+Subject: [PATCH] CMakeLists.txt: create wavpack as versioned shared library
+
+* as autotools build does
+
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+---
+Upstream-Status: Pending
+
+ CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2597e98..7ca9bab 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -371,6 +371,7 @@ endif()
+ 
+ set_target_properties(wavpack PROPERTIES EXPORT_NAME WavPack)
+ set_target_properties(wavpack PROPERTIES PUBLIC_HEADER include/wavpack.h)
++set_target_properties(wavpack PROPERTIES SOVERSION ${PROJECT_VERSION})
+ 
+ if(WAVPACK_BUILD_PROGRAMS)
+ 
diff --git a/meta-oe/recipes-multimedia/wavpack/wavpack_5.6.0.bb b/meta-oe/recipes-multimedia/wavpack/wavpack_5.6.0.bb
index ebbc59dde8..dc5dab7626 100644
--- a/meta-oe/recipes-multimedia/wavpack/wavpack_5.6.0.bb
+++ b/meta-oe/recipes-multimedia/wavpack/wavpack_5.6.0.bb
@@ -4,8 +4,13 @@  LIC_FILES_CHKSUM = "file://license.txt;md5=bb5d037e3ad41a3c84c9f2d8bb65a7b4"
 
 DEPENDS = "openssl"
 
-SRC_URI = "git://github.com/dbry/WavPack.git;branch=master;protocol=https"
+SRC_URI = "git://github.com/dbry/WavPack.git;branch=master;protocol=https \
+    file://0001-CMakeLists.txt-create-wavpack-as-versioned-shared-li.patch \
+"
 SRCREV = "e03e8e29dc618e08e7baba9636e57ba1254874ce"
 S = "${WORKDIR}/git"
 
 inherit cmake pkgconfig
+
+PACKAGECONFIG = "shared"
+PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,,"