210cb2b03cc9bb0053f51e68789bced01e169660
[gentoo.git] / media-gfx / fontforge / fontforge-20190317-r2.ebuild
1 # Copyright 2004-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python{2_7,3_{6,7}} )
7
8 inherit python-single-r1 xdg
9
10 DESCRIPTION="postscript font editor and converter"
11 HOMEPAGE="http://fontforge.github.io/"
12 SRC_URI="https://github.com/fontforge/fontforge/releases/download/${PV}/fontforge-${PV}.tar.gz"
13
14 LICENSE="BSD GPL-3+"
15 SLOT="0"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
17 IUSE="cairo truetype-debugger gif gtk jpeg png +python readline test tiff svg unicode X"
18
19 RESTRICT="!test? ( test )"
20
21 REQUIRED_USE="
22         cairo? ( png )
23         gtk? ( cairo )
24         python? ( ${PYTHON_REQUIRED_USE} )
25         test? ( png python )
26 "
27
28 RDEPEND="
29         dev-libs/glib
30         dev-libs/libltdl:0
31         dev-libs/libxml2:2=
32         >=media-libs/freetype-2.3.7:2=
33         cairo? (
34                 >=x11-libs/cairo-1.6:0=
35                 x11-libs/pango:0=
36         )
37         gif? ( media-libs/giflib:0= )
38         jpeg? ( virtual/jpeg:0 )
39         png? ( media-libs/libpng:0= )
40         tiff? ( media-libs/tiff:0= )
41         truetype-debugger? ( >=media-libs/freetype-2.3.8:2[fontforge,-bindist(-)] )
42         gtk? ( >=x11-libs/gtk+-3.10:3 )
43         python? ( ${PYTHON_DEPS} )
44         readline? ( sys-libs/readline:0= )
45         unicode? ( media-libs/libuninameslist:0= )
46         X? (
47                 x11-libs/libX11:0=
48                 x11-libs/libXi:0=
49                 >=x11-libs/pango-1.10:0=[X]
50         )
51         !media-gfx/pfaedit
52 "
53 DEPEND="${RDEPEND}
54         X? ( x11-base/xorg-proto )
55 "
56 BDEPEND="
57         sys-devel/gettext
58         virtual/pkgconfig
59 "
60
61 # Needs keywording on many arches.
62 #       zeromq? (
63 #               >=net-libs/czmq-2.2.0:0=
64 #               >=net-libs/zeromq-4.0.4:0=
65 #       )
66
67 PATCHES=(
68         "${FILESDIR}"/20170731-gethex-unaligned.patch
69         "${FILESDIR}"/20190317-gdk_init.patch
70 )
71
72 pkg_setup() {
73         use python && python-single-r1_pkg_setup
74 }
75
76 src_configure() {
77         local myeconfargs=(
78                 --disable-static
79                 $(use_enable truetype-debugger freetype-debugger "${EPREFIX}/usr/include/freetype2/internal4fontforge")
80                 $(use_enable python python-extension)
81                 $(use_enable python python-scripting)
82                 --enable-tile-path
83                 --enable-gb12345
84                 $(use_with cairo)
85                 $(use_with gif giflib)
86                 $(use_with jpeg libjpeg)
87                 $(use_with png libpng)
88                 $(use_with readline libreadline)
89                 --without-libspiro
90                 $(use_with tiff libtiff)
91                 $(use_with unicode libuninameslist)
92                 #$(use_with zeromq libzmq)
93                 --without-libzmq
94                 $(use_with X x)
95         )
96         if use gtk; then
97                 # broken AC_ARG_ENABLE usage
98                 # https://bugs.gentoo.org/681550
99                 myeconfargs+=( --enable-gdk=gdk3 )
100         fi
101         econf "${myeconfargs[@]}"
102 }
103
104 src_compile() {
105         # Build system deps are broken
106         emake -C plugins HTDOCS_SUBDIR=/html
107         emake HTDOCS_SUBDIR=/html
108 }
109
110 src_install() {
111         emake DESTDIR="${D}" HTDOCS_SUBDIR=/html install
112         docompress -x /usr/share/doc/${PF}/html
113         einstalldocs
114         find "${ED}" -name '*.la' -type f -delete || die
115 }