1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake-utils flag-o-matic toolchain-funcs gnome2-utils fdo-mime pax-utils eutils
10 DESCRIPTION="A virtual lighttable and darkroom for photographers"
11 HOMEPAGE="http://www.darktable.org/"
12 SRC_URI="https://github.com/darktable-org/${PN}/releases/download/release-${PV}/${P}.tar.xz
13 doc? ( https://github.com/darktable-org/${PN}/releases/download/release-${DOC_PV}/${PN}-usermanual.pdf -> ${PN}-usermanual-${DOC_PV}.pdf )"
15 LICENSE="GPL-3 CC-BY-3.0"
18 LANGS=" ca cs da de el es fr he hu it ja nl pl pt-BR pt-PT ru sk sl sq sv uk"
19 # TODO add lua once dev-lang/lua-5.2 is unmasked
20 IUSE="colord cups cpu_flags_x86_sse3 doc flickr gphoto2 graphicsmagick jpeg2k kde libsecret
21 nls opencl openmp openexr pax_kernel +slideshow webp
24 # sse3 support is required to build darktable
25 REQUIRED_USE="cpu_flags_x86_sse3"
33 >=media-gfx/exiv2-0.25-r2:0=[xmp]
35 >=media-libs/lensfun-0.2.3:0=
43 colord? ( x11-libs/colord-gtk:0= )
44 cups? ( net-print/cups )
45 flickr? ( media-libs/flickcurl )
46 gphoto2? ( media-libs/libgphoto2:= )
47 graphicsmagick? ( media-gfx/graphicsmagick )
48 jpeg2k? ( media-libs/openjpeg:0 )
50 >=app-crypt/libsecret-0.18
52 opencl? ( virtual/opencl )
53 openexr? ( media-libs/openexr:0= )
59 webp? ( media-libs/libwebp:0= )"
61 kde? ( kde-apps/kwalletd:4 )"
65 nls? ( sys-devel/gettext )"
69 tc-has-openmp || die "Please switch to an openmp compatible compiler"
74 use cpu_flags_x86_sse3 && append-flags -msse3
76 sed -e "s:\(/share/doc/\)darktable:\1${PF}:" \
77 -e "s:\(\${SHARE_INSTALL}/doc/\)darktable:\1${PF}:" \
79 -i doc/CMakeLists.txt || die
81 cmake-utils_src_prepare
86 $(cmake-utils_use_use colord COLORD)
87 $(cmake-utils_use_build cups PRINT)
88 $(cmake-utils_use_use flickr FLICKR)
89 $(cmake-utils_use_use gphoto2 CAMERA_SUPPORT)
90 $(cmake-utils_use_use graphicsmagick GRAPHICSMAGICK)
91 $(cmake-utils_use_use jpeg2k OPENJPEG)
92 $(cmake-utils_use_use kde KWALLET)
93 $(cmake-utils_use_use libsecret LIBSECRET)
94 $(cmake-utils_use_use nls NLS)
95 $(cmake-utils_use_use opencl OPENCL)
96 $(cmake-utils_use_use openexr OPENEXR)
97 $(cmake-utils_use_use openmp OPENMP)
98 $(cmake-utils_use_build slideshow SLIDESHOW)
99 $(cmake-utils_use_use webp WEBP)
103 -DINSTALL_IOP_EXPERIMENTAL=ON
104 -DINSTALL_IOP_LEGACY=ON
106 cmake-utils_src_configure
110 cmake-utils_src_install
111 use doc && dodoc "${DISTDIR}"/${PN}-usermanual-${DOC_PV}.pdf
113 for lang in ${LANGS} ; do
114 use l10n_${lang} || rm -r "${ED}"/usr/share/locale/${lang/-/_}
117 if use pax_kernel && use opencl ; then
118 pax-mark Cm "${ED}"/usr/bin/${PN} || die
119 eqawarn "USE=pax_kernel is set meaning that ${PN} will be run"
120 eqawarn "under a PaX enabled kernel. To do so, the ${PN} binary"
121 eqawarn "must be modified and this *may* lead to breakage! If"
122 eqawarn "you suspect that ${PN} is broken by this modification,"
123 eqawarn "please open a bug."
132 gnome2_icon_cache_update
133 fdo-mime_desktop_database_update
135 elog "when updating from the currently stable 1.6 series,"
136 elog "please bear in mind that your edits will be preserved during this process,"
137 elog "but it will not be possible to downgrade from 2.0 to 1.6 any more."
139 ewarn "It will not be possible to downgrade!"
143 gnome2_icon_cache_update
144 fdo-mime_desktop_database_update