*/*: Discontinue Gentoo SuperH port
[gentoo.git] / media-gfx / fontforge / fontforge-20170731-r5.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python3_6 )
7
8 inherit gnome2-utils python-single-r1 xdg-utils
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-dist-${PV}.tar.xz"
13
14 LICENSE="BSD GPL-3+"
15 SLOT="0"
16 KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 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         python? ( ${PYTHON_REQUIRED_USE} )
24         test? ( png python )
25 "
26
27 RDEPEND="
28         dev-libs/glib
29         dev-libs/libltdl:0
30         dev-libs/libxml2:2=
31         >=media-libs/freetype-2.3.7:2=
32         cairo? (
33                 >=x11-libs/cairo-1.6:0=
34                 x11-libs/pango:0=
35         )
36         gif? ( media-libs/giflib:0= )
37         jpeg? ( virtual/jpeg:0 )
38         png? ( media-libs/libpng:0= )
39         tiff? ( media-libs/tiff:0= )
40         truetype-debugger? ( >=media-libs/freetype-2.3.8:2[fontforge,-bindist(-)] )
41         gtk? ( x11-libs/gtk+:2= )
42         python? ( ${PYTHON_DEPS} )
43         readline? ( sys-libs/readline:0= )
44         unicode? ( media-libs/libuninameslist:0= )
45         X? (
46                 x11-libs/libX11:0=
47                 x11-libs/libXi:0=
48                 >=x11-libs/pango-1.10:0=[X]
49         )
50         !media-gfx/pfaedit
51 "
52 DEPEND="${RDEPEND}
53         sys-devel/gettext
54         virtual/pkgconfig
55         X? ( x11-base/xorg-proto )
56 "
57
58 # Needs keywording on many arches.
59 #       zeromq? (
60 #               >=net-libs/czmq-2.2.0:0=
61 #               >=net-libs/zeromq-4.0.4:0=
62 #       )
63
64 S="${WORKDIR}/fontforge-2.0.${PV}"
65
66 PATCHES=(
67         "${FILESDIR}"/20170731-startnoui-FindOrMakeEncoding.patch
68         "${FILESDIR}"/20170731-tilepath.patch
69         "${FILESDIR}"/20170731-gethex-unaligned.patch
70         "${FILESDIR}"/20170731-PyMem_Free.patch
71         "${FILESDIR}"/CVE-2020-5395.patch
72 )
73
74 pkg_setup() {
75         use python && python-single-r1_pkg_setup
76 }
77
78 src_configure() {
79         local myeconfargs=(
80                 --disable-static
81                 $(use_enable truetype-debugger freetype-debugger "${EPREFIX}/usr/include/freetype2/internal4fontforge")
82                 $(use_enable gtk gtk2-use)
83                 $(use_enable python python-extension)
84                 $(use_enable python python-scripting)
85                 --enable-tile-path
86                 --enable-gb12345
87                 $(use_with cairo)
88                 $(use_with gif giflib)
89                 $(use_with jpeg libjpeg)
90                 $(use_with png libpng)
91                 $(use_with readline libreadline)
92                 --without-libspiro
93                 $(use_with tiff libtiff)
94                 $(use_with unicode libuninameslist)
95                 #$(use_with zeromq libzmq)
96                 --without-libzmq
97                 $(use_with X x)
98         )
99         econf "${myeconfargs[@]}"
100 }
101
102 src_compile() {
103         # Build system deps are broken
104         emake -C plugins
105         emake
106 }
107
108 src_install() {
109         default
110         find "${D}" -name '*.la' -delete || die
111 }
112
113 pkg_postrm() {
114         gnome2_icon_cache_update
115         xdg_desktop_database_update
116         xdg_mimeinfo_database_update
117 }
118
119 pkg_postinst() {
120         gnome2_icon_cache_update
121         xdg_desktop_database_update
122         xdg_mimeinfo_database_update
123 }