media-gfx/fontforge: Remove py2
[gentoo.git] / media-gfx / fontforge / fontforge-20190317-r3.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=( python3_{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         "${FILESDIR}"/CVE-2020-5395.patch
71 )
72
73 pkg_setup() {
74         use python && python-single-r1_pkg_setup
75 }
76
77 src_configure() {
78         local myeconfargs=(
79                 --disable-static
80                 $(use_enable truetype-debugger freetype-debugger "${EPREFIX}/usr/include/freetype2/internal4fontforge")
81                 $(use_enable python python-extension)
82                 $(use_enable python python-scripting)
83                 --enable-tile-path
84                 --enable-gb12345
85                 $(use_with cairo)
86                 $(use_with gif giflib)
87                 $(use_with jpeg libjpeg)
88                 $(use_with png libpng)
89                 $(use_with readline libreadline)
90                 --without-libspiro
91                 $(use_with tiff libtiff)
92                 $(use_with unicode libuninameslist)
93                 #$(use_with zeromq libzmq)
94                 --without-libzmq
95                 $(use_with X x)
96         )
97         if use gtk; then
98                 # broken AC_ARG_ENABLE usage
99                 # https://bugs.gentoo.org/681550
100                 myeconfargs+=( --enable-gdk=gdk3 )
101         fi
102         econf "${myeconfargs[@]}"
103 }
104
105 src_compile() {
106         # Build system deps are broken
107         emake -C plugins HTDOCS_SUBDIR=/html
108         emake HTDOCS_SUBDIR=/html
109 }
110
111 src_install() {
112         emake DESTDIR="${D}" HTDOCS_SUBDIR=/html install
113         docompress -x /usr/share/doc/${PF}/html
114         einstalldocs
115         find "${ED}" -name '*.la' -type f -delete || die
116 }