blob: db42b3f36ce0fd6866bb476e7fdaea2adfea37a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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
}
|