media-gfx/inkscape-9999: added live ebuild
[gentoo.git] / media-gfx / inkscape / inkscape-9999.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{5,6,7} )
7 PYTHON_REQ_USE="xml"
8 MY_P="${P/_/}"
9 inherit cmake-utils flag-o-matic xdg toolchain-funcs python-single-r1 git-r3
10
11 DESCRIPTION="SVG based generic vector-drawing program"
12 HOMEPAGE="https://inkscape.org/"
13 EGIT_REPO_URI="https://gitlab.com/inkscape/inkscape.git"
14
15 LICENSE="GPL-2 LGPL-2.1"
16 SLOT="0"
17 KEYWORDS=""
18 IUSE="cdr dbus dia exif gnome graphicsmagick imagemagick inkjar jemalloc jpeg
19 lcms nls openmp postscript spell static-libs svg2 visio wpg"
20
21 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
22
23 BDEPEND="
24         dev-util/glib-utils
25         >=dev-util/intltool-0.40
26         >=sys-devel/gettext-0.17
27         virtual/pkgconfig
28 "
29 COMMON_DEPEND="${PYTHON_DEPS}
30         >=app-text/poppler-0.57.0:=[cairo]
31         >=dev-cpp/cairomm-1.12
32         >=dev-cpp/glibmm-2.54.1
33         dev-cpp/gtkmm:3.0
34         >=dev-cpp/pangomm-2.40
35         >=dev-libs/boehm-gc-7.1:=
36         dev-libs/double-conversion:=
37         >=dev-libs/glib-2.41
38         >=dev-libs/libsigc++-2.8
39         >=dev-libs/libxml2-2.7.4
40         >=dev-libs/libxslt-1.1.25
41         dev-libs/gdl:3
42         dev-libs/popt
43         dev-python/lxml[${PYTHON_USEDEP}]
44         media-gfx/potrace
45         media-gfx/scour[${PYTHON_USEDEP}]
46         media-libs/fontconfig
47         media-libs/freetype:2
48         media-libs/libpng:0=
49         net-libs/libsoup
50         sci-libs/gsl:=
51         x11-libs/libX11
52         >=x11-libs/pango-1.37.2
53         x11-libs/gtk+:3
54         cdr? (
55                 app-text/libwpg:0.3
56                 dev-libs/librevenge
57                 media-libs/libcdr
58         )
59         dbus? ( dev-libs/dbus-glib )
60         exif? ( media-libs/libexif )
61         gnome? ( >=gnome-base/gnome-vfs-2.0 )
62         imagemagick? (
63                 !graphicsmagick? ( <media-gfx/imagemagick-7:=[cxx] )
64                 graphicsmagick? ( media-gfx/graphicsmagick:=[cxx] )
65         )
66         jemalloc? ( dev-libs/jemalloc )
67         jpeg? ( virtual/jpeg:0 )
68         lcms? ( media-libs/lcms:2 )
69         spell? (
70                 app-text/aspell
71                 app-text/gtkspell:3
72         )
73         visio? (
74                 app-text/libwpg:0.3
75                 dev-libs/librevenge
76                 media-libs/libvisio
77         )
78         wpg? (
79                 app-text/libwpg:0.3
80                 dev-libs/librevenge
81         )
82 "
83 # These only use executables provided by these packages
84 # See share/extensions for more details. inkscape can tell you to
85 # install these so we could of course just not depend on those and rely
86 # on that.
87 RDEPEND="${COMMON_DEPEND}
88         dev-python/numpy[${PYTHON_USEDEP}]
89         dia? ( app-office/dia )
90         postscript? ( app-text/ghostscript-gpl )
91 "
92 DEPEND="${COMMON_DEPEND}
93         >=dev-libs/boost-1.65
94 "
95
96 S="${WORKDIR}/${MY_P}"
97
98 RESTRICT="test"
99
100 PATCHES=(
101         "${FILESDIR}"/${PN}-1.0_beta1-detect-imagemagick.patch
102         "${FILESDIR}"/${PN}-1.0_beta1-do-not-compress-man.patch
103 )
104
105 pkg_pretend() {
106         if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
107                 tc-has-openmp || die "Please switch to an openmp compatible compiler"
108         fi
109 }
110
111 src_prepare() {
112         cmake-utils_src_prepare
113         sed -i "/install.*COPYING/d" CMakeScripts/ConfigCPack.cmake || die
114 }
115
116 src_configure() {
117         # aliasing unsafe wrt #310393
118         append-flags -fno-strict-aliasing
119
120         local mycmakeargs=(
121                 # -DWITH_LPETOOL   # Compile with LPE Tool and experimental LPEs enabled
122                 -DENABLE_POPPLER=ON
123                 -DENABLE_POPPLER_CAIRO=ON
124                 -DWITH_PROFILING=OFF
125                 -DWITH_LIBCDR=$(usex cdr)
126                 -DWITH_DBUS=$(usex dbus)
127                 -DWITH_IMAGE_MAGICK=$(usex imagemagick) # requires ImageMagick 6
128                 -DWITH_GRAPHICS_MAGICK=$(usex graphicsmagick)
129                 -DWITH_JEMALLOC=$(usex jemalloc)
130                 -DENABLE_LCMS=$(usex lcms)
131                 -DWITH_NLS=$(usex nls)
132                 -DWITH_OPENMP=$(usex openmp)
133                 -DBUILD_SHARED_LIBS=$(usex !static-libs)
134                 -DWITH_SVG2=$(usex svg2)
135                 -DWITH_LIBVISIO=$(usex visio)
136                 -DWITH_LIBWPG=$(usex wpg)
137         )
138
139         cmake-utils_src_configure
140 }
141
142 src_install() {
143         cmake-utils_src_install
144
145         find "${ED}" -type f -name "*.la" -delete || die
146
147         # No extensions are present in beta1
148         local extdir="${ED}"/usr/share/${PN}/extensions
149
150         if [[ -e "${extdir}" ]] && [[ -n $(find "${extdir}" -mindepth 1) ]]; then
151                 python_optimize "${ED}"/usr/share/${PN}/extensions
152         fi
153 }