Files
haikuports/app-text/texlive/texlive-2021.recipe
Joachim Mairböck 1801479c90 texlive: split the package into multiple subpackages (#6229)
* texlive: split texlive_texmf into multiple subpackages (per collection)

There is one package for the runtime files, documentation and source files
for each TeXLive collection each. Packages that would be empty are omitted.
Additionaly, there are '_full' metapackages that depend on all the others.

The subpackage metadata and packageEntries are generated using perl scripts
that use the TeXLive package database API.

The package metadata is pre-generated because it needs already extracted and
preprocessed sources.

* texlive: fixes

 * change package descriptions to not contain the prefix "TeXLive" which is not allowed, being the package name
 * apply the $portDir workaround also for the PATCH function (see haikuporter issue #168)

* add missing config file to GLOBAL_WRITABLE_FILES

* remove the waiting on texlive's post-install scripts because it is not needed

* texlive: remove the alternate version of the createSubpackageInfos script

* texlive: add license header to the perl helper scripts
2022-03-26 17:55:40 +01:00

275 lines
10 KiB
Bash

SUMMARY="A comprehensive TeX system - texmf tree"
DESCRIPTION="TeX Live is an easy way to get up and running with the TeX \
document production system. It provides a comprehensive TeX system. It \
includes all the major TeX-related programs, macro packages, and fonts that \
are free software, including support for many languages around the world."
HOMEPAGE="http://tug.org/texlive/"
COPYRIGHT="1996 by collaboration between the TeX user groups."
LICENSE="GNU GPL v2"
REVISION="1"
fullVersion=20210325
SOURCE_URI="ftp://tug.org/historic/systems/texlive/$portVersion/install-tl-unx.tar.gz"
SOURCE_URI_2="ftp://tug.org/historic/systems/texlive/$portVersion/texlive-$fullVersion-texmf.tar.xz"
SOURCE_URI_3="ftp://tug.org/historic/systems/texlive/$portVersion/texlive-$fullVersion-extra.tar.xz"
CHECKSUM_SHA256="74eac0855e1e40c8db4f28b24ef354bd7263c1f76031bdc02b52156b572b7a1d"
CHECKSUM_SHA256_2="ff12d436c23e99fb30aad55924266104356847eb0238c193e839c150d9670f1c"
CHECKSUM_SHA256_3="46a3f385d0b30893eec6b39352135d2929ee19a0a81df2441bfcaa9f6c78339c"
SOURCE_DIR="install-tl-20210324"
SOURCE_DIR_2="texlive-$fullVersion-texmf"
SOURCE_DIR_3="texlive-$fullVersion-extra"
ADDITIONAL_FILES="
createSubpackageInfos.pl
getPackageEntries.pl
subpackageInfos.recipe
texlive.profile
texlive_postinstall.sh
texlive_update.sh
"
ARCHITECTURES="?any"
DISABLE_SOURCE_PACKAGE="yes"
PROVIDES="
texlive = $portVersion
cmd:texlive_update.sh
"
REQUIRES="
haiku
# this is a placeholder for the main texlive_core package
cmd:kpsewhich
"
SUMMARY_full="Metapackage for all TeXLive collections"
PROVIDES_full="
texlive_full = $portVersion
"
SUMMARY_full_doc="Metapackage for all TeXLive collections (documentation)"
PROVIDES_full_doc="
texlive_full_doc = $portVersion
"
SUMMARY_full_source="Metapackage for all TeXLive collections (source files)"
PROVIDES_full_source="
texlive_full_source = $portVersion
"
declare -a subpackages
# workaround for $portDir not being set correctly (or being empty)
# $workDir is not set when parsing recipes or during the PATCH function (outside the chroot), so use $portBaseDir instead.
# $portBaseDir can't be used when building the recipe because it points outside the chroot.
# In this case the (empty) $portDir is okay though.
if [ "${workDir-unset}" = unset -o "$recipeAction" = PATCH ]; then
portDir=$portBaseDir
fi
# note: this doesn't work (would need extracted and prepared sources already, after the BUILD function)
# $(perl -I $sourceDir/tlpkg $portDir/additional-files/createSubpackageInfos.pl $sourceDir)
# source the pregenerated subpackage infos instead
source $portDir/additional-files/subpackageInfos.recipe
BUILD_REQUIRES="
haiku_devel
cmd:kpsewhich
"
BUILD_PREREQUIRES="
cmd:perl
"
GLOBAL_WRITABLE_FILES="
settings/texlive/ls-R auto-merge
var/texlive/fonts/conf/texlive-fontconfig.conf auto-merge
var/texlive/ls-R auto-merge
var/texlive/tex/generic/config/language.dat auto-merge
var/texlive/tex/generic/config/language.dat.lua auto-merge
var/texlive/tex/generic/config/language.def auto-merge
var/texlive/web2c/aleph/aleph.fmt
var/texlive/web2c/aleph/aleph.log
var/texlive/web2c/eptex/eptex.fmt
var/texlive/web2c/eptex/eptex.log
var/texlive/web2c/eptex/platex-dev.fmt
var/texlive/web2c/eptex/platex-dev.log
var/texlive/web2c/eptex/platex.fmt
var/texlive/web2c/eptex/platex.log
var/texlive/web2c/euptex/euptex.fmt
var/texlive/web2c/euptex/euptex.log
var/texlive/web2c/euptex/uplatex-dev.fmt
var/texlive/web2c/euptex/uplatex-dev.log
var/texlive/web2c/euptex/uplatex.fmt
var/texlive/web2c/euptex/uplatex.log
var/texlive/web2c/luahbtex/luahbtex.fmt
var/texlive/web2c/luahbtex/luahbtex.log
var/texlive/web2c/luahbtex/lualatex-dev.fmt
var/texlive/web2c/luahbtex/lualatex-dev.log
var/texlive/web2c/luahbtex/lualatex.fmt
var/texlive/web2c/luahbtex/lualatex.log
var/texlive/web2c/luajithbtex/luajithbtex.fmt
var/texlive/web2c/luajithbtex/luajithbtex.log
var/texlive/web2c/luajittex/luajittex.fmt
var/texlive/web2c/luajittex/luajittex.log
var/texlive/web2c/luatex/dvilualatex-dev.fmt
var/texlive/web2c/luatex/dvilualatex-dev.log
var/texlive/web2c/luatex/dvilualatex.fmt
var/texlive/web2c/luatex/dvilualatex.log
var/texlive/web2c/luatex/dviluatex.fmt
var/texlive/web2c/luatex/dviluatex.log
var/texlive/web2c/luatex/luacsplain.fmt
var/texlive/web2c/luatex/luacsplain.log
var/texlive/web2c/luatex/luatex.fmt
var/texlive/web2c/luatex/luatex.log
var/texlive/web2c/luatex/optex.fmt
var/texlive/web2c/luatex/optex.log
var/texlive/web2c/luatex/pdfcsplain.fmt
var/texlive/web2c/luatex/pdfcsplain.log
var/texlive/web2c/metafont/mf.base
var/texlive/web2c/metafont/mf.log
var/texlive/web2c/pdftex/amstex.fmt
var/texlive/web2c/pdftex/amstex.log
var/texlive/web2c/pdftex/cont-en.fmt
var/texlive/web2c/pdftex/cont-en.log
var/texlive/web2c/pdftex/cslatex.fmt
var/texlive/web2c/pdftex/cslatex.log
var/texlive/web2c/pdftex/csplain.fmt
var/texlive/web2c/pdftex/csplain.log
var/texlive/web2c/pdftex/eplain.fmt
var/texlive/web2c/pdftex/eplain.log
var/texlive/web2c/pdftex/etex.fmt
var/texlive/web2c/pdftex/etex.log
var/texlive/web2c/pdftex/jadetex.fmt
var/texlive/web2c/pdftex/jadetex.log
var/texlive/web2c/pdftex/latex-dev.fmt
var/texlive/web2c/pdftex/latex-dev.log
var/texlive/web2c/pdftex/latex.fmt
var/texlive/web2c/pdftex/latex.log
var/texlive/web2c/pdftex/mex.fmt
var/texlive/web2c/pdftex/mex.log
var/texlive/web2c/pdftex/mllatex.fmt
var/texlive/web2c/pdftex/mllatex.log
var/texlive/web2c/pdftex/mltex.fmt
var/texlive/web2c/pdftex/mltex.log
var/texlive/web2c/pdftex/mptopdf.fmt
var/texlive/web2c/pdftex/mptopdf.log
var/texlive/web2c/pdftex/pdfcslatex.fmt
var/texlive/web2c/pdftex/pdfcslatex.log
var/texlive/web2c/pdftex/pdfcsplain.fmt
var/texlive/web2c/pdftex/pdfcsplain.log
var/texlive/web2c/pdftex/pdfetex.fmt
var/texlive/web2c/pdftex/pdfetex.log
var/texlive/web2c/pdftex/pdfjadetex.fmt
var/texlive/web2c/pdftex/pdfjadetex.log
var/texlive/web2c/pdftex/pdflatex-dev.fmt
var/texlive/web2c/pdftex/pdflatex-dev.log
var/texlive/web2c/pdftex/pdflatex.fmt
var/texlive/web2c/pdftex/pdflatex.log
var/texlive/web2c/pdftex/pdfmex.fmt
var/texlive/web2c/pdftex/pdfmex.log
var/texlive/web2c/pdftex/pdftex.fmt
var/texlive/web2c/pdftex/pdftex.log
var/texlive/web2c/pdftex/pdfxmltex.fmt
var/texlive/web2c/pdftex/pdfxmltex.log
var/texlive/web2c/pdftex/texsis.fmt
var/texlive/web2c/pdftex/texsis.log
var/texlive/web2c/pdftex/utf8mex.fmt
var/texlive/web2c/pdftex/utf8mex.log
var/texlive/web2c/pdftex/xmltex.fmt
var/texlive/web2c/pdftex/xmltex.log
var/texlive/web2c/ptex/ptex.fmt
var/texlive/web2c/ptex/ptex.log
var/texlive/web2c/tex/lollipop.fmt
var/texlive/web2c/tex/lollipop.log
var/texlive/web2c/tex/tex.fmt
var/texlive/web2c/tex/tex.log
var/texlive/web2c/uptex/uptex.fmt
var/texlive/web2c/uptex/uptex.log
var/texlive/web2c/xetex/cont-en.fmt
var/texlive/web2c/xetex/cont-en.log
var/texlive/web2c/xetex/pdfcsplain.fmt
var/texlive/web2c/xetex/pdfcsplain.log
var/texlive/web2c/xetex/xelatex-dev.fmt
var/texlive/web2c/xetex/xelatex-dev.log
var/texlive/web2c/xetex/xelatex.fmt
var/texlive/web2c/xetex/xelatex.log
var/texlive/web2c/xetex/xetex.fmt
var/texlive/web2c/xetex/xetex.log
"
PATCH() {
sed -i "s|\`kpsewhich -var-value=SELFAUTOPARENT\`|\"$dataDir/texlive\"|" $sourceDir/tlpkg/TeXLive/TLUtils.pm
sed -i "s|\`kpsewhich -var-value=FC_CACHEDIR\`|\"$sharedStateDir/texlive/fonts/cache\"|" $sourceDir3/tlpkg/tlpostcode/xetex.pl
sed -i "s|\`kpsewhich -var-value=FONTCONFIG_PATH\`|\"$sharedStateDir/texlive/fonts/conf\"|" $sourceDir3/tlpkg/tlpostcode/xetex.pl
}
BUILD()
{
# Put the texmf-dist into the correct location
rm -rv texmf-dist || true
ln -sv $sourceDir2/texmf-dist/ texmf-dist
# Link our binaries to bin/{i386,x86_64}-haiku
if [ $targetArchitecture = x86_gcc2 ] || [ $targetArchitecture = x86 ]; then
if [ ! -e bin/i386-haiku ] ; then
mkdir -pv bin
ln -sv /boot/system/bin bin/i386-haiku
fi
else
if [ ! -e bin/${targetArchitecture}-haiku ] ; then
mkdir -pv bin
ln -sv /boot/system/bin bin/${targetArchitecture}-haiku
fi
fi
# link or copy the needed files from the "extra" sources
rm -v tlpkg/{texlive.tlpdb,tlpostcode} readme-{html,txt}.dir README{,.usergroups} {index,doc}.html || true
ln -sv $sourceDir3/tlpkg/{texlive.tlpdb,tlpostcode} tlpkg
ln -sv $sourceDir3/readme-{html,txt}.dir .
cp -v $sourceDir3/{README{,.usergroups},{index,doc}.html} .
}
INSTALL()
{
export TEXLIVE_INSTALL_PREFIX=$dataDir/texlive
export TEXLIVE_INSTALL_TEXMFSYSVAR=$sharedStateDir/texlive
export TEXLIVE_INSTALL_TEXMFSYSCONFIG=$sysconfDir/texlive
export TEXLIVE_INSTALL_TEXMFLOCAL=/boot/system/non-packaged/data/texmf-dist
export TEXLIVE_INSTALL_TEXMFVAR=/boot/home/config/var/texmf
export TEXLIVE_INSTALL_TEXMFCONFIG=/boot/home/config/settings/texmf/config
export TEXLIVE_INSTALL_TEXMFHOME=/boot/home/config/settings
# hmm, need to work-around /boot/system/non-packaged not existing....
# the texfm local tree should probably be done with a post-install script, perhaps
sed -i -e 's/make_local_skeleton \".*//' install-tl
# run the TeX Live installer, and specify all our paths, once more, to be sure... ;-)
export PATH=bin/i386-haiku:bin/${targetArchitecture}-haiku:$binDir:$PATH
if [ $targetArchitecture = x86_gcc2 ] || [ $targetArchitecture = x86 ]; then
customBinDir=bin/i386-haiku/
else
customBinDir=bin/${targetArchitecture}-haiku/
fi
sed -e "s@dataDir@$dataDir@g" \
-e "s@sharedStateDir@$sharedStateDir@g" \
-e "s@sysconfDir@$sysconfDir@g" \
$portDir/additional-files/texlive.profile > texlive.profile
install-tl --custom-bin=$customBinDir --profile=texlive.profile
# somewhere along the way, a texmf.cnf gets created with ALL the wrong paths...
# replace it with the known working version from the main texlive_core package
cp -f /boot/system/data/texmf-dist/web2c/texmf.cnf $dataDir/texlive/texmf-dist/web2c/texmf.cnf
rm -rf $dataDir/texlive/bin
mkdir -p $binDir
install -t $binDir -m 755 $portDir/additional-files/texlive_update.sh
for subpackage in ${subpackages[@]}; do
packageEntries $subpackage \
$(perl -I $sourceDir/tlpkg $portDir/additional-files/getPackageEntries.pl $dataDir/texlive/ $subpackage)
if [[ $subpackage != *_* ]]; then # ignore subpackages with a suffix (doc or source)
mkdir -p $(getPackagePrefix $subpackage)/$relativePostInstallDir
install -t $(getPackagePrefix $subpackage)/$relativePostInstallDir \
-m 755 $portDir/additional-files/texlive_postinstall.sh
fi
done
}