public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* cygport patches for TeX Live
@ 2016-04-15 17:33 Ken Brown
  2016-04-17 19:13 ` Yaakov Selkowitz
  0 siblings, 1 reply; 19+ messages in thread
From: Ken Brown @ 2016-04-15 17:33 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

Yaakov,

I'm attaching three patches that I used in preparing the recent test 
release of the TeX Live collections.  The first is self-explanatory. 
The second and third reflect the fact that I'm now shipping .tlpobj 
files and maintaining /usr/share/tlpkg/texlive.tlpdb, so that tlmgr 
knows what collections and packages are installed.

Let me know if there are any questions.

Thanks.

Ken

[-- Attachment #2: 0001-prep_texlive-drop-preparation-for-fc-cache-calls.patch --]
[-- Type: text/plain, Size: 1094 bytes --]

From 457d553eb79130656d26656909da08f00d1c02c3 Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Fri, 11 Mar 2016 09:34:16 -0500
Subject: [PATCH 1/3] prep_texlive: drop preparation for fc-cache calls

This is now handled by a perpetual postinstall script in
libfontconfig1.
---
 lib/src_postinst.cygpart | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index 8c065c0..eca5b99 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -228,7 +228,7 @@ __prep_gtk_icon_theme() {
 #****
 
 __prep_texlive() {
-	local d fmt fmts format formats map maps
+	local fmt fmts format formats map maps
 	local markerdir=/var/lib/texmf/postinstall
 
 	dodir /etc/postinstall /etc/preremove ${markerdir}
@@ -278,16 +278,6 @@ __prep_texlive() {
 			_EOF
 		done
 	fi
-
-	for d in /usr/share/texmf-dist/fonts/{opentype,truetype,type1}
-	do
-		if [ -d ${D}${d} ]
-		then
-			cat >> ${D}${markerdir}/${PN}.fc <<-_EOF
-				${d}
-			_EOF
-		fi
-	done
 }
 
 #****P* Postinstall/X Sessions
-- 
2.8.0


[-- Attachment #3: 0002-texlive-update-for-tlmgr.patch --]
[-- Type: text/plain, Size: 2149 bytes --]

From 35274609cdcfb95f681b85a234fb079c90f39b1d Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Mon, 28 Mar 2016 16:30:33 -0400
Subject: [PATCH 2/3] texlive: update for tlmgr

---
 cygclass/texlive.cygclass |  7 ++++---
 lib/src_postinst.cygpart  | 25 ++++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/cygclass/texlive.cygclass b/cygclass/texlive.cygclass
index c1a2055..13f68fc 100644
--- a/cygclass/texlive.cygclass
+++ b/cygclass/texlive.cygclass
@@ -158,6 +158,8 @@ texlive_install() {
 	for pkg in $pkgs
 	do
 		tlpobj="tlpkg/tlpobj/$pkg.tlpobj"
+		insinto /usr/share/tlpkg/tlpobj
+		doins $tlpobj
 		for f in $(grep '^ ' $tlpobj)
 		do
 			case $f in
@@ -191,10 +193,9 @@ texlive_install() {
 				continue ;;
 			RELOC/*)
 				src=${f#RELOC/}; dst=texmf-dist/${src} ;;
-			texmf/*|texmf-dist/*|tlpkg/TeXLive/*) # used by updmap
+			texmf/*|texmf-dist/*|tlpkg/*)
 				src=$f; dst=$f ;;
-			*)	# we don't use tlmgr, so tlpkg files aren't used
-				continue ;;
+			*)	continue ;;
 			esac
 
 			if [ "$(head -c 2 $src)" = '#!' -o "$(head -c 4 $src)" = 'eval' ]
diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index eca5b99..e4b2eb3 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -228,7 +228,7 @@ __prep_gtk_icon_theme() {
 #****
 
 __prep_texlive() {
-	local fmt fmts format formats map maps
+	local fmt fmts format formats map maps tlp tlps
 	local markerdir=/var/lib/texmf/postinstall
 
 	dodir /etc/postinstall /etc/preremove ${markerdir}
@@ -278,6 +278,29 @@ __prep_texlive() {
 			_EOF
 		done
 	fi
+
+	if [ -d ${D}/usr/share/tlpkg/tlpobj ]
+	then
+		pushd ${D}/usr/share/tlpkg/tlpobj
+		tlps=$(ls *.tlpobj 2>/dev/null | sed -e 's/\.tlpobj//')
+		popd
+	fi
+	if [ -n "${tlps}" ]
+	then
+		cat >> ${D}/etc/preremove/${PN}.sh <<-_EOF
+			/usr/libexec/update_tlpdb remove \\
+		_EOF
+		for tlp in $tlps
+		do
+			cat >> ${D}/etc/preremove/${PN}.sh <<-_EOF
+				$tlp \\
+			_EOF
+			cat >> ${D}${markerdir}/${PN}.tlp <<-_EOF
+				$tlp
+			_EOF
+		done
+		echo >> ${D}/etc/preremove/${PN}.sh
+	fi
 }
 
 #****P* Postinstall/X Sessions
-- 
2.8.0


[-- Attachment #4: 0003-texlive-include-collection-.tlpobj-for-tlmgr.patch --]
[-- Type: text/plain, Size: 985 bytes --]

From 986f36ba20551fbb74a3ee585807944f30ca1f6e Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Sun, 10 Apr 2016 13:57:19 -0400
Subject: [PATCH 3/3] texlive: include collection .tlpobj for tlmgr

---
 cygclass/texlive.cygclass | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/cygclass/texlive.cygclass b/cygclass/texlive.cygclass
index 13f68fc..f67a627 100644
--- a/cygclass/texlive.cygclass
+++ b/cygclass/texlive.cygclass
@@ -58,10 +58,13 @@
 #  mirror instead of from stable release repository mirrors, which are frozen
 #  during the pretest phase.
 #****
-if ! defined TEXLIVE_TEXMF_PKGS && ! defined TEXLIVE_ARCH_PKGS && ! defined TEXLIVE_DOC_PKGS
-then
-	TEXLIVE_TEXMF_PKGS=${PN#texlive-}
-fi
+
+# For the sake of tlmgr we want to include the .tlpobj file for the
+# collection.
+case ${PN} in
+*-doc)	;;
+*)	TEXLIVE_TEXMF_PKGS+=" ${PN#texlive-}" ;;
+esac
 
 #****o* texlive.cygclass/CATEGORY (texlive)
 #  DEFINITION
-- 
2.8.0


^ permalink raw reply	[flat|nested] 19+ messages in thread
* cygport patches for TeX Live
@ 2014-12-16 22:49 Ken Brown
  2014-12-16 23:08 ` Ken Brown
  0 siblings, 1 reply; 19+ messages in thread
