1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake flag-o-matic pax-utils toolchain-funcs xdg
12 DESCRIPTION="A virtual lighttable and darkroom for photographers"
13 HOMEPAGE="https://www.darktable.org/"
14 SRC_URI="https://github.com/darktable-org/${PN}/releases/download/release-${MY_PV}/${MY_P}.tar.xz
15 doc? ( https://github.com/darktable-org/${PN}/releases/download/release-${DOC_PV}/${PN}-usermanual.pdf -> ${PN}-usermanual-${DOC_PV}.pdf )"
17 LICENSE="GPL-3 CC-BY-3.0"
19 KEYWORDS="~amd64 ~x86"
20 LANGS=" ca cs da de es fr he hu it ja nb nl pl ru sl"
21 # TODO add lua once dev-lang/lua-5.2 is unmasked
22 IUSE="colord cups cpu_flags_x86_sse3 doc flickr geolocation gnome-keyring gphoto2 graphicsmagick jpeg2k kwallet
23 nls opencl openmp openexr pax_kernel webp
29 nls? ( sys-devel/gettext )
35 >=dev-libs/pugixml-1.8:0=
37 >=media-gfx/exiv2-0.25-r2:0=[xmp]
39 >=media-libs/lensfun-0.2.3:0=
47 >=x11-libs/gtk+-3.22:3
49 colord? ( x11-libs/colord-gtk:0= )
50 cups? ( net-print/cups )
51 flickr? ( media-libs/flickcurl )
52 geolocation? ( >=sci-geosciences/osm-gps-map-1.1.0 )
53 gnome-keyring? ( >=app-crypt/libsecret-0.18 )
54 gphoto2? ( media-libs/libgphoto2:= )
55 graphicsmagick? ( media-gfx/graphicsmagick )
56 jpeg2k? ( media-libs/openjpeg:2= )
57 opencl? ( virtual/opencl )
58 openexr? ( media-libs/openexr:0= )
59 webp? ( media-libs/libwebp:0= )
61 DEPEND="${COMMON_DEPEND}
66 openmp? ( sys-devel/gcc[openmp,graphite] )
68 RDEPEND="${COMMON_DEPEND}
69 kwallet? ( >=kde-frameworks/kwallet-5.34.0-r1 )
73 "${FILESDIR}"/"${PN}"-find-opencl-header.patch
76 S="${WORKDIR}/${P/_/~}"
80 tc-has-openmp || die "Please switch to an openmp compatible compiler"
85 use cpu_flags_x86_sse3 && append-flags -msse3
87 sed -i -e 's:/appdata:/metainfo:g' data/CMakeLists.txt || die
94 -DBUILD_PRINT=$(usex cups)
96 -DUSE_CAMERA_SUPPORT=$(usex gphoto2)
97 -DUSE_COLORD=$(usex colord)
98 -DUSE_FLICKR=$(usex flickr)
99 -DUSE_GRAPHICSMAGICK=$(usex graphicsmagick)
100 -DUSE_KWALLET=$(usex kwallet)
101 -DUSE_LIBSECRET=$(usex gnome-keyring)
103 -DUSE_MAP=$(usex geolocation)
104 -DUSE_NLS=$(usex nls)
105 -DUSE_OPENCL=$(usex opencl)
106 -DUSE_OPENEXR=$(usex openexr)
107 -DUSE_OPENJPEG=$(usex jpeg2k)
108 -DUSE_OPENMP=$(usex openmp)
109 -DUSE_WEBP=$(usex webp)
111 CMAKE_BUILD_TYPE="RELWITHDEBINFO"
117 use doc && dodoc "${DISTDIR}"/${PN}-usermanual-${DOC_PV}.pdf
120 for lang in ${LANGS} ; do
121 if ! use l10n_${lang}; then
122 rm -r "${ED}"/usr/share/locale/${lang/-/_} || die
127 if use pax_kernel && use opencl ; then
128 pax-mark Cm "${ED}"/usr/bin/${PN} || die
129 eqawarn "USE=pax_kernel is set meaning that ${PN} will be run"
130 eqawarn "under a PaX enabled kernel. To do so, the ${PN} binary"
131 eqawarn "must be modified and this *may* lead to breakage! If"
132 eqawarn "you suspect that ${PN} is broken by this modification,"
133 eqawarn "please open a bug."
140 elog "when updating a major version,"
141 elog "please bear in mind that your edits will be preserved during this process,"
142 elog "but it will not be possible to downgrade any more."
144 ewarn "It will not be possible to downgrade!"