Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-libs/libgphoto2: libgphoto2-2.5.4-r1.ebuild ChangeLog
Date: Wed, 21 May 2014 19:00:02
Message-Id: 20140521185959.2575C20036@flycatcher.gentoo.org
1 mgorny 14/05/21 18:59:59
2
3 Modified: ChangeLog
4 Added: libgphoto2-2.5.4-r1.ebuild
5 Log:
6 Enable multilib support, bug #493170.
7
8 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)
9
10 Revision Changes Path
11 1.258 media-libs/libgphoto2/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libgphoto2/ChangeLog?rev=1.258&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libgphoto2/ChangeLog?rev=1.258&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libgphoto2/ChangeLog?r1=1.257&r2=1.258
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/media-libs/libgphoto2/ChangeLog,v
20 retrieving revision 1.257
21 retrieving revision 1.258
22 diff -u -r1.257 -r1.258
23 --- ChangeLog 21 May 2014 18:28:44 -0000 1.257
24 +++ ChangeLog 21 May 2014 18:59:58 -0000 1.258
25 @@ -1,6 +1,11 @@
26 # ChangeLog for media-libs/libgphoto2
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/media-libs/libgphoto2/ChangeLog,v 1.257 2014/05/21 18:28:44 pacho Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/media-libs/libgphoto2/ChangeLog,v 1.258 2014/05/21 18:59:58 mgorny Exp $
30 +
31 +*libgphoto2-2.5.4-r1 (21 May 2014)
32 +
33 + 21 May 2014; Michał Górny <mgorny@g.o> +libgphoto2-2.5.4-r1.ebuild:
34 + Enable multilib support, bug #493170.
35
36 *libgphoto2-2.5.4 (21 May 2014)
37
38
39
40
41 1.1 media-libs/libgphoto2/libgphoto2-2.5.4-r1.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libgphoto2/libgphoto2-2.5.4-r1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libgphoto2/libgphoto2-2.5.4-r1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: libgphoto2-2.5.4-r1.ebuild
47 ===================================================================
48 # Copyright 1999-2014 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/media-libs/libgphoto2/libgphoto2-2.5.4-r1.ebuild,v 1.1 2014/05/21 18:59:58 mgorny Exp $
51
52 # TODO
53 # 1. Track upstream bug --disable-docs does not work.
54 # http://sourceforge.net/tracker/index.php?func=detail&aid=1643870&group_id=8874&atid=108874
55
56 EAPI="5"
57
58 inherit autotools eutils multilib multilib-minimal udev user
59
60 DESCRIPTION="Library that implements support for numerous digital cameras"
61 HOMEPAGE="http://www.gphoto.org/"
62 SRC_URI="mirror://sourceforge/gphoto/${P}.tar.bz2"
63
64 LICENSE="GPL-2"
65 SLOT="0/6" # libgphoto2.so soname version
66
67 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~ia64-linux ~x86-linux"
68 IUSE="doc examples exif gd jpeg nls serial zeroconf"
69
70 # By default, drivers for all supported cameras will be compiled.
71 # If you want to only compile for specific camera(s), set CAMERAS
72 # environment to a space-separated list (no commas) of drivers that
73 # you want to build.
74 IUSE_CAMERAS="
75 adc65 agfa_cl20 aox ax203
76 barbie
77 canon casio_qv clicksmart310
78 digigr8 digita dimagev dimera3500 directory
79 enigma13
80 fuji
81 gsmart300
82 hp215
83 iclick
84 jamcam jd11 jl2005a jl2005c
85 kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 konica konica_qm150
86 largan lg_gsm
87 mars mustek
88 panasonic_coolshot panasonic_l859 panasonic_dc1000 panasonic_dc1580 pccam300 pccam600 pentax polaroid_pdc320 polaroid_pdc640 polaroid_pdc700 ptp2
89 ricoh ricoh_g3
90 samsung sierra sipix_blink2 sipix_web2 smal sonix sony_dscf1 sony_dscf55 soundvision spca50x sq905 st2205 stv0674 stv0680 sx330z
91 toshiba_pdrm11 topfield tp6801
92 "
93
94 for camera in ${IUSE_CAMERAS}; do
95 IUSE="${IUSE} cameras_${camera}"
96 done
97
98 # libgphoto2 actually links to libtool
99 RDEPEND="
100 dev-libs/libxml2:2[${MULTILIB_USEDEP}]
101 sys-devel/libtool[${MULTILIB_USEDEP}]
102 virtual/libusb:1[${MULTILIB_USEDEP}]
103 cameras_ax203? ( media-libs/gd:=[${MULTILIB_USEDEP}] )
104 cameras_st2205? ( media-libs/gd:=[${MULTILIB_USEDEP}] )
105 exif? ( >=media-libs/libexif-0.5.9:=[${MULTILIB_USEDEP}] )
106 gd? ( media-libs/gd[jpeg=,${MULTILIB_USEDEP}] )
107 jpeg? ( virtual/jpeg:0[${MULTILIB_USEDEP}] )
108 serial? ( dev-libs/lockdev[${MULTILIB_USEDEP}] )
109 zeroconf? ( net-dns/avahi[mdnsresponder-compat,${MULTILIB_USEDEP}] )
110 !<sys-fs/udev-175
111 abi_x86_32? (
112 !<=app-emulation/emul-linux-x86-medialibs-20140508
113 !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
114 )"
115 DEPEND="${RDEPEND}
116 dev-util/gtk-doc-am
117 sys-devel/flex
118 >=sys-devel/gettext-0.14.1
119 virtual/pkgconfig[${MULTILIB_USEDEP}]
120 doc? ( app-doc/doxygen )
121 "
122
123 MULTILIB_CHOST_TOOLS=(
124 /usr/bin/gphoto2-port-config
125 /usr/bin/gphoto2-config
126 )
127
128 pkg_pretend() {
129 if ! echo "${USE}" | grep "cameras_" > /dev/null 2>&1; then
130 einfo "No camera drivers will be built since you did not specify any."
131 fi
132 }
133
134 pkg_setup() {
135 enewgroup plugdev
136 }
137
138 src_prepare() {
139 # Handle examples ourselves
140 sed 's/^\(SUBDIRS =.*\)examples\(.*\)$/\1\2/' -i Makefile.am Makefile.in \
141 || die "examples sed failed"
142
143 # Fix pkgconfig file when USE="-exif"
144 # https://sourceforge.net/p/gphoto/bugs/980/
145 if ! use exif; then
146 sed -i "s/, @REQUIREMENTS_FOR_LIBEXIF@//" libgphoto2.pc.in || die " libgphoto2.pc sed failed"
147 fi
148
149 sed -e 's/sleep 2//' -i m4m/gp-camlibs.m4 || die
150
151 # Fix USE=zeroconf, bug #283332
152 # https://sourceforge.net/p/gphoto/bugs/981/
153 epatch "${FILESDIR}/${PN}-2.4.7-respect-bonjour.patch"
154
155 eautoreconf
156 }
157
158 multilib_src_configure() {
159 local cameras
160 local cam
161 local cam_warn=no
162 for cam in ${IUSE_CAMERAS} ; do
163 if use "cameras_${cam}"; then
164 cameras="${cameras},${cam}"
165 else
166 cam_warn=yes
167 fi
168 done
169
170 if [ "${cam_warn}" = "yes" ]; then
171 [ -z "${cameras}" ] || cameras="${cameras:1}"
172 einfo "Enabled camera drivers: ${cameras:-none}"
173 ewarn "Upstream will not support you if you do not compile all camera drivers first"
174 else
175 cameras="all"
176 einfo "Enabled camera drivers: all"
177 fi
178
179 local myconf
180 use doc || myconf=( ac_cv_path_DOXYGEN=false )
181
182 # gd detection is broken: https://sourceforge.net/p/gphoto/bugs/982/
183 if use gd; then
184 export LIBGD_CFLAGS=" "
185 export LIBGD_LIBS="-lgd"
186 fi
187
188 # Upstream doesn't default to --enable-option-checking due having another
189 # configure in libgphoto2_port/ that also needs to be checked on every bump
190 #
191 # Serial port uses either lockdev or ttylock, but we don't have ttylock
192 ECONF_SOURCE=${S} \
193 econf \
194 --disable-docs \
195 --disable-gp2ddb \
196 $(use_with zeroconf bonjour) \
197 $(use_enable nls) \
198 $(use_with exif libexif auto) \
199 $(use_with gd) \
200 $(use_with jpeg) \
201 $(use_enable serial) \
202 $(use_enable serial lockdev) \
203 --with-libusb=no \
204 --with-libusb-1.0=auto \
205 --disable-ttylock \
206 --with-camlibs=${cameras} \
207 --with-doc-dir="${EPREFIX}"/usr/share/doc/${PF} \
208 --with-html-dir="${EPREFIX}"/usr/share/doc/${PF}/html \
209 --with-hotplug-doc-dir="${EPREFIX}"/usr/share/doc/${PF}/hotplug \
210 --with-rpmbuild=$(type -P true) \
211 udevscriptdir="$(udev_get_udevdir)" \
212 "${myconf[@]}"
213 }
214
215 multilib_src_compile() {
216 default
217
218 if multilib_is_native_abi && use doc; then
219 doxygen doc/Doxyfile || die "Documentation generation failed"
220 fi
221 }
222
223 multilib_src_install_all() {
224 # Empty dependency_libs in .la files, bug #386665
225 find "${ED}" -name '*.la' -exec sed -i -e "/^dependency_libs/s:=.*:='':" {} +
226
227 # Remove recursive symlink
228 # https://sourceforge.net/p/gphoto/bugs/983/
229 rm "${ED}/usr/include/gphoto2/gphoto2" || die
230
231 # Clean up unwanted files
232 rm "${ED}/usr/share/doc/${PF}/"{ABOUT-NLS,COPYING} || die "rm failed"
233 dodoc ChangeLog NEWS* README* AUTHORS TESTERS MAINTAINERS HACKING
234
235 if use examples; then
236 insinto /usr/share/doc/${PF}/examples
237 doins examples/README examples/*.c examples/*.h
238 fi
239
240 # FIXME: fixup autoconf bug
241 if ! use doc && [ -d "${ED}/usr/share/doc/${PF}/apidocs.html" ]; then
242 rm -fr "${ED}/usr/share/doc/${PF}/apidocs.html"
243 fi
244 # end fixup
245
246 local udev_rules cam_list
247 udev_rules="$(udev_get_udevdir)/rules.d/70-libgphoto2.rules"
248 cam_list="/usr/$(get_libdir)/libgphoto2/print-camera-list"
249
250 if [ -x "${ED}"${cam_list} ]; then
251 # Let print-camera-list find libgphoto2.so
252 export LD_LIBRARY_PATH="${ED}/usr/$(get_libdir)"
253 # Let libgphoto2 find its camera-modules
254 export CAMLIBS="${ED}/usr/$(get_libdir)/libgphoto2/${PV}"
255
256 einfo "Generating UDEV-rules ..."
257 mkdir -p "${ED}"/${udev_rules%/*}
258 echo -e "# do not edit this file, it will be overwritten on update\n#" \
259 > "${ED}"/${udev_rules}
260 "${ED}"${cam_list} udev-rules version 175 group plugdev >> "${ED}"/${udev_rules} \
261 || die "failed to create udev-rules"
262 else
263 eerror "Unable to find print-camera-list"
264 eerror "and therefore unable to generate hotplug usermap."
265 eerror "You will have to manually generate it by running:"
266 eerror " ${cam_list} udev-rules version 175 group plugdev > ${udev_rules}"
267 fi
268
269 }
270
271 pkg_postinst() {
272 if ! has_version "sys-auth/consolekit[acl]" && ! has_version "sys-apps/systemd[acl]" ; then
273 elog "Don't forget to add yourself to the plugdev group "
274 elog "if you want to be able to access your camera."
275 fi
276
277 local old_udev_rules="${EROOT}"etc/udev/rules.d/99-libgphoto2.rules
278 if [[ -f ${old_udev_rules} ]]; then
279 rm -f "${old_udev_rules}"
280 fi
281 }