Skip to content

Commit

Permalink
New package: texlive2019-exec
Browse files Browse the repository at this point in the history
  • Loading branch information
svenper committed Mar 13, 2020
1 parent c0810eb commit 873ed63
Show file tree
Hide file tree
Showing 16 changed files with 3,000 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/shlibs
Original file line number Diff line number Diff line change
Expand Up @@ -3556,6 +3556,11 @@ libsnore-qt5.so.0.7 snorenotify-0.7.0_1
libsnoresettings-qt5.so.0.7 snorenotify-0.7.0_1
libTECkit.so.0 libteckit-2.5.8_1
libTECkit_Compiler.so.0 libteckit-2.5.8_1
libkpathsea.so.6 texlive2019-exec-libkpathsea-2019_1
libptexenc.so.1 texlive2019-exec-libptexenc-2019_1
libsynctex.so.2 texlive2019-exec-libsynctex-2019_1
libtexluajit.so.2 texlive2019-exec-libtexlua-2019_1
libtexlua53.so.5 texlive2019-exec-libtexlua-2019_1
libwf-config.so.0 wf-config-0.3_1
libQt5Pas.so.1 qt5pas-2.6~beta_1
libClp.so.1 libClp-1.16.11_1
Expand Down
12 changes: 12 additions & 0 deletions srcpkgs/texlive/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Template file for 'texlive'
pkgname=texlive
version=2018
revision=1
build_style=meta
depends="texlive${version}-tlmgr"
short_desc="TeX Live distribution - metapackage"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2"
homepage="http://tug.org/texlive/"
provides="texlive-bin-${version}_${revision}"
replaces="texlive-bin>=0"
1 change: 1 addition & 0 deletions srcpkgs/texlive/update
10 changes: 10 additions & 0 deletions srcpkgs/texlive2019-exec/INSTALL.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
TeX Live provides many executables as scripts distributed via tlmgr.
These versions will be updated more frequently, so are therefore
preferred. That means that this package can contain symlinks
pointing to nothing. This shouldn't be a problem, but you may get a
warning about a file not being found when you launch one of these
programs. Just install it from tlmgr and everything should work.

You can switch library versions with xbps-alternatives for:
kpathsea, ptexenc, synctex, texlua52, texluajit. This is advisable
when upgrading to a new yearly release.
179 changes: 179 additions & 0 deletions srcpkgs/texlive2019-exec/files/generate-texlive-pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
#!/bin/sh -v

# TODO: look into TL_BUILD_ENV

AVAILABLE_PLATFORM="$(uname -m)-linux";

# TODO: e.g. 'tlmgr info fontools' will fail with something like
# 'cannot find depending package ... fontools.custom ... etc.'
# BUT this can be worked around with replacing the binaries in e.g. x86_64-linux
# with those from x86_64-musl.
# There should be a less hacky way to do this. What effect does the
# xbps installation script have?
# Further investigation shows that editing the line "
# depend setting_available_architectures:x86_64-linux
# " will allow the info operations, but also mess up if installing packages.
# We change it temporarily.
# requires root

# TODO: add build option conditionals around xindy, asymptote, etc.

sed -Ei '/depend[[:space:]]+setting_platform.*:/d' $(kpsewhich --expand-var '$TEXMFDIST')/../tlpkg/texlive.tlpdb
sed -Ei '/depend[[:space:]]+setting_available_architectures.*:/s/custom/'${AVAILABLE_PLATFORM}'\ndepend setting_platform:'${AVAILABLE_PLATFORM}'/g' $(kpsewhich --expand-var '$TEXMFDIST')/../tlpkg/texlive.tlpdb

TEMPLATE="/tmp/template"
YEAR="2019"

# ketcindy has no binaries
PACKAGES_EXCLUDE="ketcindy" # separate packages by |

# ALL_PACKAGES="asymptote dvisvgm dvipos uptex xindy"
ALL_PACKAGES="$(
tlmgr search --global --all "${AVAILABLE_PLATFORM}" 2>/dev/null |
grep -v linuxmusl |
grep -E '\.'"${AVAILABLE_PLATFORM}": |
sed s/'\.'"${AVAILABLE_PLATFORM}"://g |
grep -Ev "${PACKAGES_EXCLUDE}|placeholder_never_match_blank_$(head -c 16 /dev/urandom | xxd -p)"
)"

