Merge remote-tracking branch 'up/master' into master-riscv64

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
This commit is contained in:
David Abdurachmanov 2020-01-17 18:49:21 +02:00
commit d2931c6ebd
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
3 changed files with 205 additions and 6 deletions

View File

@ -0,0 +1,84 @@
diff -up ./scripts/latex-papersize/latex-papersize.py.py3 ./scripts/latex-papersize/latex-papersize.py
--- ./scripts/latex-papersize/latex-papersize.py.py3 2016-10-17 17:30:47.000000000 -0400
+++ ./scripts/latex-papersize/latex-papersize.py 2019-12-14 03:02:45.000000000 -0500
@@ -1,7 +1,7 @@
#!/usr/bin/env python
r"""
Calculate LaTeX paper and margin settings for arbitrary magnification
-(C) Silas S. Brown, 2005-2009, 2016. Version 1.62.
+(C) Silas S. Brown, 2005-2009, 2016, 2019. Version 1.63.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@ are often meant to be clearer.
This is a Python script to calculate the necessary
settings for arbitrary font and page sizes.
+Works in both Python 2 and Python 3.
BASIC USAGE
@@ -151,11 +152,16 @@ To run dvips on the .dvi file (not neede
$(python latex-papersize.py 12 26 file.dvi)
"""
-import os, sys, math, commands
+import os, sys, math
+try: from commands import getoutput # Python 2
+except: from subprocess import getoutput # Python 3
+def hasKey(a,b):
+ try: return a.has_key(b) # old Python 2
+ except: return b in a # newer Python 2 + Python 3
if len(sys.argv)==2 and sys.argv[1]=="--help":
- print __doc__.strip() ; raise SystemExit
+ print(__doc__.strip()); raise SystemExit
if len(sys.argv)==2 and sys.argv[1]=="--version":
- print __doc__[:__doc__.find("\n\n")].strip() ; raise SystemExit
+ print(__doc__[:__doc__.find("\n\n")].strip()); raise SystemExit
base_pointsize = float(sys.argv[1])
desired_pointsize = float(sys.argv[2])
@@ -167,13 +173,13 @@ else:
extra_bottom_margin_mm = 0
pageStyle = " \\pagestyle{empty}"
-if os.environ.has_key("paper_width"): paper_width=float(os.environ["paper_width"])
+if hasKey(os.environ,"paper_width"): paper_width=float(os.environ["paper_width"])
else: paper_width=210
-if os.environ.has_key("paper_height"): paper_height=float(os.environ["paper_height"])
+if hasKey(os.environ,"paper_height"): paper_height=float(os.environ["paper_height"])
else: paper_height=297
-if os.environ.has_key("margin_left"): margin_left=float(os.environ["margin_left"])
+if hasKey(os.environ,"margin_left"): margin_left=float(os.environ["margin_left"])
else: margin_left=10
-if os.environ.has_key("margin_top"): margin_top=float(os.environ["margin_top"])
+if hasKey(os.environ,"margin_top"): margin_top=float(os.environ["margin_top"])
else: margin_top=10
paper_magstep = 1.0*desired_pointsize/base_pointsize
@@ -188,15 +194,16 @@ if sys.argv[3]=="tex" or sys.argv[3]=="p
s="\\textwidth=%.1fmm \\textheight=%.1fmm \\topmargin=%.1fmm \\marginparwidth=0mm \\oddsidemargin=%.1fmm \\evensidemargin=%.1fmm \\columnsep=%.1fmm%s" % (textwidth,textheight,margin_top_setting,margin_left_setting,margin_left_setting,margin_left_setting,pageStyle)
if sys.argv[3]=="pdftex":
s += "\\mag=%d \\pdfpagewidth=%d true mm \\pdfpageheight=%d true mm \\pdfhorigin=0 mm \\pdfvorigin=-12.95 mm \\paperwidth=%d true mm \\paperheight=%d true mm" % (1000*paper_magstep,paper_width,paper_height,paper_width,paper_height) # the -12.95mm seems to be a constant regardless of magnification (previous version had -14 but it sems -12.95 is more accurate - at least 12.9 is too small and 13 is too big). Need \paperwidth and \paperheight in there as well in case using hyperref.
- print s
+ print(s)
else:
- os.system("dvips -T %dmm,%dmm -x %d %s -o bbox_test.ps" % (paper_width*10,paper_height*10,1000*paper_magstep+0.5,sys.argv[3]))
+ r = os.system("dvips -T %dmm,%dmm -x %d %s -o bbox_test.ps" % (paper_width*10,paper_height*10,1000*paper_magstep+0.5,sys.argv[3]))
+ assert not r, "dvips failed"
# Now, that would have got the origin wrong. I can't
# figure out how dvips origin and magstep is supposed to
# interoperate, so let's work it out on a case-by-case
# basis from the bounding box.
# (Note: multiplying paper_width and paper_height by 10 above, because if dealing with very small paper sizes then this may give a reading of 0 if the origin is off the page. Increasing the paper size doesn't seem to affect the origin.)
- bbox=commands.getoutput("echo|gs -sDEVICE=bbox bbox_test.ps 2>&1|grep BoundingBox")
+ bbox=getoutput("echo|gs -sDEVICE=bbox bbox_test.ps 2>&1|grep BoundingBox")
# (previous version used 'head -1' to take only the first page, but that can cause 'broken pipe' errors if the file contains too many pages, and will give an incorrect result if there is only one line per page and it is indented on the first page, so we'll look at ALL the pages and take the outermost bounds. Will also look at high-resolution bounding boxes only, if available.)
if "HiResBoundingBox" in bbox: bbox=filter(lambda x:"HiRes" in x,bbox.split("\n"))
else: bbox=bbox.split("\n")
@@ -206,4 +213,4 @@ else:
os.unlink("bbox_test.ps")
existing_left_margin_mm = min(map(lambda x:x[0],bbox))*25.4/72
existing_top_margin_mm = paper_height*10-max(map(lambda x:x[3],bbox))*25.4/72
- print "dvips -T %dmm,%dmm -O %.1fmm,%.1fmm -x %d %s" % (paper_width,paper_height,margin_left - existing_left_margin_mm,margin_top - existing_top_margin_mm,1000*paper_magstep+0.5,sys.argv[3])
+ print("dvips -T %dmm,%dmm -O %.1fmm,%.1fmm -x %d %s" % (paper_width,paper_height,margin_left - existing_left_margin_mm,margin_top - existing_top_margin_mm,1000*paper_magstep+0.5,sys.argv[3]))

