commit:     166fd98eec9a33686c141ab0640e3ec3a122d344
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Wed Feb 14 11:21:51 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 18 16:32:39 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=166fd98e

media-libs/quirc: new package, add 1.2, 9999

Dependency for QR code in media-libs/opencv

Bug: https://bugs.gentoo.org/924005
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/quirc/Manifest          |  1 +
 media-libs/quirc/metadata.xml      | 21 ++++++++++
 media-libs/quirc/quirc-1.2.ebuild  | 86 ++++++++++++++++++++++++++++++++++++++
 media-libs/quirc/quirc-9999.ebuild | 86 ++++++++++++++++++++++++++++++++++++++
 profiles/arch/x86/use.stable.mask  |  8 ++++
 5 files changed, 202 insertions(+)

diff --git a/media-libs/quirc/Manifest b/media-libs/quirc/Manifest
new file mode 100644
index 000000000000..3d87292def57
--- /dev/null
+++ b/media-libs/quirc/Manifest
@@ -0,0 +1 @@
+DIST quirc-1.2.tar.gz 42916 BLAKE2B 
f12e015a703807e1e8aa6dbfcbedc4065a7249df2e3b902f6fb069c12e3d8905329414fa826f912adad8bd1ccd49b659d96ebcdcf6bc0b229eb112a46bf86b09
 SHA512 
0f694d16bc24012ef29a9aab8e48419bc7c346153ead3feed8e83845927f9683bb62b2e61c6872643f66b0c864c2e3c7e1a4ea4c657399b38cabfa687bedee82

diff --git a/media-libs/quirc/metadata.xml b/media-libs/quirc/metadata.xml
new file mode 100644
index 000000000000..ee5437ee6a99
--- /dev/null
+++ b/media-libs/quirc/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="person" proxied="yes">
+    <email>[email protected]</email>
+    <name>Paul Zander</name>
+  </maintainer>
+  <maintainer type="project" proxied="proxy">
+    <email>[email protected]</email>
+    <name>Gentoo Science Project</name>
+  </maintainer>
+  <use>
+    <flag name="opencv">Build tools requiring <pkg>media-libs/opencv</pkg> 
(inspect-opencv,quirc-demo-opencv)</flag>
+    <flag name="sdl">Build tools requiring <pkg>media-libs/sdl-gfx</pkg> 
(inspect, quirc-demo)</flag>
+    <flag name="tools">Build tools (qrtest)</flag>
+    <flag name="v4l">Build tools for webcams (quirc-scanner)</flag>
+  </use>
+  <upstream>
+    <remote-id type="github">dlbeer/quirc</remote-id>
+  </upstream>
+</pkgmetadata>

