Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libgphoto2/
Date: Sun, 03 Jul 2022 21:04:55
Message-Id: 1656882264.c89816c1f2282a69172bef3509b5894b5dcec43c.mattst88@gentoo
1 commit: c89816c1f2282a69172bef3509b5894b5dcec43c
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 3 20:53:49 2022 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 3 21:04:24 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c89816c1
7
8 media-libs/libgphoto2: Version bump to 2.5.30
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 media-libs/libgphoto2/Manifest | 1 +
13 media-libs/libgphoto2/libgphoto2-2.5.30.ebuild | 217 +++++++++++++++++++++++++
14 2 files changed, 218 insertions(+)
15
16 diff --git a/media-libs/libgphoto2/Manifest b/media-libs/libgphoto2/Manifest
17 index 998e6af8913b..71ecaa9443c9 100644
18 --- a/media-libs/libgphoto2/Manifest
19 +++ b/media-libs/libgphoto2/Manifest
20 @@ -1 +1,2 @@
21 DIST libgphoto2-2.5.29.tar.xz 5875684 BLAKE2B a0bc48b95ecff3c7f157b7baee18bc3ad86d376c9adc6f7eedd2f8cea40434cc97598cad49ebc1e4683492f9eb3e5b3494de3112bb740d2ccd8e2c55cf4ff1ed SHA512 f8e3dbea58fa6f19a100ee319d5561387a54e8701a19d034bc7d6fe474dc6e4f21fccc4b6c11346df4fdc811666d49ea0b9a2b5b67aab00acd5a1e94d9259c94
22 +DIST libgphoto2-2.5.30.tar.xz 5890196 BLAKE2B 4da7a650bec695a9d8356d1014081786eb6d31641c4f36f75ba7171b2b395a5e8bf6f59d452adad6d9faa30eea77abeb52e62e645d963bcec2709b3eb5094a4a SHA512 969e5765dc5de9e5fb8156eda679aca069f568e744cc48b643846175eb3cff78bc6ec3a848150a4c636d948018de022f2988da7b94029f103589384f9144b7ed
23
24 diff --git a/media-libs/libgphoto2/libgphoto2-2.5.30.ebuild b/media-libs/libgphoto2/libgphoto2-2.5.30.ebuild
25 new file mode 100644
26 index 000000000000..f7868771f609
27 --- /dev/null
28 +++ b/media-libs/libgphoto2/libgphoto2-2.5.30.ebuild
29 @@ -0,0 +1,217 @@
30 +# Copyright 1999-2022 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +# TODO
34 +# 1. Track upstream bug --disable-docs does not work.
35 +# https://sourceforge.net/p/gphoto/bugs/643/
36 +
37 +EAPI=8
38 +inherit autotools multilib-minimal udev
39 +
40 +DESCRIPTION="Library that implements support for numerous digital cameras"
41 +HOMEPAGE="http://www.gphoto.org/"
42 +SRC_URI="mirror://sourceforge/gphoto/${P}.tar.xz"
43 +
44 +LICENSE="GPL-2"
45 +
46 +# FIXME: should we also bump for libgphoto2_port.so soname version?
47 +SLOT="0/6" # libgphoto2.so soname version
48 +
49 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
50 +IUSE="doc examples exif gd jpeg nls serial"
51 +
52 +# By default, drivers for all supported cameras will be compiled.
53 +# If you want to only compile for specific camera(s), set CAMERAS
54 +# environment to a space-separated list (no commas) of drivers that
55 +# you want to build.
56 +IUSE_CAMERAS="
57 + adc65 agfa_cl20 aox ax203
58 + barbie
59 + canon casio_qv clicksmart310
60 + digigr8 digita dimagev dimera3500 directory
61 + enigma13
62 + fuji
63 + gsmart300
64 + hp215
65 + iclick
66 + jamcam jd11 jl2005a jl2005c
67 + kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 konica konica_qm150
68 + largan lg_gsm
69 + mars mustek
70 + panasonic_coolshot panasonic_l859 panasonic_dc1000 panasonic_dc1580 pccam300 pccam600 pentax polaroid_pdc320 polaroid_pdc640 polaroid_pdc700 ptp2
71 + ricoh ricoh_g3
72 + samsung sierra sipix_blink2 sipix_web2 smal sonix sony_dscf1 sony_dscf55 soundvision spca50x sq905 st2205 stv0674 stv0680 sx330z
73 + toshiba_pdrm11 topfield tp6801
74 +"
75 +
76 +for camera in ${IUSE_CAMERAS}; do
77 + IUSE="${IUSE} +cameras_${camera}"
78 +done
79 +
80 +# libgphoto2 actually links to libltdl
81 +RDEPEND="
82 + acct-group/plugdev
83 + >=dev-libs/libxml2-2.9.1-r4:2[${MULTILIB_USEDEP}]
84 + net-misc/curl[${MULTILIB_USEDEP}]
85 + dev-libs/libltdl:0[${MULTILIB_USEDEP}]
86 + >=virtual/libusb-1-r1:1[${MULTILIB_USEDEP}]
87 + cameras_ax203? ( >=media-libs/gd-2.0.35-r4:=[${MULTILIB_USEDEP}] )
88 + cameras_st2205? ( >=media-libs/gd-2.0.35-r4:=[${MULTILIB_USEDEP}] )
89 + exif? ( >=media-libs/libexif-0.6.21-r1[${MULTILIB_USEDEP}] )
90 + gd? ( >=media-libs/gd-2.0.35-r4:=[jpeg=,${MULTILIB_USEDEP}] )
91 + jpeg? ( >=virtual/jpeg-0-r2:0[${MULTILIB_USEDEP}] )
92 + serial? ( >=dev-libs/lockdev-1.0.3.1.2-r2[${MULTILIB_USEDEP}] )
93 +"
94 +DEPEND="${RDEPEND}"
95 +BDEPEND="
96 + dev-util/gtk-doc-am
97 + sys-devel/flex
98 + >=sys-devel/gettext-0.19.1
99 + virtual/pkgconfig
100 + doc? ( app-doc/doxygen )
101 +"
102 +
103 +MULTILIB_CHOST_TOOLS=(
104 + /usr/bin/gphoto2-port-config
105 + /usr/bin/gphoto2-config
106 +)
107 +
108 +pkg_pretend() {
109 + if ! echo "${USE}" | grep "cameras_" > /dev/null 2>&1; then
110 + einfo "No camera drivers will be built since you did not specify any."
111 + fi
112 +}
113 +
114 +src_prepare() {
115 + default
116 +
117 + # Handle examples ourselves
118 + sed 's/^\(SUBDIRS =.*\)examples\(.*\)$/\1\2/' -i Makefile.am Makefile.in \
119 + || die "examples sed failed"
120 +
121 + sed -e 's/sleep 2//' -i configure || die
122 +
123 + eautoreconf # For configure.ac patching
124 +}
125 +
126 +multilib_src_configure() {
127 + local myconf
128 + use doc || myconf=( ac_cv_path_DOXYGEN=no )
129 +
130 + # Upstream doesn't default to --enable-option-checking due having another
131 + # configure in libgphoto2_port/ that also needs to be checked on every bump
132 + #
133 + # Serial port uses either lockdev or ttylock, but we don't have ttylock
134 + # --with-doc-dir needed to prevent duplicate docs installation, bug #586842
135 + ECONF_SOURCE=${S} \
136 + econf \
137 + --with-doc-dir="${EPREFIX}"/usr/share/doc/${PF} \
138 + --disable-docs \
139 + --disable-gp2ddb \
140 + $(use_enable nls) \
141 + $(use_with exif libexif auto) \
142 + $(use_with gd) \
143 + $(use_with jpeg) \
144 + $(use_enable serial) \
145 + $(use_enable serial lockdev) \
146 + --with-libusb=no \
147 + --with-libusb-1.0=auto \
148 + --disable-ttylock \
149 + --with-camlibs=${cameras} \
150 + --with-hotplug-doc-dir="${EPREFIX}"/usr/share/doc/${PF}/hotplug \
151 + --with-rpmbuild=$(type -P true) \
152 + udevscriptdir="$(get_udevdir)" \
153 + "${myconf[@]}"
154 +}
155 +
156 +src_configure() {
157 + local cameras
158 + local cam
159 + local cam_warn=no
160 + for cam in ${IUSE_CAMERAS} ; do
161 + if use "cameras_${cam}"; then
162 + cameras="${cameras},${cam}"
163 + else
164 + cam_warn=yes
165 + fi
166 + done
167 +
168 + if [ "${cam_warn}" = "yes" ]; then
169 + [ -z "${cameras}" ] || cameras="${cameras:1}"
170 + einfo "Enabled camera drivers: ${cameras:-none}"
171 + einfo "Upstream will not support you if you do not compile all camera drivers first"
172 + else
173 + cameras="all"
174 + einfo "Enabled camera drivers: all"
175 + fi
176 +
177 + multilib-minimal_src_configure
178 +}
179 +
180 +multilib_src_compile() {
181 + default
182 +
183 + if multilib_is_native_abi && use doc; then
184 + doxygen doc/Doxyfile || die "Documentation generation failed"
185 + fi
186 +}
187 +
188 +multilib_src_install_all() {
189 + find "${ED}" -name '*.la' -delete || die
190 +
191 + einstalldocs
192 + dodoc TESTERS MAINTAINERS
193 +
194 + if use examples; then
195 + docinto examples
196 + dodoc examples/README examples/*.c examples/*.h
197 + fi
198 +
199 + # FIXME: fixup autoconf bug #????
200 + if ! use doc && [ -d "${ED}/usr/share/doc/${PF}/apidocs.html" ]; then
201 + rm -fr "${ED}/usr/share/doc/${PF}/apidocs.html"
202 + fi
203 + # end fixup
204 +
205 + local udev_rules cam_list
206 + udev_rules="$(get_udevdir)/rules.d/70-libgphoto2.rules"
207 + cam_list="/usr/$(get_libdir)/libgphoto2/print-camera-list"
208 +
209 + if [ -x "${ED}"/${cam_list} ]; then
210 + # Let print-camera-list find libgphoto2.so
211 + export LD_LIBRARY_PATH="${ED}/usr/$(get_libdir)"
212 + # Let libgphoto2 find its camera-modules
213 + export CAMLIBS="${ED}/usr/$(get_libdir)/libgphoto2/${PV}"
214 +
215 + einfo "Generating UDEV-rules ..."
216 + mkdir -p "${ED}"/${udev_rules%/*}
217 + echo -e "# do not edit this file, it will be overwritten on update\n#" \
218 + > "${ED}"/${udev_rules}
219 + "${ED}"${cam_list} udev-rules version 201 group plugdev >> "${ED}"/${udev_rules} \
220 + || die "failed to create udev-rules"
221 + else
222 + eerror "Unable to find print-camera-list"
223 + eerror "and therefore unable to generate hotplug usermap."
224 + eerror "You will have to manually generate it by running:"
225 + eerror " ${cam_list} udev-rules version 201 group plugdev > ${udev_rules}"
226 + fi
227 +
228 +}
229 +
230 +pkg_postinst() {
231 + if ! has_version "sys-auth/consolekit[acl]" && ! has_version "sys-apps/systemd[acl]" && ! has_version "sys-auth/elogind[acl]" ; then
232 + elog "Don't forget to add yourself to the plugdev group "
233 + elog "if you want to be able to access your camera."
234 + fi
235 +
236 + local old_udev_rules="${EROOT}"/etc/udev/rules.d/99-libgphoto2.rules
237 + if [[ -f ${old_udev_rules} ]]; then
238 + rm -f "${old_udev_rules}"
239 + fi
240 +
241 + udev_reload
242 +}
243 +
244 +pkg_postrm() {
245 + udev_reload
246 +}