/[gentoo-x86]/media-libs/libgphoto2/libgphoto2-2.4.11-r1.ebuild
Gentoo

Contents of /media-libs/libgphoto2/libgphoto2-2.4.11-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations) (download)
Sat Jul 21 11:27:08 2012 UTC (2 years, 1 month ago) by pacho
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
Version bump, drop old.

(Portage version: 2.1.11.9/cvs/Linux x86_64)

1 jdhore 1.8 # Copyright 1999-2012 Gentoo Foundation
2 pacho 1.1 # Distributed under the terms of the GNU General Public License v2
3 pacho 1.10 # $Header: /var/cvsroot/gentoo-x86/media-libs/libgphoto2/libgphoto2-2.4.11-r1.ebuild,v 1.9 2012/06/09 00:00:57 zmedico Exp $
4 pacho 1.1
5     # TODO
6     # 1. Track upstream bug --disable-docs does not work.
7     # http://sourceforge.net/tracker/index.php?func=detail&aid=1643870&group_id=8874&atid=108874
8    
9     EAPI="4"
10    
11 zmedico 1.9 inherit autotools eutils multilib user
12 pacho 1.1
13     DESCRIPTION="Library that implements support for numerous digital cameras"
14     HOMEPAGE="http://www.gphoto.org/"
15     SRC_URI="mirror://sourceforge/gphoto/${P}.tar.bz2"
16    
17     LICENSE="GPL-2"
18     SLOT="0"
19 naota 1.7 KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd"
20 pacho 1.1 IUSE="doc examples exif gd jpeg nls kernel_linux zeroconf"
21    
22     # By default, drivers for all supported cameras will be compiled.
23     # If you want to only compile for specific camera(s), set CAMERAS
24     # environment to a space-separated list (no commas) of drivers that
25     # you want to build.
26     IUSE_CAMERAS="
27     adc65 agfa_cl20 aox ax203
28     barbie
29     canon casio_qv clicksmart310
30     digigr8 digita dimagev dimera3500 directory
31     enigma13
32     fuji
33     gsmart300
34     hp215
35     iclick
36     jamcam jd11 jl2005a jl2005c
37     kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 konica konica_qm150
38     largan lg_gsm
39     mars mustek
40     panasonic_coolshot panasonic_l859 panasonic_dc1000 panasonic_dc1580 pccam300 pccam600 polaroid_pdc320 polaroid_pdc640 polaroid_pdc700 ptp2
41     ricoh ricoh_g3
42     samsung sierra sipix_blink sipix_blink2 sipix_web2 smal sonix sony_dscf1 sony_dscf55 soundvision spca50x sq905 st2205 stv0674 stv0680 sx330z
43     template toshiba_pdrm11 topfield
44     "
45    
46     for camera in ${IUSE_CAMERAS}; do
47     IUSE="${IUSE} cameras_${camera}"
48     done
49    
50     # libgphoto2 actually links to libtool
51     RDEPEND="virtual/libusb:0
52     cameras_ax203? ( media-libs/gd )
53     cameras_st2205? ( media-libs/gd )
54     zeroconf? ( || (
55     net-dns/avahi[mdnsresponder-compat]
56     net-misc/mDNSResponder ) )
57     exif? ( >=media-libs/libexif-0.5.9 )
58     gd? ( media-libs/gd[jpeg=] )
59     jpeg? ( virtual/jpeg )
60     sys-devel/libtool"
61     DEPEND="${RDEPEND}
62 jdhore 1.8 virtual/pkgconfig
63 pacho 1.1 sys-devel/flex
64     >=sys-devel/gettext-0.14.1
65     doc? ( app-doc/doxygen )"
66     # FIXME: gtk-doc is broken
67     # >=dev-util/gtk-doc-1.10 )"
68    
69     RDEPEND="${RDEPEND}
70     !<sys-fs/udev-136"
71    
72     pkg_setup() {
73     if ! echo "${USE}" | grep "cameras_" > /dev/null 2>&1; then
74     einfo "No camera drivers will be built since you did not specify any."
75     fi
76    
77     if use cameras_template || use cameras_sipix_blink; then
78     einfo "Upstream considers sipix_blink & template driver as obsolete"
79     fi
80    
81     enewgroup plugdev
82     }
83    
84     src_prepare() {
85     # Handle examples ourselves
86     sed 's/^\(SUBDIRS =.*\)examples\(.*\)$/\1\2/' -i Makefile.am Makefile.in \
87     || die "examples sed failed"
88    
89     # Fix pkgconfig file when USE="-exif"
90     if ! use exif; then
91     sed -i "s/, @REQUIREMENTS_FOR_LIBEXIF@//" libgphoto2.pc.in || die " libgphoto2.pc sed failed"
92     fi
93    
94     # Fix USE=zeroconf, bug #283332
95     epatch "${FILESDIR}/${PN}-2.4.7-respect-bonjour.patch"
96    
97     # Do not build test if not running make check, bug #226241
98     epatch "${FILESDIR}/${PN}-2.4.7-no-test-build.patch"
99    
100     # Increase max entries from 1024 to 8192 to fix bug #291049
101     epatch "${FILESDIR}/${PN}-2.4.8-increase_max_entries.patch"
102    
103     # Fix automagic deps, bug #374371
104     epatch "${FILESDIR}/${PN}-2.4.11-fix-automagic.patch"
105    
106     eautoreconf
107    
108     # Fix bug #216206, libusb detection
109     sed -i "s:usb_busses:usb_find_busses:g" libgphoto2_port/configure || die "libusb sed failed"
110     }
111    
112     src_configure() {
113     local cameras
114     local cam
115     local cam_warn=no
116     for cam in ${IUSE_CAMERAS} ; do
117     if use "cameras_${cam}"; then
118     cameras="${cameras},${cam}"
119     else
120     cam_warn=yes
121     fi
122     done
123    
124     if [ "${cam_warn}" = "yes" ]; then
125     [ -z "${cameras}" ] || cameras="${cameras:1}"
126     einfo "Enabled camera drivers: ${cameras:-none}"
127     ewarn "Upstream will not support you if you do not compile all camera drivers first"
128     else
129     cameras="all"
130     einfo "Enabled camera drivers: all"
131     fi
132    
133     local myconf
134     use doc || myconf="ac_cv_path_DOXYGEN=false"
135     econf \
136     --disable-docs \
137     --disable-gp2ddb \
138     $(use_with zeroconf bonjour) \
139     --without-hal \
140     $(use_enable nls) \
141     $(use_with exif libexif auto) \
142     $(use_with gd) \
143     $(use_with jpeg) \
144     --with-drivers=${cameras} \
145     --with-doc-dir=/usr/share/doc/${PF} \
146     --with-html-dir=/usr/share/doc/${PF}/html \
147     --with-hotplug-doc-dir=/usr/share/doc/${PF}/hotplug \
148     --with-rpmbuild=$(type -P true) \
149     udevscriptdir=/lib/udev \
150     ${myconf}
151    
152     # FIXME: gtk-doc is currently broken
153     # $(use_enable doc docs)
154     }
155    
156     src_compile() {
157     emake
158    
159     if use doc; then
160     doxygen doc/Doxyfile || die "Documentation generation failed"
161     fi
162     }
163    
164     src_install() {
165     emake DESTDIR="${D}" install
166    
167     # Clean up unwanted files
168     rm "${D}/usr/share/doc/${PF}/"{ABOUT-NLS,COPYING} || die "rm failed"
169     dodoc ChangeLog NEWS* README* AUTHORS TESTERS MAINTAINERS HACKING
170    
171     if use examples; then
172     insinto /usr/share/doc/${PF}/examples
173     doins examples/README examples/*.c examples/*.h
174     fi
175    
176     # FIXME: fixup autoconf bug
177     if ! use doc && [ -d "${D}/usr/share/doc/${PF}/apidocs.html" ]; then
178     rm -fr "${D}/usr/share/doc/${PF}/apidocs.html"
179     fi
180     # end fixup
181    
182     UDEV_RULES="/lib/udev/rules.d/70-libgphoto2.rules"
183     CAM_LIST="/usr/$(get_libdir)/libgphoto2/print-camera-list"
184    
185     if [ -x "${D}"${CAM_LIST} ]; then
186     # Let print-camera-list find libgphoto2.so
187     export LD_LIBRARY_PATH="${D}/usr/$(get_libdir)"
188     # Let libgphoto2 find its camera-modules
189     export CAMLIBS="${D}/usr/$(get_libdir)/libgphoto2/${PV}"
190    
191     einfo "Generating UDEV-rules ..."
192     mkdir -p "${D}"/${UDEV_RULES%/*}
193     echo -e "# do not edit this file, it will be overwritten on update\n#" \
194     > "${D}"/${UDEV_RULES}
195     "${D}"${CAM_LIST} udev-rules version 136 group plugdev >> "${D}"/${UDEV_RULES} \
196     || die "failed to create udev-rules"
197     else
198     eerror "Unable to find print-camera-list"
199     eerror "and therefore unable to generate hotplug usermap."
200     eerror "You will have to manually generate it by running:"
201     eerror " ${CAM_LIST} udev-rules version 136 group plugdev > ${UDEV_RULES}"
202     fi
203    
204     }
205    
206     pkg_postinst() {
207     elog "Don't forget to add yourself to the plugdev group "
208     elog "if you want to be able to access your camera."
209     local OLD_UDEV_RULES="${ROOT}"etc/udev/rules.d/99-libgphoto2.rules
210     if [[ -f ${OLD_UDEV_RULES} ]]; then
211     rm -f "${OLD_UDEV_RULES}"
212     fi
213     }

  ViewVC Help
Powered by ViewVC 1.1.20