dev-qt/qdbus: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / app-dicts / wordnet / wordnet-3.1.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 inherit autotools eutils flag-o-matic
7
8 DESCRIPTION="A lexical database for the English language"
9 HOMEPAGE="https://wordnet.princeton.edu/"
10 SRC_URI="
11         http://wordnetcode.princeton.edu/3.0/WordNet-3.0.tar.gz
12         mirror://gentoo/${PN}-3.0-patchset-1.tar.bz2
13         http://wordnetcode.princeton.edu/wn3.1.dict.tar.gz"
14 LICENSE="Princeton"
15
16 SLOT="0"
17 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
18 IUSE="doc"
19
20 # In contrast to what the configure script seems to imply, Tcl/Tk is NOT
21 # optional. cf. bug 163478 for details. (Yes, it's about 2.1 but it's
22 # still the same here.)
23 DEPEND="
24         dev-lang/tcl:0=
25         dev-lang/tk:0="
26 RDEPEND="${DEPEND}"
27
28 S="${WORKDIR}/WordNet-3.0"
29
30 PATCHES1=(
31         # Don't install into PREFIX/dict but PREFIX/share/wordnet/dict
32         "${WORKDIR}/"${PN}-3.0"-dict-location.patch"
33         # Fixes bug 130024, make an additional shared lib
34         "${WORKDIR}/"${PN}-3.0"-shared-lib.patch"
35         # Don't install the docs directly into PREFIX/doc but PREFIX/doc/PN
36         "${WORKDIR}/"${PN}-3.0"-docs-path.patch"
37         "${WORKDIR}"/"${PN}-3.0"-CVE-2008-3908.patch #211491
38
39         "${FILESDIR}"/"${PN}-3.0"-tcl8.6.patch
40         "${FILESDIR}"/"${PN}-3.0"-format-security.patch
41         "${FILESDIR}"/"${PN}-3.0"-src_stubs_c.patch
42         "${FILESDIR}"/"${PN}-3.0"-fix-indexing-bug-314799.patch
43 )
44
45 PATCHES0=(
46         "${WORKDIR}"/"${PN}-3.0"-CVE-2008-2149.patch #211491
47 )
48
49 src_prepare() {
50         eapply -p1 "${PATCHES1[@]}"
51         eapply -p0 "${PATCHES0[@]}"
52         eapply_user
53
54         # Don't install all the extra docs (html, pdf, ps) without doc USE flag.
55         if ! use doc; then
56                 sed -i -e "s:SUBDIRS =.*:SUBDIRS = man:" doc/Makefile.am || die
57         fi
58
59         # Drop installation of OLD tk.h headers #255590
60         sed '/^SUBDIRS/d' -i include/Makefile.am || die
61         sed 's: include/tk/Makefile::' -i configure.ac || die
62         eautoreconf
63 }
64
65 src_configure() {
66         append-cppflags -DUNIX -I"${T}"/usr/include
67
68         PLATFORM=linux WN_ROOT="${T}/usr" \
69         WN_DICTDIR="${T}/usr/share/wordnet/dict" \
70         WN_MANDIR="${T}/usr/share/man" \
71         WN_DOCDIR="${T}/usr/share/doc/wordnet-3.0" \
72         WNHOME="${EPREFIX}/usr/share/wordnet" \
73         econf \
74                 --with-tcl="${EPREFIX}"/usr/$(get_libdir) \
75                 --with-tk="${EPREFIX}"/usr/$(get_libdir)
76 }
77
78 src_compile() {
79         emake -e
80 }
81
82 src_install() {
83         # For clarification, WN is still on  version 3.0. Only the database files
84         # have been updated to 3.1 as a package for 3.1 does not currently exist.
85         emake -e DESTDIR="${D}" install
86         einstalldocs
87         rm -r "${D}/usr/share/wordnet/dict" || die
88         mv "${WORKDIR}/dict" "${D}/usr/share/wordnet" || die
89 }
90
91 pkg_postinst() {
92         elog "The WordNet 3.1 ebuild has installed WordNet v3.0 with v3.1 database files instead."
93         elog "See https://wordnet.princeton.edu/download/current-version/ for more."
94 }