summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Zander <negril.nx+gentoo@gmail.com>2024-03-18 19:43:10 +0100
committerSam James <sam@gentoo.org>2024-03-21 02:20:04 +0000
commita8bfe44df5f6974ee113d0fce8f57bed123c8c0f (patch)
treec01b1a31ecd2c665a869b679f67f470ed135f5bd /media-libs/quirc
parentnet-misc/passt: add 2024.03.20 and bug fixes (diff)
downloadgentoo-a8bfe44df5f6974ee113d0fce8f57bed123c8c0f.tar.gz
gentoo-a8bfe44df5f6974ee113d0fce8f57bed123c8c0f.tar.bz2
gentoo-a8bfe44df5f6974ee113d0fce8f57bed123c8c0f.zip
media-libs/quirc: make libsdl non-optional, fix QA
The Makefile indiscriminately injects SDL_CFLAGS into QUIRC_CFLAGS and QUIRC_CXXFLAGS. Short of re-writing the whole Makefile we adhere to that dependency for now. Set a SONAME to please QA. Export CC and CXX. Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/35820 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/quirc')
-rw-r--r--media-libs/quirc/quirc-1.2-r1.ebuild (renamed from media-libs/quirc/quirc-1.2.ebuild)15
-rw-r--r--media-libs/quirc/quirc-9999.ebuild15
2 files changed, 20 insertions, 10 deletions
diff --git a/media-libs/quirc/quirc-1.2.ebuild b/media-libs/quirc/quirc-1.2-r1.ebuild
index 3f7560659bd6..6264615597ee 100644
--- a/media-libs/quirc/quirc-1.2.ebuild
+++ b/media-libs/quirc/quirc-1.2-r1.ebuild
@@ -6,7 +6,7 @@ EAPI=8
DESCRIPTION="QR decoder library"
HOMEPAGE="https://github.com/dlbeer/quirc"
-inherit multilib-minimal
+inherit flag-o-matic multilib-minimal toolchain-funcs
if [[ ${PV} = *9999* ]] ; then
inherit git-r3
@@ -21,6 +21,7 @@ fi
DEPEND="
media-libs/libjpeg-turbo:=
media-libs/libpng:=
+ media-libs/libsdl:=
opencv? ( media-libs/opencv:= )
sdl? ( media-libs/sdl-gfx:= )
"
@@ -34,8 +35,9 @@ SLOT="0/${PV}"
IUSE="opencv sdl tools v4l"
src_prepare() {
+ LIB_VERSION=$(grep '^LIB_VERSION = ' "${S}/Makefile" | cut -d ' ' -f 3 || die)
sed -r \
- -e "s#\.o libquirc.a#.o libquirc.so.${PV}#g" \
+ -e "s#\.o libquirc.a#.o libquirc.so.${LIB_VERSION}#g" \
-e '/^QUIRC_CFLAGS/ s/$/ -fPIC/' \
-i Makefile || die
@@ -44,6 +46,8 @@ src_prepare() {
}
multilib_src_configure() {
+ tc-export CC CXX
+
targets=( libquirc.so )
use opencv && targets+=( opencv )
use sdl && targets+=( sdl )
@@ -52,13 +56,14 @@ multilib_src_configure() {
}
multilib_src_compile() {
+ append-ldflags "-Wl,-soname,lib${QUIRC}.so.${LIB_VERSION}"
emake V=1 DESTDIR="${D}" PREFIX="${EPREFIX}/usr" "${targets[@]}"
}
multilib_src_install() {
- dolib.so "libquirc.so.${PV}"
- dosym "libquirc.so.${PV}" "${EPREFIX}/usr/$(get_libdir)/libquirc.so"
- dosym "libquirc.so.${PV}" "${EPREFIX}/usr/$(get_libdir)/libquirc.so.$(ver_cut 1)"
+ dolib.so "libquirc.so.${LIB_VERSION}"
+ dosym "libquirc.so.${LIB_VERSION}" "${EPREFIX}/usr/$(get_libdir)/libquirc.so"
+ dosym "libquirc.so.${LIB_VERSION}" "${EPREFIX}/usr/$(get_libdir)/libquirc.so.$(ver_cut 1 LIB_VERSION)"
if multilib_is_native_abi; then
into "/usr/libexec/${PN}"
diff --git a/media-libs/quirc/quirc-9999.ebuild b/media-libs/quirc/quirc-9999.ebuild
index 3f7560659bd6..6264615597ee 100644
--- a/media-libs/quirc/quirc-9999.ebuild
+++ b/media-libs/quirc/quirc-9999.ebuild
@@ -6,7 +6,7 @@ EAPI=8
DESCRIPTION="QR decoder library"
HOMEPAGE="https://github.com/dlbeer/quirc"
-inherit multilib-minimal
+inherit flag-o-matic multilib-minimal toolchain-funcs
if [[ ${PV} = *9999* ]] ; then
inherit git-r3
@@ -21,6 +21,7 @@ fi
DEPEND="
media-libs/libjpeg-turbo:=
media-libs/libpng:=
+ media-libs/libsdl:=
opencv? ( media-libs/opencv:= )
sdl? ( media-libs/sdl-gfx:= )
"
@@ -34,8 +35,9 @@ SLOT="0/${PV}"
IUSE="opencv sdl tools v4l"
src_prepare() {
+ LIB_VERSION=$(grep '^LIB_VERSION = ' "${S}/Makefile" | cut -d ' ' -f 3 || die)
sed -r \
- -e "s#\.o libquirc.a#.o libquirc.so.${PV}#g" \
+ -e "s#\.o libquirc.a#.o libquirc.so.${LIB_VERSION}#g" \
-e '/^QUIRC_CFLAGS/ s/$/ -fPIC/' \
-i Makefile || die
@@ -44,6 +46,8 @@ src_prepare() {
}
multilib_src_configure() {
+ tc-export CC CXX
+
targets=( libquirc.so )
use opencv && targets+=( opencv )
use sdl && targets+=( sdl )
@@ -52,13 +56,14 @@ multilib_src_configure() {
}
multilib_src_compile() {
+ append-ldflags "-Wl,-soname,lib${QUIRC}.so.${LIB_VERSION}"
emake V=1 DESTDIR="${D}" PREFIX="${EPREFIX}/usr" "${targets[@]}"
}
multilib_src_install() {
- dolib.so "libquirc.so.${PV}"
- dosym "libquirc.so.${PV}" "${EPREFIX}/usr/$(get_libdir)/libquirc.so"
- dosym "libquirc.so.${PV}" "${EPREFIX}/usr/$(get_libdir)/libquirc.so.$(ver_cut 1)"
+ dolib.so "libquirc.so.${LIB_VERSION}"
+ dosym "libquirc.so.${LIB_VERSION}" "${EPREFIX}/usr/$(get_libdir)/libquirc.so"
+ dosym "libquirc.so.${LIB_VERSION}" "${EPREFIX}/usr/$(get_libdir)/libquirc.so.$(ver_cut 1 LIB_VERSION)"
if multilib_is_native_abi; then
into "/usr/libexec/${PN}"