/[gentoo-x86]/media-gfx/dcraw/dcraw-9.05.ebuild
Gentoo

Contents of /media-gfx/dcraw/dcraw-9.05.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Sat May 5 07:00:19 2012 UTC (2 years, 2 months ago) by jdhore
Branch: MAIN
Changes since 1.8: +3 -3 lines
dev-util/pkgconfig -> virtual/pkgconfig

(Portage version: 2.2.0_alpha101/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-gfx/dcraw/dcraw-9.05.ebuild,v 1.8 2011/04/25 22:09:10 hanno Exp $
4
5 EAPI="2"
6
7 inherit eutils toolchain-funcs
8
9 DESCRIPTION="Converts the native (RAW) format of various digital cameras into netpbm portable pixmap (.ppm) image"
10 HOMEPAGE="http://www.cybercom.net/~dcoffin/dcraw/"
11 SRC_URI="http://www.cybercom.net/~dcoffin/dcraw/archive/${P}.tar.gz
12 mirror://gentoo/parse-1.71.tar.bz2
13 gimp? ( mirror://gentoo/rawphoto-1.32.tar.bz2 )"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
18 IUSE="nls gimp jpeg lcms"
19
20 COMMON_DEPEND="jpeg? ( virtual/jpeg )
21 lcms? ( =media-libs/lcms-1* )
22 gimp? ( media-gfx/gimp )"
23 DEPEND="${COMMON_DEPEND}
24 nls? ( sys-devel/gettext )
25 gimp? ( virtual/pkgconfig )"
26 RDEPEND="${COMMON_DEPEND}
27 media-libs/netpbm"
28
29 S=${WORKDIR}/dcraw
30
31 LANGS="ca cs de da eo es fr hu it nl pl pt ru sv zh_CN zh_TW"
32
33 for lng in ${LANGS}; do
34 IUSE+=" linguas_${lng}"
35 done
36
37 # Helper function to list only langs listed in LANGS or
38 linguas_list() {
39 local nolangs=true
40 for lng in ${LANGS}; do
41 if use linguas_${lng}; then
42 nolangs=false
43 echo " ${lng}"
44 fi
45 done
46 if ${nolangs}; then
47 echo ${LANGS}
48 fi
49 }
50
51 run_build() {
52 einfo "${@}"
53 ${@} || die
54 }
55
56 src_prepare() {
57 rename dcraw_ dcraw. dcraw_*.1 || die "Failed to rename"
58 }
59
60 src_compile() {
61 local ECFLAGS="-O2" # Without optimisation build fails
62 local ELIBS="-lm"
63
64 use lcms && ELIBS="-llcms ${ELIBS}" || ECFLAGS+=" -DNO_LCMS=yes"
65 use jpeg && ELIBS="-ljpeg ${ELIBS}" || ECFLAGS+=" -DNO_JPEG=yes"
66 use nls && ECFLAGS+=" -DLOCALEDIR=\"/usr/share/locale/\""
67
68 run_build $(tc-getCC) ${ECFLAGS} ${CFLAGS} ${LDFLAGS} \
69 -o dcraw dcraw.c ${ELIBS}
70
71 run_build $(tc-getCC) -O2 ${CFLAGS} ${LDFLAGS} \
72 -o dcparse parse.c
73
74 # rawphoto gimp plugin
75 if use gimp; then
76 run_build $(tc-getCC) ${CFLAGS} ${LDFLAGS} \
77 $(pkg-config --cflags gimpui-2.0) rawphoto.c -o rawphoto \
78 $(pkg-config --libs gimpui-2.0)
79 fi
80
81 if use nls; then
82 for lng in $(linguas_list); do
83 run_build msgfmt -c -o dcraw_${lng}.mo dcraw_${lng}.po
84 done
85 fi
86 }
87
88 src_install() {
89 dobin dcraw dcparse || die
90 dodoc "${FILESDIR}"/{conversion-examples.txt,dcwrap} || die
91
92 # rawphoto gimp plugin
93 if use gimp; then
94 insinto "$(pkg-config --variable=gimplibdir gimp-2.0)/plug-ins"
95 insopts -m0755
96 doins rawphoto || die
97 fi
98
99 doman dcraw.1 || die
100 if use nls; then
101 for lng in $(linguas_list); do
102 [[ -f dcraw.${lng}.1 ]] && doman dcraw.${lng}.1
103 insinto /usr/share/locale/${lng}/LC_MESSAGES
104 newins dcraw_${lng}.mo dcraw.mo || die "failed to install dcraw_${lng}.mo"
105 done
106 fi
107 }
108
109 pkg_postinst() {
110 elog ""
111 elog "See conversion-examples.txt.gz on how to convert"
112 elog "the PPM files produced by dcraw to other image formats."
113 elog ""
114 ewarn "The functionality of the external program 'fujiturn' was"
115 ewarn "incorporated into dcraw and is automatically used now."
116 elog ""
117 elog "There's an example wrapper script included called 'dcwrap'."
118 elog ""
119 elog "This package also includes 'dcparse', which extracts"
120 elog "thumbnail images (preferably JPEGs) from any raw digital"
121 elog "camera formats that have them, and shows table contents."
122 elog ""
123 }

  ViewVC Help
Powered by ViewVC 1.1.20