dev-libs/kpathsea: ppc stable wrt bug #432144
[gentoo.git] / dev-libs / kpathsea / kpathsea-6.2.1_p20150521-r2.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit texlive-common eutils libtool prefix
8
9 TEXMFD_VERSION="7"
10
11 DESCRIPTION="Library implementing generic path searching, configuration, and TeX-specific file searching"
12 HOMEPAGE="http://tug.org/texlive/"
13 SRC_URI="mirror://gentoo/texlive-${PV#*_p}-source.tar.xz
14         mirror://gentoo/${PN}-texmf.d-${TEXMFD_VERSION}.tar.xz"
15
16 LICENSE="GPL-2"
17 SLOT="0/${PV%_p*}"
18 KEYWORDS="alpha amd64 ~arm ~hppa ~ia64 ~mips ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
19 IUSE="doc source static-libs"
20
21 DEPEND="!<app-text/texlive-core-2013
22         !app-text/ptex"
23 RDEPEND="${DEPEND}"
24
25 S=${WORKDIR}/texlive-${PV#*_p}-source/texk/${PN}
26
27 TL_VERSION=2015
28 EXTRA_TL_MODULES="kpathsea"
29 EXTRA_TL_DOC_MODULES="kpathsea.doc"
30
31 for i in ${EXTRA_TL_MODULES} ; do
32         SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
33 done
34
35 SRC_URI="${SRC_URI} doc? ( "
36 for i in ${EXTRA_TL_DOC_MODULES} ; do
37         SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
38 done
39 SRC_URI="${SRC_URI} ) "
40
41 TEXMF_PATH=/usr/share/texmf-dist
42
43 src_prepare() {
44         epatch "${FILESDIR}/insecure_tmp_mktexlsr.patch"
45         cd "${WORKDIR}/texlive-${PV#*_p}-source"
46         S="${WORKDIR}/texlive-${PV#*_p}-source" elibtoolize #sane .so versionning on gfbsd
47         cp "${FILESDIR}/texmf-update-r2" "${S}"/texmf-update
48         eprefixify "${S}"/texmf-update
49 }
50
51 src_configure() {
52         # Too many regexps use A-Z a-z constructs, what causes problems with locales
53         # that don't have the same alphabetical order than ascii. Bug #347798
54         # So we set LC_ALL to C in order to avoid problems.
55         export LC_ALL=C
56
57         # Disable largefile because it seems to cause problems on big endian 32 bits
58         # systems...
59         econf \
60                 --disable-largefile \
61                 $(use_enable static-libs static)
62 }
63
64 src_install() {
65         emake DESTDIR="${D}" web2cdir="${EPREFIX}/usr/share/texmf-dist/web2c" install
66         find "${D}" -name '*.la' -delete
67
68         dodir /usr/share # just in case
69         cp -pR "${WORKDIR}"/texmf-dist "${ED}/usr/share/" || die "failed to install texmf trees"
70         if use source ; then
71                 cp -pR "${WORKDIR}"/tlpkg "${ED}/usr/share/" || die "failed to install tlpkg files"
72         fi
73
74         # The default configuration expects it to be world writable, bug #266680
75         # People can still change it with texconfig though.
76         dodir /var/cache/fonts
77         fperms 1777 /var/cache/fonts
78
79         # Take care of fmtutil.cnf and texmf.cnf
80         dodir /etc/texmf/{fmtutil.d,texmf.d}
81
82         # Remove default texmf.cnf to ship our own, greatly based on texlive dvd's
83         # texmf.cnf
84         # It will also be generated from /etc/texmf/texmf.d files by texmf-update
85         rm -f "${ED}${TEXMF_PATH}/web2c/texmf.cnf"
86
87         insinto /etc/texmf/texmf.d
88         doins "${WORKDIR}/texmf.d/"*.cnf
89
90         # Remove fmtutil.cnf, it will be regenerated from /etc/texmf/fmtutil.d files
91         # by texmf-update
92         rm -f "${ED}${TEXMF_PATH}/web2c/fmtutil.cnf"
93
94         dosym /etc/texmf/web2c/fmtutil.cnf ${TEXMF_PATH}/web2c/fmtutil.cnf
95         dosym /etc/texmf/web2c/texmf.cnf ${TEXMF_PATH}/web2c/texmf.cnf
96
97         newsbin "${S}/texmf-update" texmf-update
98
99         # Keep it as that's where the formats will go
100         keepdir /var/lib/texmf
101
102         dodoc ChangeLog NEWS PROJECTS README
103 }
104
105 pkg_postinst() {
106         etexmf-update
107 }
108
109 pkg_postrm() {
110         etexmf-update
111 }