media-gfx/darktable: x86 stable wrt bug #615858
[gentoo.git] / media-gfx / darktable / darktable-2.0.7.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit cmake-utils flag-o-matic toolchain-funcs gnome2-utils fdo-mime pax-utils eutils
7
8 DOC_PV="2.0.0"
9
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 )"
14
15 LICENSE="GPL-3 CC-BY-3.0"
16 SLOT="0"
17 KEYWORDS="amd64 x86"
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
22 ${LANGS// / l10n_}"
23
24 # sse3 support is required to build darktable
25 REQUIRED_USE="cpu_flags_x86_sse3"
26
27 CDEPEND="
28         dev-db/sqlite:3
29         dev-libs/json-glib
30         dev-libs/libxml2:2
31         dev-libs/pugixml:0=
32         gnome-base/librsvg:2
33         >=media-gfx/exiv2-0.25-r2:0=[xmp]
34         media-libs/lcms:2
35         >=media-libs/lensfun-0.2.3:0=
36         media-libs/libpng:0=
37         media-libs/tiff:0
38         net-misc/curl
39         virtual/jpeg:0
40         x11-libs/cairo
41         x11-libs/gtk+:3
42         x11-libs/pango
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 )
49         libsecret? (
50                 >=app-crypt/libsecret-0.18
51         )
52         opencl? ( virtual/opencl )
53         openexr? ( media-libs/openexr:0= )
54         slideshow? (
55                 media-libs/libsdl
56                 virtual/glu
57                 virtual/opengl
58         )
59         webp? ( media-libs/libwebp:0= )"
60 RDEPEND="${CDEPEND}
61         kde? ( kde-apps/kwalletd:4 )"
62 DEPEND="${CDEPEND}
63         dev-util/intltool
64         virtual/pkgconfig
65         nls? ( sys-devel/gettext )"
66
67 pkg_pretend() {
68         if use openmp ; then
69                 tc-has-openmp || die "Please switch to an openmp compatible compiler"
70         fi
71 }
72
73 src_prepare() {
74         use cpu_flags_x86_sse3 && append-flags -msse3
75
76         sed -e "s:\(/share/doc/\)darktable:\1${PF}:" \
77                 -e "s:\(\${SHARE_INSTALL}/doc/\)darktable:\1${PF}:" \
78                 -e "s:LICENSE::" \
79                 -i doc/CMakeLists.txt || die
80
81         cmake-utils_src_prepare
82 }
83
84 src_configure() {
85         local mycmakeargs=(
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)
100                 -DUSE_GEO=OFF
101                 -DUSE_LUA=OFF
102                 -DCUSTOM_CFLAGS=ON
103                 -DINSTALL_IOP_EXPERIMENTAL=ON
104                 -DINSTALL_IOP_LEGACY=ON
105         )
106         cmake-utils_src_configure
107 }
108
109 src_install() {
110         cmake-utils_src_install
111         use doc && dodoc "${DISTDIR}"/${PN}-usermanual-${DOC_PV}.pdf
112
113         for lang in ${LANGS} ; do
114                 use l10n_${lang} || rm -r "${ED}"/usr/share/locale/${lang/-/_}
115         done
116
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."
124         fi
125 }
126
127 pkg_preinst() {
128         gnome2_icon_savelist
129 }
130
131 pkg_postinst() {
132         gnome2_icon_cache_update
133         fdo-mime_desktop_database_update
134
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."
138         echo
139         ewarn "It will not be possible to downgrade!"
140 }
141
142 pkg_postrm() {
143         gnome2_icon_cache_update
144         fdo-mime_desktop_database_update
145 }