summaryrefslogtreecommitdiff
path: root/dev-libs/kpathsea
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-libs/kpathsea
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-libs/kpathsea')
-rw-r--r--dev-libs/kpathsea/Manifest12
-rw-r--r--dev-libs/kpathsea/files/insecure_tmp_mktexlsr.patch17
-rw-r--r--dev-libs/kpathsea/files/texmf-update-r2168
-rw-r--r--dev-libs/kpathsea/kpathsea-6.2.2_p20160523.ebuild110
-rw-r--r--dev-libs/kpathsea/kpathsea-6.2.3_p20170524.ebuild110
-rw-r--r--dev-libs/kpathsea/metadata.xml12
6 files changed, 429 insertions, 0 deletions
diff --git a/dev-libs/kpathsea/Manifest b/dev-libs/kpathsea/Manifest
new file mode 100644
index 000000000000..e63833abc98e
--- /dev/null
+++ b/dev-libs/kpathsea/Manifest
@@ -0,0 +1,12 @@
+AUX insecure_tmp_mktexlsr.patch 602 BLAKE2B bb2dd2178a515431e643f4a3e91a4b30fb8e63e860e6e0b6c13208b00642bc88a672b1dc9ead8277c593c2ef333f0581af24c821b6f3c84841a750911d4fe909 SHA512 2b9e92665482403b7a153c27ad8aea5ae5f05ef42c994c899ee4987d39fb4005204c7abbb464d7c0ec1b48a7630d34991d6fea3076cee1f50d9c4855c7a908f1
+AUX texmf-update-r2 6017 BLAKE2B b9ded4693768342c6fe9a0d99b6836e74b3d8b9a5bb3d335d8ecbbe5c2a45967ac880ebfc2476c04e461ca2dac3eb02ee6c41ee34a050ba94b54d9d731853ee0 SHA512 924c6a53d778b1a05252830d914c92f8d1a8d1c479cd8a065b861bf1f263d6bb529c42c365134fea19ea1d9bedf68a943d609cd89abf73912f90bbc3397fb14f
+DIST kpathsea-texmf.d-8.tar.xz 11456 BLAKE2B e631ebcae97494b963dbe4bc03d7ba19ce0a38392dca8c171a40738cd7c6ea46ee821f993ab3ce8f4beb068cc485cb1c84adc7a07dd13c58c68bf9a0c17dff5e SHA512 496ef6e3134f1b0507b15729416de86d72f41b518f4d382c78c2f39b0d603d3d44f8c8befdab2351d38d2a26fd87e5a73570a67b11dbb3f307b006f409a6f036
+DIST texlive-20160523-source.tar.xz 45941100 BLAKE2B 8752212d41d6bbabc725d9b1dcc187dd4dbb34df4271c768e83c13a2dd4e7170aa162d01a15d87fa02bc1b5abee648a2d35e3aa1380569851cc21d6f33f2f109 SHA512 915fa2f5e2099dd385ef81033db7aafdf09558c0c200fed0748a8a42fd61f69d3eaac9decea334e30981af739dd81061a9b1d6853c7f6d00285fe0be40e26c3e
+DIST texlive-20170524-source.tar.xz 63483372 BLAKE2B 44669d1228f5be27e9d93672a4f4ead40f7f4c6cf386f2db6fef54d64f8b8a743a485fe1170904d8117b9745f71ec77db8434caa6cdd79359b1f3f387130a3b4 SHA512 18c18940992ab94ce22e22ccd4ad798253ea14ac2ab296a10ea5e9a8da9f33989f2e2641b42b564d1d5fb53bd371da3e68726b676d706b469016ad146cd19daa
+DIST texlive-module-kpathsea-2016.tar.xz 30696 BLAKE2B 066f5586c93b07db1c07ee0e9a31465e24564faa30b0abf40e31212a1048527a54c58d516c5af139931df2f7d32b6c9c679080acc93f71f05245b2c4f0bb9530 SHA512 330254cf76fd30bf3686dd48710f21c4804f2f6ea9b14e6033b2741c3e6ba627e51efe96da9a1089120d474e36aad1c052285a7ea394b76ee2d4d335b86095fd
+DIST texlive-module-kpathsea-2017.tar.xz 30956 BLAKE2B f9f7d70a6d814996a211a5f3d9c6ee1f477497f84e4716af915bf1171018243094f11d131d2f51930575129b6e16e5fe5e907c0d74be1a182ba7e573be0eadb5 SHA512 df4bc2175394bb6e9726b2c09ccf04e2787f73d584dd6944a25b3aab1eb6e8b4bdcd14ca043b7fe4f6e240ede1bd7e9003b83e34dd3df8c685658b8dcddc83c9
+DIST texlive-module-kpathsea.doc-2016.tar.xz 1128872 BLAKE2B e3b2e5c2c14e2d67fba3c89d31169b2af13bd6767983302ca302369ee8cf790655b248cc1069cfd59e4044562627eb83bca6ffe368d5c1b38832e08fcc53b678 SHA512 1cfbb4b5a8647bf5da46b04c9bc911091aa3322b154d65544aa3a1163e24b6906d7e5420549ab0ba023250e6dfa90e75d3a20dffd2e7360fba068a5c3cece885
+DIST texlive-module-kpathsea.doc-2017.tar.xz 1128868 BLAKE2B d1f6bb2f9a893616cc9e090671a7a3c2aaab0f942eed0824a60826b75ee0a62ded33cad197d0bb953100a02ecead1f8d84bf7374889bdba9fc36a26b23440a9c SHA512 af829f666c815da49b59bbe678a2c1e9fe45cbc528f484dfb6e43a1e52bbf0245a4e571505f5be2cc7cf7f5ebcdb06b862ac6e9f9b5390489f0fab10a11fd997
+EBUILD kpathsea-6.2.2_p20160523.ebuild 3274 BLAKE2B d028c3c47209c2505ec27054c2b5c7526fa548649eda49a2f58680389cbf2261e5d06a0014de9176c6f02ab7cd3df4e2a47b28fcce2fca01956465ad7f644f45 SHA512 2593e50d9d773406fa17dd4583ad02d837ede26de6140aa8b4a593170693b0c49bebe2e025b50356165b1c9ce8432b99e4e341c2f1874c000861c901ff1319ca
+EBUILD kpathsea-6.2.3_p20170524.ebuild 3273 BLAKE2B db68b110c43d3f0ffc5aed688dff1aa8ba6e6b404a7aed816a0789d90d75c5e9169e603bf9199a14668ebc2727b1d6ff7ddc20e0216935642ae881b8ffef7b3a SHA512 cc42ada1746d0cfd038d12fcf53732f39b41c072d20df0c94dd917c6daf13a250db94e7b2006bba12fa8101083a22c187bfb3ed1abc36721cb549e426eded52f
+MISC metadata.xml 358 BLAKE2B b5a2e9424ef1e5bb23c34e089d9204443dd5ad528b56db71d2fc2b3c5d428c14367805ca94a307f8856d21356abe76092c54ba0f0df204b5bce3665f9f3fd657 SHA512 51f6411780af5d7775f8f80d246d5f4e297abb1960a0b0c21c6dc5c03a9a407dad8cbc4977a679590cffb4523f1b72a0f7b15ab100c938391a5abfd3e17e8818
diff --git a/dev-libs/kpathsea/files/insecure_tmp_mktexlsr.patch b/dev-libs/kpathsea/files/insecure_tmp_mktexlsr.patch
new file mode 100644
index 000000000000..36d2094cddf0
--- /dev/null
+++ b/dev-libs/kpathsea/files/insecure_tmp_mktexlsr.patch
@@ -0,0 +1,17 @@
+https://bugzilla.redhat.com/show_bug.cgi?id=1181167
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775139
+https://bugs.gentoo.org/show_bug.cgi?id=536454
+
+Index: kpathsea/mktexlsr
+===================================================================
+--- kpathsea.orig/mktexlsr
++++ kpathsea/mktexlsr
+@@ -73,7 +73,7 @@ if tty -s; then verbose=true; else verbo
+ dry_run=false
+ trees=
+
+-treefile="${TMPDIR-/tmp}/mktexlsrtrees$$.tmp"
++treefile=`mktemp --tmpdir mktexlsrtrees.XXXXXXXXXX` || exit 1
+ trap 'cd /; rm -f $treefile; test -z "$db_dir_tmp" || rm -rf "$db_dir_tmp";
+ exit' 0 1 2 3 7 13 15
+
diff --git a/dev-libs/kpathsea/files/texmf-update-r2 b/dev-libs/kpathsea/files/texmf-update-r2
new file mode 100644
index 000000000000..d30cbd3b3eac
--- /dev/null
+++ b/dev-libs/kpathsea/files/texmf-update-r2
@@ -0,0 +1,168 @@
+#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
+#
+# Utility to update Gentoo TeXLive distribution configuration files
+#
+
+echo "Configuring TeXLive ..."
+
+PATH="@GENTOO_PORTAGE_EPREFIX@"/bin:"@GENTOO_PORTAGE_EPREFIX@"/usr/bin
+
+# Fix for all those with altered umask for root
+umask 022
+
+# Ensure reliable order when concatenating files, bug #579018
+LC_COLLATE=C
+
+# Make sure we have a correct environment, bug #30432
+# The list of env. vars is taken from the INSTALL file
+for texvar in AFMFONTS BIBINPUTS BSTINPUTS DVILJFONTS DVIPSFONTS \
+ DVIPSHEADERS GFFONTS GLYPHFONTS INDEXSTYLE MFBASES MFINPUTS \
+ MFPOOL MFTINPUTS MPINPUTS MPMEMS MPPOOL MPSUPPORT OCPINPUTS \
+ OFMFONTS OPLFONTS OTPINPUTS OVFFONTS OVPFONTS PKFONTS PSHEADERS \
+ T1FONTS T1INPUTS TEXBIB TEXCONFIG TEXDOCS TEXFONTMAPS TEXFONTS \
+ TEXFORMATS TEXINDEXSTYLE TEXINPUTS TEXMFCNF TEXMFDBS TEXMFINI \
+ TEXPICTS TEXPKS TEXPOOL TEXPSHEADERS TEXSOURCES TFMFONTS TRFONTS \
+ VFFONTS XDVIFONTS XDVIVFS ; do
+
+ if [ "${!texvar}" ]; then
+ if ! $(echo ${!texvar} | grep '^:\|::\|:$' &>/dev/null) ; then
+ export ${texvar}="${!texvar}:"
+ fi
+ fi
+done
+
+if [ "$TEXINPUTS" ]; then
+ if $(echo ${TEXINPUTS} | grep '@GENTOO_PORTAGE_EPREFIX@/usr/share/texmf' &>/dev/null) ; then
+ export TEXINPUTS=$(echo ${TEXINPUTS} | sed -e 's|@GENTOO_PORTAGE_EPREFIX@/usr/share/texmf/*:\?||g')
+ elif $(echo ${TEXINPUTS} | grep '@GENTOO_PORTAGE_EPREFIX@/var/lib/texmf' &>/dev/null) ; then
+ export TEXINPUTS=$(echo ${TEXINPUTS} | sed -e 's|@GENTOO_PORTAGE_EPREFIX@/var/lib/texmf/*:\?||g')
+ fi
+fi
+
+MKTEMP_COMMAND="mktemp -t tmp.XXXXXXXXXX"
+DIFF_COMMAND="cmp -s"
+TEMP_FILE="`${MKTEMP_COMMAND}`"
+
+if [ -z "${TEMP_FILE}" ]; then
+ exit
+fi
+
+# check whether config files for fmtutil and updmap have changed
+STATUS_FMTUTIL="0"
+STATUS_UPDMAP="0"
+
+if [ -d "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/texmf.d ]; then
+ echo "Generating @GENTOO_PORTAGE_EPREFIX@/etc/texmf/web2c/texmf.cnf from @GENTOO_PORTAGE_EPREFIX@/etc/texmf/texmf.d ..."
+ cat "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/texmf.d/*.cnf > "@GENTOO_PORTAGE_EPREFIX@/etc/texmf/web2c/texmf.cnf"
+fi
+
+if [ -d "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/fmtutil.d ]; then
+ echo "Generating @GENTOO_PORTAGE_EPREFIX@/etc/texmf/web2c/fmtutil.cnf from @GENTOO_PORTAGE_EPREFIX@/etc/texmf/fmtutil.d ..."
+ if [ -f "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/web2c/fmtutil.cnf ]; then
+ cp -f "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/web2c/fmtutil.cnf ${TEMP_FILE}
+ else
+ touch ${TEMP_FILE}
+ fi
+ cat "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/fmtutil.d/*.cnf > "@GENTOO_PORTAGE_EPREFIX@/etc/texmf/web2c/fmtutil.cnf"
+ ${DIFF_COMMAND} "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/web2c/fmtutil.cnf ${TEMP_FILE}
+ STATUS_FMTUTIL="${STATUS_FMTUTIL}$?"
+else
+# if no regeneration took place:
+# always regenerate the formats to be on the safe side
+ STATUS_FMTUTIL="${STATUS_FMTUTIL}3"
+fi
+
+if [ -d "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/updmap.d ]; then
+ if [ -f "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/web2c/updmap.cfg ]; then
+ cp -f "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/web2c/updmap.cfg ${TEMP_FILE}
+ else
+ touch ${TEMP_FILE}
+ fi
+ echo "Generating @GENTOO_PORTAGE_EPREFIX@/etc/texmf/web2c/updmap.cfg from @GENTOO_PORTAGE_EPREFIX@/etc/texmf/updmap.d ..."
+ cat "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/updmap.d/*.cfg > "@GENTOO_PORTAGE_EPREFIX@/etc/texmf/web2c/updmap.cfg"
+ ${DIFF_COMMAND} "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/web2c/updmap.cfg ${TEMP_FILE}
+ STATUS_UPDMAP="${STATUS_UPDMAP}$?"
+else
+# if no regeneration could be done:
+# always regenerate the maps to be on the safe side
+ STATUS_UPDMAP="${STATUS_UPDMAP}3"
+fi
+
+echo "Generating ls-R files"
+mktexlsr &>/dev/null
+
+# Generate language.dat file, from texlive install-pkg.sh
+X=`kpsewhich language.dat`
+Z=`dirname $X`
+if [ -n "$X" -a -f "$Z/language.dat" -a -f "$Z/language.us" ] ; then
+ echo "Generating language.dat file"
+
+ # Save the old one, we will check if it has changed
+ cp -f "$Z/language.dat" "${TEMP_FILE}"
+
+ cat "$Z/language.us" > "$Z/language.dat"
+ for i in "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/language.dat.d/language.*.dat; do
+ [ -f "$i" ] && cat "$i" >> "$Z/language.dat"
+ done
+
+ ${DIFF_COMMAND} "$Z/language.dat" "${TEMP_FILE}"
+ STATUS_FMTUTIL="${STATUS_FMTUTIL}$?"
+fi
+
+# Generate language.def file.
+if [ -n "$X" -a -f "$Z/language.def" -a -f "$Z/language.us.def" ] ; then
+ echo "Generating language.def file"
+
+ # Save the old one, we will check if it has changed
+ cp -f "$Z/language.def" "${TEMP_FILE}"
+
+ cat "$Z/language.us.def" > "$Z/language.def"
+ for i in "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/language.def.d/language.*.def; do
+ [ -f "$i" ] && cat "$i" >> "$Z/language.def"
+ done
+ cat << EOF >> "$Z/language.def"
+%%% No changes may be made beyond this point.
+
+\uselanguage {USenglish} %%% This MUST be the last line of the file.
+EOF
+
+ ${DIFF_COMMAND} "$Z/language.def" "${TEMP_FILE}"
+ STATUS_FMTUTIL="${STATUS_FMTUTIL}$?"
+fi
+
+# Generate language.dat.lua file.
+if [ -n "$X" -a -f "$Z/language.dat.lua" -a -f "$Z/language.us.lua" ] ; then
+ echo "Generating language.dat.lua file"
+
+ # Save the old one, we will check if it has changed
+ cp -f "$Z/language.dat.lua" "${TEMP_FILE}"
+
+ cat "$Z/language.us.lua" > "$Z/language.dat.lua"
+ for i in "@GENTOO_PORTAGE_EPREFIX@"/etc/texmf/language.dat.lua.d/language.*.dat.lua; do
+ [ -f "$i" ] && cat "$i" >> "$Z/language.dat.lua"
+ done
+ printf "}\n" >> "$Z/language.dat.lua"
+
+ ${DIFF_COMMAND} "$Z/language.dat.lua" "${TEMP_FILE}"
+ STATUS_FMTUTIL="${STATUS_FMTUTIL}$?"
+fi
+
+if [ "${STATUS_FMTUTIL}" -ne 0 ] ; then
+ echo "Generating format files ..."
+ fmtutil-sys --all &>/dev/null
+else
+ echo "Skipping format files, since they are unchanged"
+fi
+
+if [ "${STATUS_UPDMAP}" -ne 0 ] ; then
+ echo "Generating font maps..."
+ updmap-sys &>/dev/null
+else
+ echo "Skipping font maps, since they are unchanged"
+fi
+
+rm -f ${TEMP_FILE}
+
+echo
+echo "Use 'texconfig font ro'(rw) to disable (enable) font generation for users"
+echo
diff --git a/dev-libs/kpathsea/kpathsea-6.2.2_p20160523.ebuild b/dev-libs/kpathsea/kpathsea-6.2.2_p20160523.ebuild
new file mode 100644
index 000000000000..5b99104d2fe6
--- /dev/null
+++ b/dev-libs/kpathsea/kpathsea-6.2.2_p20160523.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit texlive-common eutils libtool prefix
+
+TEXMFD_VERSION="8"
+
+DESCRIPTION="Path searching library for TeX-related files"
+HOMEPAGE="http://tug.org/texlive/"
+SRC_URI="mirror://gentoo/texlive-${PV#*_p}-source.tar.xz
+ mirror://gentoo/${PN}-texmf.d-${TEXMFD_VERSION}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0/${PV%_p*}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc source static-libs"
+
+DEPEND="!<app-text/texlive-core-2013
+ !app-text/ptex"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/texlive-${PV#*_p}-source/texk/${PN}
+
+TL_VERSION=2016
+EXTRA_TL_MODULES="kpathsea"
+EXTRA_TL_DOC_MODULES="kpathsea.doc"
+
+for i in ${EXTRA_TL_MODULES} ; do
+ SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
+done
+
+SRC_URI="${SRC_URI} doc? ( "
+for i in ${EXTRA_TL_DOC_MODULES} ; do
+ SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
+done
+SRC_URI="${SRC_URI} ) "
+
+TEXMF_PATH=/usr/share/texmf-dist
+
+src_prepare() {
+ epatch "${FILESDIR}/insecure_tmp_mktexlsr.patch"
+ cd "${WORKDIR}/texlive-${PV#*_p}-source"
+ S="${WORKDIR}/texlive-${PV#*_p}-source" elibtoolize #sane .so versionning on gfbsd
+ cp "${FILESDIR}/texmf-update-r2" "${S}"/texmf-update
+ eprefixify "${S}"/texmf-update
+}
+
+src_configure() {
+ # Too many regexps use A-Z a-z constructs, what causes problems with locales
+ # that don't have the same alphabetical order than ascii. Bug #347798
+ # So we set LC_ALL to C in order to avoid problems.
+ export LC_ALL=C
+
+ # Disable largefile because it seems to cause problems on big endian 32 bits
+ # systems...
+ econf \
+ --disable-largefile \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ emake DESTDIR="${D}" web2cdir="${EPREFIX}/usr/share/texmf-dist/web2c" install
+ find "${D}" -name '*.la' -delete
+
+ dodir /usr/share # just in case
+ cp -pR "${WORKDIR}"/texmf-dist "${ED}/usr/share/" || die "failed to install texmf trees"
+ if use source ; then
+ cp -pR "${WORKDIR}"/tlpkg "${ED}/usr/share/" || die "failed to install tlpkg files"
+ fi
+
+ # The default configuration expects it to be world writable, bug #266680
+ # People can still change it with texconfig though.
+ dodir /var/cache/fonts
+ fperms 1777 /var/cache/fonts
+
+ # Take care of fmtutil.cnf and texmf.cnf
+ dodir /etc/texmf/{fmtutil.d,texmf.d}
+
+ # Remove default texmf.cnf to ship our own, greatly based on texlive dvd's
+ # texmf.cnf
+ # It will also be generated from /etc/texmf/texmf.d files by texmf-update
+ rm -f "${ED}${TEXMF_PATH}/web2c/texmf.cnf"
+
+ insinto /etc/texmf/texmf.d
+ doins "${WORKDIR}/texmf.d/"*.cnf
+
+ # Remove fmtutil.cnf, it will be regenerated from /etc/texmf/fmtutil.d files
+ # by texmf-update
+ rm -f "${ED}${TEXMF_PATH}/web2c/fmtutil.cnf"
+
+ dosym /etc/texmf/web2c/fmtutil.cnf ${TEXMF_PATH}/web2c/fmtutil.cnf
+ dosym /etc/texmf/web2c/texmf.cnf ${TEXMF_PATH}/web2c/texmf.cnf
+
+ newsbin "${S}/texmf-update" texmf-update
+
+ # Keep it as that's where the formats will go
+ keepdir /var/lib/texmf
+
+ dodoc ChangeLog NEWS PROJECTS README
+}
+
+pkg_postinst() {
+ etexmf-update
+}
+
+pkg_postrm() {
+ etexmf-update
+}
diff --git a/dev-libs/kpathsea/kpathsea-6.2.3_p20170524.ebuild b/dev-libs/kpathsea/kpathsea-6.2.3_p20170524.ebuild
new file mode 100644
index 000000000000..00ea871064cf
--- /dev/null
+++ b/dev-libs/kpathsea/kpathsea-6.2.3_p20170524.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit texlive-common eutils libtool prefix
+
+TEXMFD_VERSION="8"
+
+DESCRIPTION="Path searching library for TeX-related files"
+HOMEPAGE="http://tug.org/texlive/"
+SRC_URI="mirror://gentoo/texlive-${PV#*_p}-source.tar.xz
+ mirror://gentoo/${PN}-texmf.d-${TEXMFD_VERSION}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0/${PV%_p*}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc source static-libs"
+
+DEPEND="!<app-text/texlive-core-2013
+ !app-text/ptex"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/texlive-${PV#*_p}-source/texk/${PN}
+
+TL_VERSION=2017
+EXTRA_TL_MODULES="kpathsea"
+EXTRA_TL_DOC_MODULES="kpathsea.doc"
+
+for i in ${EXTRA_TL_MODULES} ; do
+ SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
+done
+
+SRC_URI="${SRC_URI} doc? ( "
+for i in ${EXTRA_TL_DOC_MODULES} ; do
+ SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${TL_VERSION}.tar.xz"
+done
+SRC_URI="${SRC_URI} ) "
+
+TEXMF_PATH=/usr/share/texmf-dist
+
+src_prepare() {
+ epatch "${FILESDIR}/insecure_tmp_mktexlsr.patch"
+ cd "${WORKDIR}/texlive-${PV#*_p}-source"
+ S="${WORKDIR}/texlive-${PV#*_p}-source" elibtoolize #sane .so versionning on gfbsd
+ cp "${FILESDIR}/texmf-update-r2" "${S}"/texmf-update
+ eprefixify "${S}"/texmf-update
+}
+
+src_configure() {
+ # Too many regexps use A-Z a-z constructs, what causes problems with locales
+ # that don't have the same alphabetical order than ascii. Bug #347798
+ # So we set LC_ALL to C in order to avoid problems.
+ export LC_ALL=C
+
+ # Disable largefile because it seems to cause problems on big endian 32 bits
+ # systems...
+ econf \
+ --disable-largefile \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ emake DESTDIR="${D}" web2cdir="${EPREFIX}/usr/share/texmf-dist/web2c" install
+ find "${D}" -name '*.la' -delete
+
+ dodir /usr/share # just in case
+ cp -pR "${WORKDIR}"/texmf-dist "${ED}/usr/share/" || die "failed to install texmf trees"
+ if use source ; then
+ cp -pR "${WORKDIR}"/tlpkg "${ED}/usr/share/" || die "failed to install tlpkg files"
+ fi
+
+ # The default configuration expects it to be world writable, bug #266680
+ # People can still change it with texconfig though.
+ dodir /var/cache/fonts
+ fperms 1777 /var/cache/fonts
+
+ # Take care of fmtutil.cnf and texmf.cnf
+ dodir /etc/texmf/{fmtutil.d,texmf.d}
+
+ # Remove default texmf.cnf to ship our own, greatly based on texlive dvd's
+ # texmf.cnf
+ # It will also be generated from /etc/texmf/texmf.d files by texmf-update
+ rm -f "${ED}${TEXMF_PATH}/web2c/texmf.cnf"
+
+ insinto /etc/texmf/texmf.d
+ doins "${WORKDIR}/texmf.d/"*.cnf
+
+ # Remove fmtutil.cnf, it will be regenerated from /etc/texmf/fmtutil.d files
+ # by texmf-update
+ rm -f "${ED}${TEXMF_PATH}/web2c/fmtutil.cnf"
+
+ dosym /etc/texmf/web2c/fmtutil.cnf ${TEXMF_PATH}/web2c/fmtutil.cnf
+ dosym /etc/texmf/web2c/texmf.cnf ${TEXMF_PATH}/web2c/texmf.cnf
+
+ newsbin "${S}/texmf-update" texmf-update
+
+ # Keep it as that's where the formats will go
+ keepdir /var/lib/texmf
+
+ dodoc ChangeLog NEWS PROJECTS README
+}
+
+pkg_postinst() {
+ etexmf-update
+}
+
+pkg_postrm() {
+ etexmf-update
+}
diff --git a/dev-libs/kpathsea/metadata.xml b/dev-libs/kpathsea/metadata.xml
new file mode 100644
index 000000000000..c4b55593420b
--- /dev/null
+++ b/dev-libs/kpathsea/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>aballier@gentoo.org</email>
+ <name>Alexis Ballier</name>
+ </maintainer>
+<maintainer type="project">
+ <email>tex@gentoo.org</email>
+ <name>Gentoo TeX Project</name>
+ </maintainer>
+</pkgmetadata>