1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils readme.gentoo toolchain-funcs
8 DESCRIPTION="Command-line decoder for raw digital photos"
9 HOMEPAGE="http://www.cybercom.net/~dcoffin/dcraw/"
10 SRC_URI="http://www.cybercom.net/~dcoffin/dcraw/archive/${P}.tar.gz
11 mirror://gentoo/parse-1.73.tar.bz2
12 gimp? ( mirror://gentoo/rawphoto-1.32.tar.bz2 )"
16 KEYWORDS="alpha amd64 arm ~hppa ~ia64 ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
17 LANGS=" ca cs de da eo es fr hu it nl pl pt ru sv zh_CN zh_TW"
18 IUSE="nls gimp jpeg jpeg2k lcms ${LANGS// / linguas_}"
21 jpeg? ( virtual/jpeg:0 )
22 lcms? ( media-libs/lcms:2 )
23 jpeg2k? ( media-libs/jasper:= )
24 gimp? ( media-gfx/gimp )
26 DEPEND="${COMMON_DEPEND}
27 nls? ( sys-devel/gettext )
28 gimp? ( virtual/pkgconfig )
30 RDEPEND="${COMMON_DEPEND}
37 See conversion-examples.txt.gz on how to convert
38 the PPM files produced by dcraw to other image formats.\n
40 \nThe functionality of the external program 'fujiturn' was
41 incorporated into dcraw and is automatically used now.\n
43 \nThere's an example wrapper script included called 'dcwrap'.
44 This package also includes 'dcparse', which extracts
45 thumbnail images (preferably JPEGs) from any raw digital
46 camera formats that have them, and shows table contents.
55 rename dcraw_ dcraw. dcraw_*.1 || die "Failed to rename"
59 local ECFLAGS="-O2" # Without optimisation build fails
62 use lcms && ELIBS="-llcms2 ${ELIBS}" || ECFLAGS+=" -DNO_LCMS=yes"
63 use jpeg && ELIBS="-ljpeg ${ELIBS}" || ECFLAGS+=" -DNO_JPEG=yes"
64 use jpeg2k && ELIBS="-ljasper ${ELIBS}" || ECFLAGS+=" -DNO_JASPER=yes"
65 use nls && ECFLAGS+=" -DLOCALEDIR=\"/usr/share/locale/\""
67 run_build $(tc-getCC) ${ECFLAGS} ${CFLAGS} ${LDFLAGS} -o dcraw dcraw.c ${ELIBS}
69 run_build $(tc-getCC) -O2 ${CFLAGS} ${LDFLAGS} -o dcparse parse.c
71 # rawphoto gimp plugin
73 run_build $(tc-getCC) ${CFLAGS} ${LDFLAGS} \
74 $(pkg-config --cflags gimpui-2.0) rawphoto.c -o rawphoto \
75 $(pkg-config --libs gimpui-2.0)
79 for lang in ${LANGS}; do
80 use linguas_${lang} && run_build msgfmt -c -o dcraw_${lang}.mo dcraw_${lang}.po
87 dodoc "${FILESDIR}"/{conversion-examples.txt,dcwrap}
89 # rawphoto gimp plugin
91 insinto "$(pkg-config --variable=gimplibdir gimp-2.0)/plug-ins"
99 for lang in ${LANGS}; do
100 if use linguas_${lang}; then
101 [[ -f dcraw.${lang}.1 ]] && doman dcraw.${lang}.1
102 insinto /usr/share/locale/${lang}/LC_MESSAGES
103 newins dcraw_${lang}.mo dcraw.mo || die "failed to install dcraw_${lang}.mo"
108 readme.gentoo_create_doc