ALL_COLLECTIONS="collection-basic collection-latex $(
for texcollectionpkg in $(echo ${ALL_PACKAGES} | tr '\n' ' '); do
tlmgr info ${texcollectionpkg} 2>/dev/null |
grep -e ^package: -e ^collection: |
awk '{print $2}' |
tac |
tr '\n' ' ' | tee /dev/tty
echo
done | grep -v '^[^ ]*$' | grep '^collection-' | awk '{print $1}' | sort | uniq
)"

ALL_SCHEMES="scheme-infraonly scheme-minimal scheme-basic scheme-small
scheme-medium scheme-full"

sed --version 2>&1 | grep --quiet GNU &&
sed -i '/^[[:space:]]*\# EVERYTHING AFTER THIS LINE SHOULD BE AUTOMATICALLY GENERATED[[:space:]]*$/q' ${TEMPLATE} ||
(echo Error: GNU sed needed; exit 1)

generate() {
PACKAGE_TYPE="${1}"
PACKAGES="${2}"
# These two are only harmful if used sloppily (i.e. assuming it is empty and using it anyway).
# It should be safe if used in cases.
FILES=""
WORTHWHILE_DEPENDENCIES=""
case "${PACKAGE_TYPE}" in
collection)
SCAN_TYPES="${ALL_PACKAGES}" ;;
scheme)
SCAN_TYPES="${ALL_PACKAGES} ${ALL_COLLECTIONS}" ;;
esac
for PACKAGE in ${PACKAGES}; do
DESCRIPTION="$(tlmgr info --data shortdesc ${PACKAGE} 2>/dev/null |
sed -E 's:\\([^"'\'']):\\\\\1:g' |
sed -E 's|^"(.*)"$|\1|g' |
sed -E 's/^([Aa]n?|[Tt]he) //g' |
sed -E 's|Command line application to ||g' |
sed -E 's|Scalable Vector Graphics format \(SVG\)|SVG|g' |
sed -E 's|that enables transformations of|to transform|g' |
sed -E 's|Japanese/Chinese/Korean|CJK|g' |
sed -E 's|Pass verbatim contents through a compiler|Compile verbatim contents|g' |
awk '{for(i=1;i<=1;i++){ $i=toupper(substr($i,1,1)) substr($i,2) }}1' |
sed -E -e 's|^(Mpost)|""mpost|g' -e 's|^(PLaTeX)|""pLaTeX|g' -e 's|^(Tlcockpit)|""tlcockpit|g' -e 's|^(Tlshell)|""tlshell|g'
)"
: ${DESCRIPTION:="\"\"${PACKAGE}"}
case ${PACKAGE_TYPE} in
package)
FILES="$(tlmgr info --list ${PACKAGE}.${AVAILABLE_PLATFORM} 2>/dev/null |
grep 'bin/' |
sed -E 's|.*bin/'${AVAILABLE_PLATFORM}'/(.*)|\1|g' |
grep -Ev -e '^(teckit_compile|xindy\.run|man)$' | # teckit_compile is from teckit, xindy.run is N/A for native clisp
tr '\n' ' ' |
sed -E 's|[[:space:]]+$||g')"
cat << EOF | tee -a ${TEMPLATE}
$(case ${PACKAGE} in
# this line must be changed at more places in the document due to case not accepting variables?
asymptote|dvisvgm|xetex|xindy)
echo -n "if [ \"\${build_option_${PACKAGE}}\" ]; then" ;;
esac)
texlive${YEAR}-exec-${PACKAGE}_package() {$(case ${PACKAGE} in
kpathsea | tetex) echo -n '';;
texlive.infra) echo '\n\t'depends=\"wget xz\";;
amstex | cslatex | csplain | eplain | jadetex | latex-bin | mex | mltex | texsis | xmltex) echo '\n\t'depends=\"\${sourcepkg}-pdftex\";;
asymptote) echo '\n\t'depends=\"\${sourcepkg} python-tkinter python-Pillow\";;
biber) echo '\n\t'depends=\"biber\"
echo '\t'build_style=\"meta\";;
dvipdfmx) echo '\n\t'depends=\"\${sourcepkg}-xetex\";;
lollipop) echo '\n\t'depends=\"\${sourcepkg}-tex\";;
platex) echo '\n\t'depends=\"\${sourcepkg}-ptex\";;
uplatex) echo '\n\t'depends=\"\${sourcepkg}-uptex\";;
xetex) echo '\n\t'depends=\"\${sourcepkg} teckit\";;
xindy) echo '\n\t'depends=\"\${sourcepkg} clisp\";;
*) echo '\n\t'depends=\"\${sourcepkg}\";;
esac)
short_desc="${DESCRIPTION}"
pkg_install() {
for _file in ${FILES}; do
vmove "\${_execdir}/\${_file}"$(case ${PACKAGE} in
biber) echo ' || true';;
esac); done
}
}
$(case ${PACKAGE} in
# this line must be changed at more places in the document due to case not accepting variables?
asymptote|dvisvgm|xetex|xindy)
echo -n "fi" ;;
esac)
EOF
;;
collection | scheme)
DEPENDENCIES="$(
tlmgr info --list ${PACKAGE} 2>/dev/null |
grep '^[[:space:]]' |
sed -E 's|^[[:space:]]+||g' |
sed -E 's|[[:space:]]+$| |g' |
tr '\n' ' ')"
WORTHWHILE_DEPENDENCIES="$(
for DEPENDENCY in ${DEPENDENCIES}; do
echo ${SCAN_TYPES} |
tr ' ' '\n' |
grep --quiet "^${DEPENDENCY}$" &&
echo ${DEPENDENCY}
done | tr '\n' ' ')"
cat << EOF | tee -a ${TEMPLATE}
texlive${YEAR}-exec-${PACKAGE}_package() {
depends="$(
[ "${PACKAGE}" = "scheme-full" ] && WORTHWHILE_DEPENDENCIES="${ALL_COLLECTIONS}"
for DEPENDENCY in ${WORTHWHILE_DEPENDENCIES}; do
case ${DEPENDENCY} in
# this line must be changed at more places in the document due to case not accepting variables?
asymptote|dvisvgm|xetex|xindy)
echo -n "\$(vopt_if ${DEPENDENCY} \${sourcepkg}-${DEPENDENCY}) ";;
*)
echo -n "\${sourcepkg}-${DEPENDENCY} ";;
esac
done | sed 's/ $//g')"
short_desc="${DESCRIPTION}"
build_style="meta"
}
EOF
;;
esac
done
}