diff --git a/media-libs/quirc/quirc-1.2.ebuild 
b/media-libs/quirc/quirc-1.2.ebuild
new file mode 100644
index 000000000000..db42b3f36ce0
--- /dev/null
+++ b/media-libs/quirc/quirc-1.2.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="QR decoder library"
+HOMEPAGE="https://github.com/dlbeer/quirc";
+
+inherit multilib-minimal
+
+if [[ ${PV} = *9999* ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/dlbeer/${PN}.git";
+else
+       SRC_URI="
+               https://github.com/dlbeer/${PN}/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz
+       "
+       KEYWORDS="~amd64 ~x86"
+fi
+
+DEPEND="
+       media-libs/libjpeg-turbo:=
+       media-libs/libpng:=
+       opencv? ( media-libs/opencv:= )
+       sdl? ( media-libs/sdl-gfx:= )
+"
+RDEPEND="
+       ${DEPEND}
+"
+
+LICENSE="ISC"
+SLOT="0/${PV}"
+
+IUSE="opencv sdl tools v4l"
+
+src_prepare() {
+       sed -r \
+               -e "s#\.o libquirc.a#.o libquirc.so.${PV}#g" \
+               -e '/^QUIRC_CFLAGS/ s/$/ -fPIC/' \
+               -i Makefile || die
+
+       multilib_copy_sources
+}
+
+multilib_src_configure() {
+       targets=( libquirc.so )
+       use opencv && targets+=( opencv )
+       use sdl && targets+=( sdl )
+       use tools && targets+=( qrtest )
+       use v4l && targets+=( v4l )
+}
+
+multilib_src_compile() {
+       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)"
+
+       if multilib_is_native_abi; then
+               into "/usr/libexec/${PN}"
+               if use opencv; then
+                       dobin inspect-opencv
+                       dobin quirc-demo-opencv
+               fi
+
+               if use sdl; then
+                       dobin inspect
+                       dobin quirc-demo
+               fi
+
+               if use tools; then
+                       dobin qrtest
+               fi
+
+               if use v4l; then
+                       dobin quirc-scanner
+               fi
+       fi
+}
+
+multilib_src_install_all() {
+       doheader lib/quirc.h
+}

diff --git a/media-libs/quirc/quirc-9999.ebuild 
b/media-libs/quirc/quirc-9999.ebuild
new file mode 100644
index 000000000000..db42b3f36ce0
--- /dev/null
+++ b/media-libs/quirc/quirc-9999.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="QR decoder library"
+HOMEPAGE="https://github.com/dlbeer/quirc";
+
+inherit multilib-minimal
+
+if [[ ${PV} = *9999* ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/dlbeer/${PN}.git";
+else
+       SRC_URI="
+               https://github.com/dlbeer/${PN}/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz
+       "
+       KEYWORDS="~amd64 ~x86"
+fi
+
+DEPEND="
+       media-libs/libjpeg-turbo:=
+       media-libs/libpng:=
+       opencv? ( media-libs/opencv:= )
+       sdl? ( media-libs/sdl-gfx:= )
+"
+RDEPEND="
+       ${DEPEND}
+"
+
+LICENSE="ISC"
+SLOT="0/${PV}"
+
+IUSE="opencv sdl tools v4l"
+
+src_prepare() {
+       sed -r \
+               -e "s#\.o libquirc.a#.o libquirc.so.${PV}#g" \
+               -e '/^QUIRC_CFLAGS/ s/$/ -fPIC/' \
+               -i Makefile || die
+
+       multilib_copy_sources
+}
+
+multilib_src_configure() {
+       targets=( libquirc.so )
+       use opencv && targets+=( opencv )
+       use sdl && targets+=( sdl )
+       use tools && targets+=( qrtest )
+       use v4l && targets+=( v4l )
+}
+
+multilib_src_compile() {
+       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)"
+
+       if multilib_is_native_abi; then
+               into "/usr/libexec/${PN}"
+               if use opencv; then
+                       dobin inspect-opencv
+                       dobin quirc-demo-opencv
+               fi
+
+               if use sdl; then
+                       dobin inspect
+                       dobin quirc-demo
+               fi
+
+               if use tools; then
+                       dobin qrtest
+               fi
+
+               if use v4l; then
+                       dobin quirc-scanner
+               fi
+       fi
+}
+
+multilib_src_install_all() {
+       doheader lib/quirc.h
+}

diff --git a/profiles/arch/x86/use.stable.mask 
b/profiles/arch/x86/use.stable.mask
index 6ad4dcbac594..6f373ce425c2 100644
--- a/profiles/arch/x86/use.stable.mask
+++ b/profiles/arch/x86/use.stable.mask
@@ -4,6 +4,14 @@
 # This file requires eapi 5 or later. New entries go on top.
 # Please use the same syntax as in use.mask
 
+# Paul Zander <[email protected]> (2024-02-14)
+# sci-libs/atlas is not stable
+atlas
+
+# Paul Zander <[email protected]> (2024-02-14)
+# media-libs/jasper is not stable
+jasper
+
 # Ionen Wolkens <[email protected]> (2024-01-27)
 # Qt6 is not stable here yet
 qt6

Reply via email to