Browse Source

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
android-5
rnauber 8 years ago
committed by Fredrik Fornwall
parent
commit
cb2a32e4df
  1. 3
      packages/poppler/build.sh
  2. 55
      packages/texlive/build.sh
  3. 22
      packages/texlive/dvipdfm-x_fix_getpass.patch
  4. 60
      packages/texlive/termux-install-tl
  5. 13
      packages/texlive/zziplib_disable_have_dirent.patch

3
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 TERMUX_PKG_SRCURL=http://poppler.freedesktop.org/poppler-${TERMUX_PKG_VERSION}.tar.xz
# libcairo and littlecms is used by pdftocairo: # libcairo and littlecms is used by pdftocairo:
TERMUX_PKG_DEPENDS="fontconfig, libcairo, libpng, libjpeg-turbo, libtiff, littlecms, openjpeg" 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"

55
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
}

22
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_ */

60
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

13
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 <direct.h> header file. */
#undef HAVE_DIRECT_H
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
- */
-#undef HAVE_DIRENT_H
+
/* Define to 1 if you have the <fnmatch.h> header file. */
#undef HAVE_FNMATCH_H
Loading…
Cancel
Save