generate package "${ALL_PACKAGES}"
generate collection "${ALL_COLLECTIONS}"
generate scheme "${ALL_SCHEMES}"

chown "${SUDO_USER:-nobody}:${SUDO_USER:-nobody}" ${TEMPLATE}
chmod 644 ${TEMPLATE}

# requires root
sed -Ei '/depend[[:space:]]+setting_platform.*:/d' $(kpsewhich --expand-var '$TEXMFDIST')/../tlpkg/texlive.tlpdb
sed -Ei '/depend[[:space:]]+setting_available_architectures.*:/s/'${AVAILABLE_PLATFORM}'/custom/g' $(kpsewhich --expand-var '$TEXMFDIST')/../tlpkg/texlive.tlpdb

echo "${ALL_PACKAGES}"
echo "${ALL_COLLECTIONS}"
echo "${ALL_SCHEMES}"
143 changes: 143 additions & 0 deletions srcpkgs/texlive2019-exec/patches/dvisvgm-fix-missing-libs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
https://tug.org/pipermail/tlbuild/2018q3/004267.html

--- texk/dvisvgm/dvisvgm-src/libs/defs.am
+++ texk/dvisvgm/dvisvgm-src/libs/defs.am
@@ -1,19 +1,19 @@
if !HAVE_BROTLI
-BROTLI_CFLAGS += -I$(dvisvgm_srcdir)/libs/brotli/include
-BROTLI_LIBS += ../libs/brotli/libbrotli.a
+BROTLI_CFLAGS += -I/usr/include/brotli
+BROTLI_LIBS += -lbrotlicommon -lbrotlidec -lbrotlienc
endif

