From: rnauber Date: Thu, 19 Jan 2017 03:21:42 +0000 (+0100) Subject: Add a TexLive package (#621) X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/commitdiff_plain/cb2a32e4df48c5bc15b3f7aeb85ea8e87b53ad34?ds=sidebyside Add a TexLive package (#621) * Add a TexLive package * fix texlive installer * some polish for texlive * some more polish for texlive * texlive: automatically trigger (post-)installation * texlive: remove the bundled icu from the PR and polish some more... * texlive: fix hardcoded build tuple and use popplers xpdf --- diff --git a/packages/poppler/build.sh b/packages/poppler/build.sh index a885830d..1b7eb27d 100644 --- a/packages/poppler/build.sh +++ b/packages/poppler/build.sh @@ -4,4 +4,5 @@ TERMUX_PKG_VERSION=0.47.0 TERMUX_PKG_SRCURL=http://poppler.freedesktop.org/poppler-${TERMUX_PKG_VERSION}.tar.xz # libcairo and littlecms is used by pdftocairo: TERMUX_PKG_DEPENDS="fontconfig, libcairo, libpng, libjpeg-turbo, libtiff, littlecms, openjpeg" -TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-poppler-glib" +#texlive needs the xpdf headers +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-poppler-glib --enable-xpdf-headers" diff --git a/packages/texlive/build.sh b/packages/texlive/build.sh new file mode 100644 index 00000000..b8d25e29 --- /dev/null +++ b/packages/texlive/build.sh @@ -0,0 +1,55 @@ +TERMUX_PKG_HOMEPAGE=https://www.tug.org/texlive/ +TERMUX_PKG_DESCRIPTION="TeX Live is a distribution of the TeX typesetting system." +TERMUX_PKG_VERSION=20160523 +TERMUX_PKG_SRCURL=ftp://tug.org/historic/systems/texlive/${TERMUX_PKG_VERSION:0:4}/texlive-${TERMUX_PKG_VERSION}b-source.tar.xz +TERMUX_PKG_SHA256="a8b32ca47f0a403661a09e202f4567a995beb718c18d8f81ca6d76daa1da21ed" +TERMUX_PKG_DEPENDS="libpng,libgd,freetype,poppler,libluajit,libicu" +TERMUX_PKG_FOLDERNAME=texlive-${TERMUX_PKG_VERSION}-source +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="\ +AR=ar \ +RANLIB=ranlib \ +BUILDAR=ar \ +BUILDRANLIB=ranlib \ +--prefix=$TERMUX_PREFIX/local/texlive/${TERMUX_PKG_VERSION:0:4} \ +--bindir=$TERMUX_PREFIX/local/texlive/${TERMUX_PKG_VERSION:0:4}/bin/pkg \ +--libdir=$TERMUX_PREFIX/lib \ +--build=$TERMUX_BUILD_TUPLE \ +--disable-native-texlive-build \ +--without-x \ +--disable-multiplatform \ +--disable-dialog \ +--disable-psutils \ +--disable-t1utils \ +--disable-bibtexu \ +--disable-xz \ +--without-texinfo \ +--without-xdvipdfmx \ +--without-texi2html \ +--with-system-icu \ +--with-system-poppler \ +--with-system-gd \ +--with-system-luajit \ +--with-system-xpdf \ +--enable-luatex \ +--enable-ttfdump=no \ +--enable-makeindexk=no --enable-makejvf=no --enable-mendexk=no --enable-musixtnt=no --enable-ps2pk=no \ +--enable-seetexk=no --enable-gregorio=no \ +--with-banner-add=/termux \ + " + +termux_step_post_extract_package () { + rm -r $TERMUX_PKG_SRCDIR/utils/pmx +} + +termux_step_post_make_install () { + cp $TERMUX_PKG_BUILDER_DIR/termux-install-tl $TERMUX_PREFIX/bin + chmod +x $TERMUX_PREFIX/bin/termux-install-tl + sed -E -i "s@/bin/sh@$PREFIX/bin/sh@" "$TERMUX_PREFIX/local/texlive/${TERMUX_PKG_VERSION:0:4}/bin/pkg/tlmgr" +} + +termux_step_create_debscripts () { + echo 'echo "retrieving texlive..."' > postinst + echo "termux-install-tl" >> postinst + echo "exit 0" >> postinst + chmod 0755 postinst +} diff --git a/packages/texlive/dvipdfm-x_fix_getpass.patch b/packages/texlive/dvipdfm-x_fix_getpass.patch new file mode 100644 index 00000000..de58c388 --- /dev/null +++ b/packages/texlive/dvipdfm-x_fix_getpass.patch @@ -0,0 +1,22 @@ +--- src/texk/dvipdfm-x/pdfencrypt.h~ 2016-01-06 11:13:28.000000000 +0100 ++++ src/texk/dvipdfm-x/pdfencrypt.h 2016-12-31 11:13:43.734942973 +0100 +@@ -38,4 +38,19 @@ + unsigned char **cipher, size_t *cipher_len); + extern pdf_obj *pdf_encrypt_obj (void); + ++ ++#ifdef __ANDROID__ ++static char* getpass(const char* prompt) { ++ static char chars[128]; ++ int len = 0; ++ while (true) { ++ char c = fgetc(stdin); ++ if (c == '\r' || c == '\n' || c == 0) break; ++ chars[len++] = c; ++ if (len == sizeof(chars)-1) break; ++ } ++ chars[len] = 0; ++ return chars; ++} ++#endif + #endif /* _PDFENCRYPT_H_ */ diff --git a/packages/texlive/termux-install-tl b/packages/texlive/termux-install-tl new file mode 100644 index 00000000..f5b6a316 --- /dev/null +++ b/packages/texlive/termux-install-tl @@ -0,0 +1,60 @@ +export TMPDIR=$PREFIX/tmp/ +cd $TMPDIR + +wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz +tar xvzf install-tl-unx.tar.gz +cd install-tl-*/ + +#patch install-tl +sed -E -i "s@/bin/sh@$PREFIX/bin/sh@" tlpkg/TeXLive/TLUtils.pm + +cat >> texlive_inst.profile << XX + +selected_scheme scheme-custom +TEXDIR $PREFIX/local/texlive/2016 +TEXMFCONFIG ~/.texlive2016/texmf-config +TEXMFHOME ~/texmf +TEXMFLOCAL $PREFIX/local/texlive/texmf-local +TEXMFSYSCONFIG $PREFIX/local/texlive/2016/texmf-config +TEXMFSYSVAR $PREFIX/local/texlive/2016/texmf-var +TEXMFVAR ~/.texlive2016/texmf-var +collection-basic 1 +collection-latex 1 +collection-luatex 1 +in_place 0 +option_adjustrepo 1 +option_autobackup 1 +option_backupdir tlpkg/backups +option_desktop_integration 0 +option_doc 0 +option_file_assocs 0 +option_fmt 1 +option_letter 0 +option_menu_integration 1 +option_path 0 +option_post_code 1 +option_src 0 +option_sys_bin $PREFIX/bin +option_sys_info $PREFIX/local/share/info +option_sys_man $PREFIX/local/share/man +option_w32_multi_user 0 +option_write18_restricted 1 +portable 0 + +XX + +#start installer with a profile and premade binaries +perl ./install-tl --custom-bin=$PREFIX/local/texlive/2016/bin/pkg --profile texlive_inst.profile + +mkdir -p $PREFIX/etc/profile.d/ + +cat > $PREFIX/etc/profile.d/texlive.sh << XX +export PATH=$PATH:$PREFIX/local/texlive/2016/bin/custom +export TMPDIR=$PREFIX/tmp/ + +XX + +#fix tlpkg +sed -E -i "s@/bin/sh@$PREFIX/bin/sh@" $PREFIX/local/texlive/2016/tlpkg/TeXLive/TLUtils.pm + +texlinks diff --git a/packages/texlive/zziplib_disable_have_dirent.patch b/packages/texlive/zziplib_disable_have_dirent.patch new file mode 100644 index 00000000..d52e27a4 --- /dev/null +++ b/packages/texlive/zziplib_disable_have_dirent.patch @@ -0,0 +1,13 @@ +--- a/libs/zziplib/config.h.in 2013-09-09 10:31:11.000000000 +0200 ++++ l/libs/zziplib/config.h.in 2016-12-20 20:17:28.906466862 +0100 +@@ -12,9 +12,7 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_DIRECT_H + +-/* Define to 1 if you have the header file, and it defines `DIR'. +- */ +-#undef HAVE_DIRENT_H ++ + + /* Define to 1 if you have the header file. */ + #undef HAVE_FNMATCH_H