From: Ken Brown @ 2014-12-16 22:49 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

Now that setup.exe supports perpetual postinstall scripts, I'd like to 
streamline the TeX Live postinstall process.  I'm attaching two perpetual 
postinstall scripts that I'd like to use (one before the ordinary postinstall 
scripts and one after), as well as four cygport patches.

With these changes, I was able to reduce the total postinstall time for a 
complete TeX Live install from 48 minutes to 14 minutes on my system.

Here's a summary of the changes and the reasons for them.

1. The most time-consuming command in the current postinstall process is 
mktexlsr, which is run many times.  The proposed changes reduce this to one 
call, at the beginning; all remaining postinstall commands keep the ls-R files 
up to date at minimal cost.

2. Another somewhat time-consuming command is updmap.  Each call (even just to 
enable or disable a map) takes at least 2-3 seconds.  If several maps are 
enabled/disabled at once, there's no noticeable increase in time.  The proposed 
changes use just one call to updmap to enable all maps.

3. Similarly, there are a lot of unnecessary calls to fc-cache.  I've reduced 
that to a single call, at the end.

I'm open to suggestions as to better ways to do all this.

Ken

[-- Attachment #2: 0p_texlive_prep.sh --]
[-- Type: text/plain, Size: 409 bytes --]

postinstalldir=/etc/texmf/postinstall

for f in ${postinstalldir}/*.lsr
do
    if [ -f ${f} ]
    then
	/usr/bin/mktexlsr
	for g in ${postinstalldir}/*.lsr
	do
	    mv -f ${g} ${g}.done
	done
    fi
    break
done

if [ -f ${postinstalldir}/texlive.refresh_fmts ]
then
    /usr/bin/fmtutil-sys --refresh
    mv -f ${postinstalldir}/texlive.refresh_fmts \
       ${postinstalldir}/texlive.refresh_fmts.done
fi

[-- Attachment #3: 0001-prep_texlive-remove-references-to-usr-share-texmf.patch --]
[-- Type: text/plain, Size: 1096 bytes --]

From 408d371b734ab7295adfaf1d1ad9e4fa9481ce7c Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Tue, 25 Nov 2014 09:27:52 -0500
Subject: [PATCH 1/4] prep_texlive: remove references to /usr/share/texmf

This is no longer used as of TeX Live 2013.
---
 lib/src_postinst.cygpart | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index 9963b63..86870f5 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -371,7 +371,7 @@ __prep_texlive() {
 		_EOF
 	fi
 
-	for d in /usr/share/texmf{-dist,}/fonts/{opentype,truetype,type1}
+	for d in /usr/share/texmf-dist/fonts/{opentype,truetype,type1}
 	do
 		if [ -d ${D}${d} ]
 		then
@@ -655,14 +655,10 @@ __prepetc() {
 		__prep_freedesktop_mime || error "Shared Mime Info postinstall failed"
 	fi
 
-	for d in /usr/share/texmf{,-dist}
-	do
-		if [ -d ${D}${d} ]
-		then
-			__prep_texlive
-			break
-		fi
-	done
+	if [-d /usr/share/texmf-dist ]
+	then
+	    __prep_texlive
+	fi
 
 	if [ -d ${D}/usr/share/xsessions ]
 	then
-- 
2.1.1


[-- Attachment #4: 0002-prep_texlive-remove-calls-to-mktexlsr.patch --]
[-- Type: text/plain, Size: 1481 bytes --]

From 8b7624d5d064bc19c4a513592d0d559201c648c0 Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Wed, 26 Nov 2014 07:35:13 -0500
Subject: [PATCH 2/4] prep_texlive: remove calls to mktexlsr

Instead create a marker file in /etc/texmf/postinstall indicating that
mktexlsr should be run by a perpetual postinstall script.
---
 lib/src_postinst.cygpart | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index 86870f5..a769ffc 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -328,11 +328,9 @@ __prep_mateconf_schemas() {
 __prep_texlive() {
 	local d fmt fmts map maps
 
-	dodir /etc/postinstall /etc/preremove
+	dodir /etc/postinstall /etc/preremove /etc/texmf/postinstall
 
-	cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
-		/usr/bin/mktexlsr
-	_EOF
+	/usr/bin/touch /etc/texmf/postinstall/${PN}.lsr
 
 	fmts=$(__config_get texlive_fmts)
 	maps=$(__config_get texlive_maps)
@@ -351,7 +349,6 @@ __prep_texlive() {
 		cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
 			/usr/bin/updmap-sys --nohash --syncwithtrees
 			/usr/bin/updmap-sys --nohash
-			/usr/bin/mktexlsr
 		_EOF
 	fi
 	if [ -n "${fmts#0}" ]
@@ -366,9 +363,6 @@ __prep_texlive() {
 				/usr/bin/fmtutil-sys --disablefmt $fmt
 			_EOF
 		done
-		cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
-			/usr/bin/mktexlsr
-		_EOF
 	fi
 
 	for d in /usr/share/texmf-dist/fonts/{opentype,truetype,type1}
-- 
2.1.1


[-- Attachment #5: 0003-prep_texlive-remove-calls-to-fc-cache.patch --]
[-- Type: text/plain, Size: 848 bytes --]

From fdb63bef25522127109bbbf36a932fc825ec6172 Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Wed, 26 Nov 2014 07:53:29 -0500
Subject: [PATCH 3/4] prep_texlive: remove calls to fc-cache

Instead, create a file in /etc/texmf/postinstall listing the font
directories on which fc-cache should be run by a perpetual postinstall
script.
---
 lib/src_postinst.cygpart | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index a769ffc..5d915b1 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -369,8 +369,8 @@ __prep_texlive() {
 	do
 		if [ -d ${D}${d} ]
 		then
-			cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
-				/usr/bin/fc-cache -f $d
+			cat >> ${D}/etc/texmf/postinstall/${PN}.fc <<-_EOF
+				${d}
 			_EOF
 		fi
 	done
-- 
2.1.1


[-- Attachment #6: 0004-prep_texlive-group-enable-disable-commands-in-calls-.patch --]
[-- Type: text/plain, Size: 1586 bytes --]

From f642dfdbbb2ad47612ebb31cdd1b4e1372946daa Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Fri, 28 Nov 2014 10:47:49 -0500
Subject: [PATCH 4/4] prep_texlive: group enable/disable commands in calls to
 updmap

In postinstall scripts we remove the updmap calls completely and
instead create a file of commands in /etc/texmf/postinstall, to be run
by a perpetual postinstall script.  In preremove scripts we just group
the commands into a single call to updmap, since setup.exe doesn't yet
support perpetual preremove scripts.
---
 lib/src_postinst.cygpart | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index 5d915b1..818ccef 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -337,19 +337,19 @@ __prep_texlive() {
 
 	if [ -n "${maps#0}" ]
 	then
+		cat >> ${D}/etc/preremove/${PN}.sh <<-_EOF
+			/usr/bin/updmap-sys --nohash --nomkmap \\
+		_EOF
 		for map in $maps
 		do
-			cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
-				/usr/bin/updmap-sys --nohash --nomkmap --enable $map
-			_EOF
 			cat >> ${D}/etc/preremove/${PN}.sh <<-_EOF
-				/usr/bin/updmap-sys --nohash --nomkmap --disable ${map#*=}
+				--disable ${map#*=} \\
+			_EOF
+			cat >> ${D}/etc/texmf/postinstall/${PN}.map <<-_EOF
+				--enable $map
 			_EOF
 		done
-		cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF
-			/usr/bin/updmap-sys --nohash --syncwithtrees
-			/usr/bin/updmap-sys --nohash
-		_EOF
+		echo >> ${D}/etc/preremove/${PN}.sh
 	fi
 	if [ -n "${fmts#0}" ]
 	then
-- 
2.1.1


[-- Attachment #7: zp_texlive_finish.sh --]
[-- Type: text/plain, Size: 486 bytes --]

postinstalldir=/etc/texmf/postinstall

maps=$(cat ${postinstalldir}/*.map)
if [ -n "${maps}" ]
then
    /usr/bin/updmap-sys --nohash --nomkmap ${maps}
    for f in ${postinstalldir}/*.map
    do
	mv -f ${f} ${f}.done
    done
    echo y | /usr/bin/updmap-sys --syncwithtrees
    /usr/bin/updmap-sys
fi

fc_dirs=$(sort -u ${postinstalldir}/*.fc)
if [ -n "${fc_dirs}" ]
then
    /usr/bin/fc-cache -f ${fc_dirs}
    for f in ${postinstalldir}/*.fc
    do
	mv -f ${f} ${f}.done
    done
fi

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-04-17 19:13 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-15 17:33 cygport patches for TeX Live Ken Brown
2016-04-17 19:13 ` Yaakov Selkowitz
  -- strict thread matches above, loose matches on Subject: below --
2014-12-16 22:49 Ken Brown
2014-12-16 23:08 ` Ken Brown
2014-12-17 22:18   ` Ken Brown
2014-12-18  8:22     ` Achim Gratz
2014-12-18  9:40       ` Marco Atzeri
2014-12-18  9:41         ` Marco Atzeri
2014-12-18 11:09           ` Achim Gratz
2014-12-18 13:12       ` Ken Brown
2014-12-19 13:19         ` Ken Brown
2015-01-05  7:51         ` Yaakov Selkowitz
2015-01-05 17:04           ` Ken Brown
2015-01-05 17:52             ` Achim Gratz
2015-01-15 21:47               ` Ken Brown
2015-02-12  0:50                 ` Yaakov Selkowitz
2015-02-12  4:10                   ` Ken Brown
2015-02-12 11:58                     ` Ken Brown
2015-02-12 18:40                       ` Yaakov Selkowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).