if !HAVE_POTRACE
-POTRACE_CFLAGS = -I$(dvisvgm_srcdir)/libs/potrace
-POTRACE_LIBS = ../libs/potrace/libpotrace.a
+POTRACE_CFLAGS = -I/usr/include
+POTRACE_LIBS = -lpotrace
endif

if !HAVE_WOFF2
-WOFF2_CFLAGS += -I$(dvisvgm_srcdir)/libs/woff2/include
-WOFF2_LIBS += ../libs/woff2/libwoff2.a
+WOFF2_CFLAGS += -I/usr/include/woff2
+WOFF2_LIBS += -lwoff2common -lwoff2dec -lwoff2enc
endif

if !HAVE_XXHASH
-XXHASH_CFLAGS = -I$(dvisvgm_srcdir)/libs/xxHash
-XXHASH_LIBS = ../libs/xxHash/libxxhash.a
+XXHASH_CFLAGS = -I/usr/include
+XXHASH_LIBS = -lxxhash
endif
--- texk/dvisvgm/dvisvgm-src/src/Makefile.am
+++ texk/dvisvgm/dvisvgm-src/src/Makefile.am
@@ -17,28 +17,28 @@ dvisvgm_LDADD = \
$(noinst_LIBRARIES) \
optimizer/liboptimizer.a \
../libs/clipper/libclipper.a \
- $(POTRACE_LIBS) \
- $(XXHASH_LIBS)
+ -lpotrace \
+ -lxxhash

if ENABLE_WOFF
dvisvgm_LDADD += \
- ../libs/ff-woff/libfontforge.a \
- $(WOFF2_LIBS) \
- $(BROTLI_LIBS)
+ -lfontforge \
+ -lwoff2enc -lwoff2dec -lwoff2common \
+ -lbrotlienc -lbrotlidec -lbrotlicommon
endif

if USE_BUNDLED_MD5
dvisvgm_LDADD += ../libs/md5/libmd5.a
else
-dvisvgm_LDADD += $(LIBCRYPTO_LIBS)
+dvisvgm_LDADD += -lcrypto
endif

dvisvgm_LDADD += \
$(KPATHSEA_LIBS) \
- $(FREETYPE2_LIBS) \
- $(FONTFORGE_LIBS) \
- $(ZLIB_LIBS) \
- $(LIBGS_LIBS)
+ -lfreetype \
+ -lfontforge \
+ -lz \
+ -lgs

dvisvgm_DEPENDENCIES = $(noinst_LIBRARIES)
dvisvgm_DEPENDENCIES += $(KPATHSEA_DEPEND) $(ZLIB_DEPEND) $(FREETYPE2_DEPEND)
@@ -205,9 +205,9 @@ AM_CXXFLAGS += \
$(WOFF2_CFLAGS)

if USE_BUNDLED_MD5
-AM_CXXFLAGS += -I$(dvisvgm_srcdir)/libs/md5
+AM_CXXFLAGS += -I/usr/include/openssl
else
-AM_CXXFLAGS += $(LIBCRYPTO_CFLAGS)
+AM_CXXFLAGS += -I/usr/include/openssl
endif

endif

--- texk/dvisvgm/dvisvgm-src/src/Makefile.in
+++ texk/dvisvgm/dvisvgm-src/src/Makefile.in
@@ -91,16 +91,16 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = dvisvgm$(EXEEXT)
@HAVE_BROTLI_FALSE@am__append_1 = -I$(dvisvgm_srcdir)/libs/brotli/include
-@HAVE_BROTLI_FALSE@am__append_2 = ../libs/brotli/libbrotli.a
+@HAVE_BROTLI_FALSE@am__append_2 = -lbrotlicommon -lbrotlidec -lbrotlienc
@HAVE_WOFF2_FALSE@am__append_3 = -I$(dvisvgm_srcdir)/libs/woff2/include
-@HAVE_WOFF2_FALSE@am__append_4 = ../libs/woff2/libwoff2.a
+@HAVE_WOFF2_FALSE@am__append_4 = -lwoff2common -lwoff2dec -lwoff2enc
@ENABLE_WOFF_TRUE@am__append_5 = \
-@ENABLE_WOFF_TRUE@ ../libs/ff-woff/libfontforge.a \
-@ENABLE_WOFF_TRUE@ $(WOFF2_LIBS) \
-@ENABLE_WOFF_TRUE@ $(BROTLI_LIBS)
+@ENABLE_WOFF_TRUE@ -lfontforge \
+@ENABLE_WOFF_TRUE@ -lwoff2common -lwoff2dec -lwoff2enc \
+@ENABLE_WOFF_TRUE@ -lbrotlicommon -lbrotlidec -lbrotlienc