View File

@ -1,13 +1,13 @@
diff -up ./scripts/pdfbook2/pdfbook2.py3 ./scripts/pdfbook2/pdfbook2
--- ./scripts/pdfbook2/pdfbook2.py3 2016-11-25 13:32:54.000000000 -0500
+++ ./scripts/pdfbook2/pdfbook2 2018-12-07 14:52:49.197436113 -0500
--- ./scripts/pdfbook2/pdfbook2.py3 2020-01-10 08:49:13.071743210 -0500
+++ ./scripts/pdfbook2/pdfbook2 2020-01-10 08:50:18.938615714 -0500
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
""" pdfbook2 - transform pdf files to booklets
This program is free software: you can redistribute it and/or modify
@@ -29,11 +29,11 @@ import shutil
@@ -29,15 +29,15 @@ import shutil
def booklify( name, opts ):
#------------------------------------------------------ Check if file exists
@ -22,6 +22,11 @@ diff -up ./scripts/pdfbook2/pdfbook2.py3 ./scripts/pdfbook2/pdfbook2
sys.stdout.flush()
#---------------------------------------------------------- useful constants
- bboxName = "%%HiResBoundingBox:"
+ bboxName = b"%%HiResBoundingBox:"
tmpFile = ".crop-tmp.pdf"
#------------------------------------------------- find min/max bounding box
@@ -50,8 +50,8 @@ def booklify( name, opts ):
p.wait()
out, err = p.communicate()

View File

@ -21,7 +21,7 @@
Name: %{shortname}-base
Version: %{source_date}
Release: 2.0.riscv64%{?dist}
Release: 7.0.riscv64%{?dist}
Epoch: 7
Summary: TeX formatting system
# The only files in the base package are directories, cache, and license texts
@ -433,6 +433,8 @@ Patch20: texlive-20190410-dvisvgm-fix-libgs-detection.patch
# Since we need to include tlmgr.pl for texconfig
# lets try to keep people from shooting themselves with it
Patch21: texlive-20190410-tlmgr-ignore-warning.patch
# Fix latex-papersize for python3 (thanks to upstream)
Patch22: texlive-base-latex-papersize-py3.patch
# Can't do this because it causes everything else to be noarch
@ -4928,6 +4930,23 @@ dpi to get the correct bounding box. Included in the
distribution is the bbox program, an application to produce
Bounding Box values for rawppm or rawpbm format files.
%package -n %{shortname}-psutils
Provides: tex-psutils = %{epoch}:%{source_date}-%{release}
Provides: tex-psutils-bin = %{epoch}:%{source_date}-%{release}
Provides: texlive-psutils-bin = %{epoch}:%{source_date}-%{release}
License: psutils
Summary: The TeXLive fork of the PS Utilities
Requires: texlive-base
Requires: texlive-kpathsea
%description -n %{shortname}-psutils
Utilities for manipulating PostScript documents.
Page selection and rearrangement are supported, including arrangement into
signatures for booklet printing, and page merging for n-up printing.
This package contains a fork of the psutils binaries adjusted for TexLive.
All of the standard binaries have been namespaced with a "tl-" prefix.
%package -n %{shortname}-pst2pdf
Provides: tex-pst2pdf = %{epoch}:%{source_date}-%{release}
Provides: tex-pst2pdf-bin = %{epoch}:%{source_date}-%{release}
@ -6566,7 +6585,7 @@ cd work
--with-system-cairo --with-system-icu --with-system-harfbuzz --with-system-graphite2 --with-system-libgs --with-system-pixman \
--with-system-libpaper --with-system-potrace --with-pic --with-xdvi-x-toolkit=xaw --with-system-mpfr --with-system-gmp \
--enable-shared --enable-compiler-warnings=max --without-cxx-runtime-hack \
--disable-native-texlive-build --disable-t1utils --disable-psutils --disable-biber --disable-ptexenc --disable-largefile \
--disable-native-texlive-build --disable-t1utils --enable-psutils --disable-biber --disable-ptexenc --disable-largefile \
%ifarch aarch64 %{mips} %{power64} s390 s390x riscv64
--disable-luajittex --disable-mfluajit \
%endif
@ -6687,6 +6706,9 @@ sed -i 's|\\sc |\\scshape |g' %{buildroot}%{_texdir}/texmf-dist/bibtex/bst/base/
pushd %{buildroot}%{_texdir}/texmf-dist
# fix pdfbook2 for py3
patch -p1 < %{_sourcedir}/texlive-base-pdfbook2-py3.patch
# fix latex-papersize for py3
patch -p1 < %{_sourcedir}/texlive-base-latex-papersize-py3.patch
# neuter tlmgr a bit
patch -p1 < %{_sourcedir}/texlive-20190410-tlmgr-ignore-warning.patch
popd
@ -6875,6 +6897,27 @@ find -type f -exec sed -i '1s|^#!/usr/bin/env python$|#!%{__python3}|' {} +
sed -i '1s|^#!/usr/bin/python |#!%{__python3} |' ./%{_texdir}/texmf-dist/scripts/de-macro/de-macro
popd
# One dir to own
mkdir -p %{buildroot}%{_texdir}/texmf-dist/tex/generic/context/third
# TeXLive has a fork of psutils
# we namespace those binaries to avoid conflicts with the upstream psutils
pushd %{buildroot}%{_bindir}
for i in epsffit extractres includeres psbook psjoin psnup psresize psselect pstops
do mv $i tl-$i
done
popd
# we also rename the manpages
pushd %{buildroot}%{_mandir}/man1/
for i in epsffit extractres includeres psbook psjoin psnup psresize psselect pstops psutils
do mv $i.1 tl-$i.1
done
popd
# and move the config file
mkdir -p %{buildroot}%{_sysconfdir}/texlive/psutils
mv %{buildroot}%{_texdir}/texmf-dist/psutils/paper.cfg %{buildroot}%{_sysconfdir}/texlive/psutils/paper.cfg
ln -s %{_sysconfdir}/texlive/psutils/paper.cfg %{buildroot}%{_texdir}/texmf-dist/psutils/paper.cfg
# SCRIPTLETS
%pretrans -p <lua>
@ -6985,6 +7028,14 @@ done <<< "$list"
%dir %{_texdir}/texmf-dist/source/fonts
%dir %{_texdir}/texmf-dist/source/fonts/zhmetrics
%dir %{_texdir}/texmf-dist/texconfig
%dir %{_texdir}/texmf-dist/tex
%dir %{_texdir}/texmf-dist/tex/generic
%dir %{_texdir}/texmf-dist/tex/generic/bibtex
%dir %{_texdir}/texmf-dist/tex/generic/config
%dir %{_texdir}/texmf-dist/tex/latex
%dir %{_texdir}/texmf-dist/tex/lualatex
%dir %{_texdir}/texmf-dist/tex/luatex
%dir %{_texdir}/texmf-dist/tex/xelatex
%dir %{_texdir}/texmf-dist/web2c
%dir %{_texmf_var}
%{_texdir}/texmf-var
@ -7293,6 +7344,7 @@ done <<< "$list"
%{_texdir}/texmf-dist/scripts/context/
%{_texdir}/texmf-dist/tex/context/
%{_texdir}/texmf-dist/tex/generic/context/
%dir %{_texdir}/texmf-dist/tex/generic/context/third
%{_texdir}/texmf-dist/tex/latex/context/
%{fmtutil_cnf_d}/context
%doc %{_texdir}/texmf-dist/doc/context/
@ -7893,6 +7945,8 @@ done <<< "$list"
%dir %{_texdir}/texmf-config/web2c
%{_texdir}/texmf-config/web2c/updmap.cfg
%attr(0644, root, root) %verify(not md5 size mtime) %ghost %{_texdir}/texmf-config/ls-R
%attr(0644, root, root) %verify(not md5 size mtime) %ghost %{_texdir}/texmf-dist/ls-R
%attr(0644, root, root) %verify(not md5 size mtime) %ghost %{_texdir}/texmf-local/ls-R
%files -n %{shortname}-lib-devel
%dir %{_includedir}/kpathsea
@ -8407,6 +8461,31 @@ done <<< "$list"
%{_texdir}/texmf-dist/tex/latex/pst-pdf/
%doc %{_texdir}/texmf-dist/doc/latex/pst-pdf/
%files -n %{shortname}-psutils
%{_bindir}/tl-epsffit
%{_bindir}/tl-extractres
%{_bindir}/tl-includeres
%{_bindir}/tl-psbook
%{_bindir}/tl-psjoin
%{_bindir}/tl-psnup
%{_bindir}/tl-psresize
%{_bindir}/tl-psselect
%{_bindir}/tl-pstops
%{_mandir}/man1/tl-epsffit.1*
%{_mandir}/man1/tl-extractres.1*
%{_mandir}/man1/tl-includeres.1*
%{_mandir}/man1/tl-psbook.1*
%{_mandir}/man1/tl-psjoin.1*
%{_mandir}/man1/tl-psnup.1*
%{_mandir}/man1/tl-psresize.1*
%{_mandir}/man1/tl-psselect.1*
%{_mandir}/man1/tl-pstops.1*
%{_mandir}/man1/tl-psutils.1*
%{_texdir}/texmf-dist/psutils/
%dir %{_sysconfdir}/texlive/psutils
%config(noreplace) %{_sysconfdir}/texlive/psutils/paper.cfg
%{_texdir}/texmf-dist/scripts/psutils
%files -n %{shortname}-ps2pk
%license other-free.txt
%{_bindir}/mag
@ -8967,9 +9046,40 @@ done <<< "$list"
%doc %{_texdir}/texmf-dist/doc/latex/yplan/
%changelog
* Sun Aug 18 2019 David Abdurachmanov <david.abdurachmanov@sifive.com> - 7:20190410-2.0.riscv64
* Fri Jan 17 2020 David Abdurachmanov <david.abdurachmanov@sifive.com> - 7:20190410-7.0.riscv64
- Add support for RISC-V (riscv64)
* Fri Jan 10 2020 Tom Callaway <spot@fedoraproject.org> - 7:20190410-7
- fix python3 issue with pdfbook2 (thanks to "Mildred", bz1733794)
- fix python3 issue with latex-papersize (thanks to Silas S. Brown, bz1783964)
* Fri Nov 15 2019 Tom Callaway <spot@fedoraproject.org> - 7:20190410-6
- package up the TL fork of psutils to help tlmgr find all the configs it expects
* Fri Nov 01 2019 Pete Walter <pwalter@fedoraproject.org> - 7:20190410-5
- Rebuild for ICU 65
* Fri Oct 18 2019 Tom Callaway <spot@fedoraproject.org> - 7:20190410-4
- fix dir ownership
* Wed Oct 9 2019 Jerry James <loganjerry@gmail.com> - 7:20190410-3
- Rebuild for mpfr 4
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7:20190410-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu May 23 2019 Tom Callaway <spot@fedoraproject.org> - 7:20190410-1
- update to 20190410
- update all component tarballs to latest available
- new subpackages: cluttex, ctanbib, dviout-util, pdftex-quiet, webquiz, xindex
- add a slightly neutered tlmgr back into texlive.infra because texconfig paper needs it
IF YOU ARE READING THIS PLEASE DO NOT USE tlmgr install/update. IF YOU IGNORE ME
PLEASE DO NOT FILE BUGS. PLEASE DO NOT REQUEST THE tlmgrgui BITS.
* Wed May 15 2019 Jerry James <loganjerry@gmail.com> - 7:20180414-36
- Fix xindy build by eliminating race to create latex.fmt
- Build xindy on all supported arches
* Tue Mar 19 2019 Tom Callaway <spot@fedoraproject.org> - 7:20180414-35
- do not throw no file error in synctex