Browse Source

texlive-tlmgr: create a separate package and fix typo

Also simplify texlive/build.sh.

With this texlive-tlmgr can be updated without the need of bumping all of texlive.
android-5
Henrik Grimler 7 years ago
committed by Fredrik Fornwall
parent
commit
f38cc719ed
  1. 2
      packages/texlive-tlmgr/TLConfig.pm.patch
  2. 2
      packages/texlive-tlmgr/TLUtils.pm.patch
  3. 68
      packages/texlive-tlmgr/build.sh
  4. 0
      packages/texlive-tlmgr/texlive.tlpdb
  5. 62
      packages/texlive/build.sh
  6. 2
      packages/texlive/fmtutil.cnf.patch
  7. 10
      packages/texlive/texlive-tlmgr.subpackage.sh

2
packages/texlive/TLConfig.pm.patch → packages/texlive-tlmgr/TLConfig.pm.patch

@ -1,4 +1,4 @@
--- src/texlive-20180414-extra/tlpkg/TeXLive/TLConfig.pm 2016-04-21 19:08:52.000000000 +0000
--- src/tlpkg/TeXLive/TLConfig.pm 2016-04-21 19:08:52.000000000 +0000
+++ ../TLConfig.pm 2017-05-30 13:18:48.030712610 +0000
@@ -165,13 +165,13 @@
[ "b", 1, "postcode",

2
packages/texlive/TLUtils.pm.patch → packages/texlive-tlmgr/TLUtils.pm.patch

@ -1,4 +1,4 @@
--- src/texlive-20180414-extra/tlpkg/TeXLive/TLUtils.pm 2016-05-16 00:33:33.000000000 +0000
--- src/tlpkg/TeXLive/TLUtils.pm 2016-05-16 00:33:33.000000000 +0000
+++ ../TLUtils.pm 2017-05-30 14:09:38.505466432 +0000
@@ -228,7 +228,7 @@
# We cannot rely on #! in config.guess but have to call /bin/sh

68
packages/texlive-tlmgr/build.sh

@ -0,0 +1,68 @@
TERMUX_PKG_DESCRIPTION="TeX Lives package manager"
TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
TERMUX_PKG_VERSION=20180414
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL="ftp://ftp.tug.org/texlive/historic/${TERMUX_PKG_VERSION:0:4}/install-tl-unx.tar.gz"
TERMUX_PKG_SHA256="82c13110852af162c4c5ef1579fa2f4f51c2040850ec02fb7f97497da45eb446"
TERMUX_PKG_DEPENDS="perl, wget, gnupg2, xz-utils, texlive"
TERMUX_PKG_CONFFILES="share/texlive/tlpkg/texlive.tlpdb"
TERMUX_PKG_CONFLICTS="texlive (<< 20180414-1)"
TERMUX_PKG_PLATFORM_INDEPENDENT=yes
TERMUX_PKG_FOLDERNAME=install-tl-$TERMUX_PKG_VERSION
TL_ROOT=$TERMUX_PREFIX/share/texlive
TL_BINDIR=$TERMUX_PREFIX/bin
termux_step_make () {
mkdir -p $TL_ROOT/{tlpkg/{backups,tlpobj},texmf-var/web2c}
cp -r $TERMUX_PKG_SRCDIR/* $TL_ROOT/
cp $TERMUX_PKG_BUILDER_DIR/texlive.tlpdb $TL_ROOT/tlpkg/
}
termux_step_post_make_install () {
# Replace tlmgr link with a small wrapper that prevents error on "tlmgr update --self"
rm -rf $TL_BINDIR/tlmgr
ln -sf ../share/texlive/texmf-dist/scripts/texlive/tlmgr.pl $TL_BINDIR/tlmgr.ln
echo "#!$TERMUX_PREFIX/bin/sh" > $TL_BINDIR/tlmgr
echo "termux-fix-shebang $TL_ROOT/texmf-dist/scripts/texlive/tlmgr.pl" >> $TL_BINDIR/tlmgr
echo "sed -i 's%\`kpsewhich -var-value=SELFAUTOPARENT\`);%\`kpsewhich -var-value=TEXMFROOT\`);%g' $TL_ROOT/texmf-dist/scripts/texlive/tlmgr.pl" >> $TL_BINDIR/tlmgr
echo "sed -i 's%TEXMFROOT = \$SELFAUTOPARENT%TEXMFROOT = \$SELFAUTODIR/share/texlive%g' $TL_ROOT/texmf-dist/web2c/texmf.cnf" >> $TL_BINDIR/tlmgr
echo "sed -i '"'s@`/bin/sh@`'$TERMUX_PREFIX"/bin/sh@g' ${TL_ROOT}/tlpkg/TeXLive/TLUtils.pm" >> $TL_BINDIR/tlmgr
echo 'tlmgr.ln "$@"' >> $TL_BINDIR/tlmgr
chmod 0744 $TL_BINDIR/tlmgr
}
termux_step_create_debscripts () {
echo "#!$TERMUX_PREFIX/bin/bash" > postinst
echo "mkdir -p $TL_ROOT/{tlpkg/{backups,tlpobj},texmf-var/{web2c,tex/generic/config}}" >> postinst
echo "export TMPDIR=$TERMUX_PREFIX/tmp" >> postinst
echo "echo Updating tlmgr" >> postinst
echo "tlmgr update --self" >> postinst
echo "echo Generating language files and setting up symlinks" >> postinst
echo "tlmgr -q generate language" >> postinst
echo "exit 0" >> postinst
chmod 0755 postinst
# Don't remove installed stuff on removal, do that in the pkg texlive instead.
}
TERMUX_PKG_RM_AFTER_INSTALL="
share/texlive/LICENSE.TL
share/texlive/LICENSE.CTAN
share/texlive/release-texlive.txt
share/texlive/install-tl
share/texlive/texmf-dist/scripts/texlive/uninstall-win32.pl
share/texlive/texmf-dist/scripts/texlive/tlmgr-gui.pl
share/texlive/texmf-dist/web2c
share/texlive/tlpkg/installer/COPYING.MinGW-runtime.txt
share/texlive/tlpkg/installer/ctan-mirrors.pl
share/texlive/tlpkg/installer/install-menu-perltk.pl
share/texlive/tlpkg/installer/install-menu-text.pl
share/texlive/tlpkg/installer/install-menu-wizard.pl
share/texlive/tlpkg/installer/install-tl.html
share/texlive/tlpkg/installer/installer-options.txt
share/texlive/tlpkg/installer/texlive.png
share/texlive/tlpkg/installer/tl-cmd.bat
share/texlive/tlpkg/installer/tl-tray-menu.ini
share/texlive/tlpkg/installer/tracked-install.pl
share/texlive/tlpkg/installer/wget
share/texlive/tlpkg/installer/xz"

0
packages/texlive/texlive.tlpdb → packages/texlive-tlmgr/texlive.tlpdb

62
packages/texlive/build.sh

@ -3,24 +3,16 @@ TERMUX_PKG_DESCRIPTION="TeX Live is a distribution of the TeX typesetting system
TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
_MAJOR_VERSION=20180414
TERMUX_PKG_VERSION=${_MAJOR_VERSION}
TERMUX_PKG_SRCURL=("ftp://ftp.tug.org/texlive/historic/${TERMUX_PKG_VERSION:0:4}/"\
{"texlive-$_MAJOR_VERSION-texmf.tar.xz",\
"texlive-$_MAJOR_VERSION-extra.tar.xz",\
"install-tl-unx.tar.gz"})
TERMUX_PKG_SHA256=("bae2fa05ea1858b489f8138bea855c6d65829cf595c1fb219c5d65f4fe8b1fad"
"5b4397854723405f20df7172e73a04cee2d3ab712f78b064a7f523d6ab9f0329"
"82c13110852af162c4c5ef1579fa2f4f51c2040850ec02fb7f97497da45eb446")
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL="ftp://ftp.tug.org/texlive/historic/${TERMUX_PKG_VERSION:0:4}/texlive-$_MAJOR_VERSION-texmf.tar.xz"
TERMUX_PKG_SHA256="bae2fa05ea1858b489f8138bea855c6d65829cf595c1fb219c5d65f4fe8b1fad"
TERMUX_PKG_DEPENDS="perl, texlive-bin (>= 20180414)"
TERMUX_PKG_CONFLICTS="texlive (<< 20170524-5), texlive-bin (<< 20180414)"
TERMUX_PKG_RECOMMENDS="texlive-tlmgr"
TERMUX_PKG_FOLDERNAME=("texlive-$_MAJOR_VERSION-texmf"
"texlive-$_MAJOR_VERSION-extra"
"install-tl-$_MAJOR_VERSION")
TL_FILE_LISTS=("texlive-texmf.list"
"texlive-extra.list"
"install-tl.list")
TERMUX_PKG_FOLDERNAME="texlive-$_MAJOR_VERSION-texmf"
TERMUX_PKG_PLATFORM_INDEPENDENT=yes
TL_FILE_LISTS="texlive-texmf.list"
TL_ROOT=$TERMUX_PREFIX/share/texlive
TL_BINDIR=$TERMUX_PREFIX/bin
@ -28,41 +20,22 @@ termux_step_extract_package() {
mkdir -p "$TERMUX_PKG_SRCDIR"
cd "$TERMUX_PKG_TMPDIR"
for index in $(seq 0 2); do
local filename
filename=$(basename "${TERMUX_PKG_SRCURL[$index]}")
filename=$(basename "${TERMUX_PKG_SRCURL}")
local file="$TERMUX_PKG_CACHEDIR/$filename"
termux_download "${TERMUX_PKG_SRCURL[$index]}" "$file" "${TERMUX_PKG_SHA256[$index]}"
termux_download "${TERMUX_PKG_SRCURL}" "$file" "${TERMUX_PKG_SHA256}"
folder=${TERMUX_PKG_FOLDERNAME[$index]}
folder=${TERMUX_PKG_FOLDERNAME}
rm -Rf $folder
echo "Extracting files listed in ${TL_FILE_LISTS[$index]} from $folder"
tar xf "$file" $(paste -d'\0' <(for i in $(seq 1 $( wc -l < $TERMUX_PKG_BUILDER_DIR/${TL_FILE_LISTS[$index]} )); do echo ${TERMUX_PKG_FOLDERNAME[$index]}/; done ) $TERMUX_PKG_BUILDER_DIR/${TL_FILE_LISTS[$index]} )
done
cp -r ${TERMUX_PKG_FOLDERNAME[@]} "$TERMUX_PKG_SRCDIR"
echo "Extracting files listed in ${TL_FILE_LISTS} from $folder"
tar xf "$file" $(paste -d'\0' <(for i in $(seq 1 $( wc -l < $TERMUX_PKG_BUILDER_DIR/${TL_FILE_LISTS} )); do echo ${TERMUX_PKG_FOLDERNAME}/; done ) $TERMUX_PKG_BUILDER_DIR/${TL_FILE_LISTS} )
cp -r ${TERMUX_PKG_FOLDERNAME}/* "$TERMUX_PKG_SRCDIR"
}
termux_step_make() {
for index in $( seq 0 2 ); do
cp -r $TERMUX_PKG_SRCDIR/${TERMUX_PKG_FOLDERNAME[$index]}/* $TL_ROOT/
done
mkdir -p $TL_ROOT/{tlpkg/{backups,tlpobj},texmf-var/web2c}
cp $TERMUX_PKG_BUILDER_DIR/texlive.tlpdb $TL_ROOT/tlpkg/
cp -r $TERMUX_PKG_SRCDIR/* $TL_ROOT/
perl -I$TL_ROOT/tlpkg/ $TL_ROOT/texmf-dist/scripts/texlive/mktexlsr.pl $TL_ROOT/texmf-dist
# Replace tlmgr link with a small wrapper that prevents error on "tlmgr update --self"
rm -rf $TL_BINDIR/tlmgr
ln -sf ../share/texlive/texmf-dist/scripts/texlive/tlmgr.pl $TL_BINDIR/tlmgr.ln
echo "#!$TERMUX_PREFIX/bin/sh" > $TL_BINDIR/tlmgr
echo "termux-fix-shebang $TL_ROOT/texmf-dist/scripts/texlive/tlmgr.pl" >> $TL_BINDIR/tlmgr
echo "sed -i 's%\`kpsewhich -var-value=SELFAUTOPARENT\`);%\`kpsewhich -var-value=TEXMFROOT\`);%g' $TL_ROOT/texmf-dist/scripts/texlive/tlmgr.pl" >> $TL_BINDIR/tlmgr
echo "sed -i 's%TEXMFROOT = \$SELFAUTOPARENT%TEXMFROOT = \$SELFAUTODIR/share/texlive%gb' $TL_ROOT/texmf-dist/web2c/texmf.cnf" >> $TL_BINDIR/tlmgr
echo "sed -E -i '"'s@`/bin/sh@`'$TERMUX_PREFIX"/bin/sh@g' ${TL_ROOT}/tlpkg/TeXLive/TLUtils.pm" >> $TL_BINDIR/tlmgr
echo 'tlmgr.ln "$@"' >> $TL_BINDIR/tlmgr
chmod 0744 $TL_BINDIR/tlmgr
}
termux_step_create_debscripts () {
@ -73,12 +46,6 @@ termux_step_create_debscripts () {
chmod 0755 preinst
echo "#!$TERMUX_PREFIX/bin/bash" > postinst
echo "mkdir -p $TL_ROOT/{tlpkg/{backups,tlpobj},texmf-var/{web2c,tex/generic/config}}" >> postinst
echo "export TMPDIR=$TERMUX_PREFIX/tmp" >> postinst
echo "echo Updating tlmgr" >> postinst
echo "tlmgr update --self" >> postinst
echo "echo Generating language files and setting up symlinks" >> postinst
echo "tlmgr -q generate language" >> postinst
echo "mktexlsr $TL_ROOT/texmf-var" >> postinst
echo "texlinks" >> postinst
echo "echo ''" >> postinst
@ -103,7 +70,6 @@ termux_step_create_debscripts () {
chmod 0755 prerm
}
# Files to rm, first from texlive-$_MAJOR_VERSION-extra and then from install-tl-unx
TERMUX_PKG_RM_AFTER_INSTALL="
share/texlive/README
share/texlive/README.usergroups
@ -152,4 +118,6 @@ share/texlive/tlpkg/tlpostcode/ptex2pdf-tlpost.pl
share/texlive/texmf-dist/web2c/texmf.cnf
share/texlive/texmf-dist/scripts/texlive/fmtutil-user.sh
share/texlive/texmf-dist/scripts/texlive/rungs.tlu
share/texlive/texmf-dist/scripts/texlive/updmap-user.sh"
share/texlive/texmf-dist/scripts/texlive/updmap-user.sh
share/texlive/texmf-dist/scripts/texlive/tlmgr.pl
share/texlive/texmf-dist/scripts/texlive/tlmgrgui.pl"

2
packages/texlive/fmtutil.cnf.patch

@ -1,5 +1,5 @@
We've disabled luajittex when building the binaries, so lets prevent texlive from trying to generate formats for it.
--- src/texlive-20180414-texmf/texmf-dist/web2c/fmtutil.cnf 2016-05-15 01:17:09.000000000 +0000
--- src/texmf-dist/web2c/fmtutil.cnf 2016-05-15 01:17:09.000000000 +0000
+++ ../fmtutil.cnf 2017-05-31 05:20:32.516130878 +0000
@@ -82,7 +82,7 @@
# from luatex:

10
packages/texlive/texlive-tlmgr.subpackage.sh

@ -1,10 +0,0 @@
TERMUX_SUBPKG_DESCRIPTION="Texlive's package manager"
TERMUX_SUBPKG_DEPENDS="wget, xz-utils, gnupg2, sed"
TERMUX_SUBPKG_CONFFILES="share/texlive/tlpkg/texlive.tlpdb"
TERMUX_SUBPKG_CONFLICTS="texlive (<< 20180414)"
TERMUX_SUBPKG_INCLUDE="
share/texlive/texmf-dist/scripts/texlive/tlmgr.pl
share/texlive/texmf-dist/scripts/texlive/tlmgrgui.pl
share/texlive/tlpkg
bin/tlmgr.ln
bin/tlmgr"
Loading…
Cancel
Save