-@USE_BUNDLED_MD5_TRUE@am__append_6 = ../libs/md5/libmd5.a
-@USE_BUNDLED_MD5_FALSE@am__append_7 = $(LIBCRYPTO_LIBS)
+@USE_BUNDLED_MD5_TRUE@am__append_6 = -lcrypto
+@USE_BUNDLED_MD5_FALSE@am__append_7 = -lcrypto
@ENABLE_WOFF_TRUE@am__append_8 = ffwrapper.c ffwrapper.h
@ENABLE_WOFF_TRUE@am__append_9 = \
@ENABLE_WOFF_TRUE@ -I$(dvisvgm_srcdir)/libs/ff-woff/fontforge \
@@ -111,7 +111,7 @@ bin_PROGRAMS = dvisvgm$(EXEEXT)
@ENABLE_WOFF_TRUE@ $(BROTLI_CFLAGS) \
@ENABLE_WOFF_TRUE@ $(WOFF2_CFLAGS)

-@ENABLE_WOFF_TRUE@@USE_BUNDLED_MD5_TRUE@am__append_12 = -I$(dvisvgm_srcdir)/libs/md5
+@ENABLE_WOFF_TRUE@@USE_BUNDLED_MD5_TRUE@am__append_12 = -I/usr/include/openssl
@ENABLE_WOFF_TRUE@@USE_BUNDLED_MD5_FALSE@am__append_13 = $(LIBCRYPTO_CFLAGS)
subdir = dvisvgm-src/src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -595,15 +595,15 @@ dvisvgm_SOURCES = \
CommandLine.hpp \
dvisvgm.cpp

-@HAVE_POTRACE_FALSE@POTRACE_CFLAGS = -I$(dvisvgm_srcdir)/libs/potrace
-@HAVE_POTRACE_FALSE@POTRACE_LIBS = ../libs/potrace/libpotrace.a
+@HAVE_POTRACE_FALSE@POTRACE_CFLAGS = -I/usr/include
+@HAVE_POTRACE_FALSE@POTRACE_LIBS = -lpotrace
@HAVE_XXHASH_FALSE@XXHASH_CFLAGS = -I$(dvisvgm_srcdir)/libs/xxHash
-@HAVE_XXHASH_FALSE@XXHASH_LIBS = ../libs/xxHash/libxxhash.a
+@HAVE_XXHASH_FALSE@XXHASH_LIBS = -lxxhash
dvisvgm_LDADD = $(noinst_LIBRARIES) optimizer/liboptimizer.a \
- ../libs/clipper/libclipper.a $(POTRACE_LIBS) $(XXHASH_LIBS) \
+ ../libs/clipper/libclipper.a -lpotrace -lxxhash \
$(am__append_5) $(am__append_6) $(am__append_7) \
- $(KPATHSEA_LIBS) $(FREETYPE2_LIBS) $(FONTFORGE_LIBS) \
- $(ZLIB_LIBS) $(LIBGS_LIBS)
+ $(KPATHSEA_LIBS) -lfreetype -lfontforge \
+ -lz -lgs
dvisvgm_DEPENDENCIES = $(noinst_LIBRARIES) $(KPATHSEA_DEPEND) \
$(ZLIB_DEPEND) $(FREETYPE2_DEPEND)
libdvisvgm_a_SOURCES = AGLTable.hpp BasicDVIReader.hpp \
Loading

0 comments on commit 873ed63

Please sign in to comment.