public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/quirc/
Date: Thu, 21 Mar 2024 02:24:30 +0000 (UTC)	[thread overview]
Message-ID: <1710987604.a8bfe44df5f6974ee113d0fce8f57bed123c8c0f.sam@gentoo> (raw)

commit:     a8bfe44df5f6974ee113d0fce8f57bed123c8c0f
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Mon Mar 18 18:43:10 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Mar 21 02:20:04 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8bfe44d

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 <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/35820
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../quirc/{quirc-1.2.ebuild => quirc-1.2-r1.ebuild}       | 15 ++++++++++-----
 media-libs/quirc/quirc-9999.ebuild                        | 15 ++++++++++-----
 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
similarity index 73%
rename from media-libs/quirc/quirc-1.2.ebuild
rename to 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}"


             reply	other threads:[~2024-03-21  2:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21  2:24 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-07-31  8:47 [gentoo-commits] repo/gentoo:master commit in: media-libs/quirc/ Joonas Niilola
2024-07-31  8:47 Joonas Niilola
2024-07-22 18:37 Arthur Zamarin
2024-07-07  7:52 Yixun Lan
2024-07-07  0:26 Sam James
2024-07-07  0:26 Sam James
2024-07-07  0:26 Sam James
2024-07-07  0:26 Sam James
2024-03-23 13:39 Sam James
2024-03-18 16:49 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1710987604.a8bfe44df5f6974ee113d0fce8f57bed123c8c0f.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox