* [gentoo-commits] repo/gentoo:master commit in: app-text/dblatex/, app-text/dblatex/files/
@ 2015-11-09 0:27 Amy Winston
0 siblings, 0 replies; 4+ messages in thread
From: Amy Winston @ 2015-11-09 0:27 UTC (permalink / raw
To: gentoo-commits
commit: 337e2f7b91b016c1f1181e2125c0e74da7497ba4
Author: Amy Winston <amynka <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 9 00:26:52 2015 +0000
Commit: Amy Winston <amynka <AT> gentoo <DOT> org>
CommitDate: Mon Nov 9 00:26:52 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=337e2f7b
app-text/dblatex: New ebuild for dblatex-0.3.7. By Zoltan Puskas.
DocBook to LaTeX Publishing package built using Python
Gentoo-Bug: #129368
Package-Manager: portage-2.2.20.1
app-text/dblatex/Manifest | 1 +
app-text/dblatex/dblatex-0.3.7.ebuild | 44 ++++++++++++++++++++++
.../files/dblatex-no-inkscape-dependency.patch | 12 ++++++
app-text/dblatex/files/dblatex-path-logging.patch | 15 ++++++++
app-text/dblatex/files/dblatex-setup.patch | 28 ++++++++++++++
app-text/dblatex/metadata.xml | 15 ++++++++
6 files changed, 115 insertions(+)
diff --git a/app-text/dblatex/Manifest b/app-text/dblatex/Manifest
new file mode 100644
index 0000000..d38134b
--- /dev/null
+++ b/app-text/dblatex/Manifest
@@ -0,0 +1 @@
+DIST dblatex-0.3.7.tar.bz2 1513975 SHA256 59ce3fdfd4d6cf44beb8705d9267b7be7cb32d4f826834c861c5b7016c7e722e SHA512 7f7111dfe7d880a93679422a43700787755ebee7f17483b4bc5a8ce55c521d7fe0baeb4890a910b9007141d63a3e3b8f50347e68001ad7c1a14916920e11a40c WHIRLPOOL df27896ecf5f2f194fb51f9e6a566c324495c9fb9c1217514af97b5c30fc2dc0dd5a7aa9bb71daf36a4329101a90f7743d9c5962b8a2fbe994773320d3cf937e
diff --git a/app-text/dblatex/dblatex-0.3.7.ebuild b/app-text/dblatex/dblatex-0.3.7.ebuild
new file mode 100644
index 0000000..41322e5
--- /dev/null
+++ b/app-text/dblatex/dblatex-0.3.7.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 eutils
+
+DESCRIPTION="Transform DocBook using TeX macros"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+HOMEPAGE="http://dblatex.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ app-text/texlive
+ dev-texlive/texlive-htmlxml
+ dev-texlive/texlive-latexextra
+ dev-texlive/texlive-latexrecommended
+ dev-texlive/texlive-mathextra
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-xetex
+ dev-libs/libxslt
+ app-text/docbook-xml-dtd:4.5
+ gnome-base/librsvg
+"
+DEPEND="${RDEPEND}"
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+ EPATCH_SOURCE="${FILESDIR}" EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch
+}
+
+python_install_all() {
+ python_doscript "${S}"/scripts/dblatex
+ python_optimize
+ distutils-r1_python_install_all
+ # move package documentation to a folder name containing version number
+ mv "${D}"/usr/share/doc/${PN} "${D}"/usr/share/doc/${PF} || die "mv doc"
+}
diff --git a/app-text/dblatex/files/dblatex-no-inkscape-dependency.patch b/app-text/dblatex/files/dblatex-no-inkscape-dependency.patch
new file mode 100644
index 0000000..1d032f4
--- /dev/null
+++ b/app-text/dblatex/files/dblatex-no-inkscape-dependency.patch
@@ -0,0 +1,12 @@
+diff -Naur dblatex-0.3.7-orig/lib/dbtexmf/core/imagedata.py dblatex-0.3.7/lib/dbtexmf/core/imagedata.py
+--- dblatex-0.3.7-orig/lib/dbtexmf/core/imagedata.py 2015-08-07 10:47:53.000000000 +0100
++++ dblatex-0.3.7/lib/dbtexmf/core/imagedata.py 2015-11-08 22:36:41.771457222 +0000
+@@ -66,7 +66,7 @@
+
+ class SvgConverter(ImageConverter):
+ def convert(self, input, output, format, doexec=1):
+- cmd = "inkscape -z -D --export-%s=%s \"%s\"" % (format, output, input)
++ cmd = "rsvg-convert -f %s -o \"%s\" \"%s\"" % (format, output, input)
+ return self.system(cmd, doexec)
+
+
diff --git a/app-text/dblatex/files/dblatex-path-logging.patch b/app-text/dblatex/files/dblatex-path-logging.patch
new file mode 100644
index 0000000..7f0fdb6
--- /dev/null
+++ b/app-text/dblatex/files/dblatex-path-logging.patch
@@ -0,0 +1,15 @@
+diff -Naur dblatex-0.3.7-orig/scripts/dblatex dblatex-0.3.7/scripts/dblatex
+--- dblatex-0.3.7-orig/scripts/dblatex 2015-08-07 10:47:53.000000000 +0100
++++ dblatex-0.3.7/scripts/dblatex 2015-11-08 22:30:50.362571505 +0000
+@@ -1,8 +1,10 @@
+ #! /usr/bin/env python
+ import sys
+ import os
++import logging
+
+-package_base = os.path.join(os.path.dirname(sys.argv[0]), "..")
++logging.basicConfig()
++package_base = "/usr/share/dblatex"
+ sys.path.append(os.path.realpath(os.path.join(package_base, "lib")))
+
+ from dbtexmf.dblatex import dblatex
diff --git a/app-text/dblatex/files/dblatex-setup.patch b/app-text/dblatex/files/dblatex-setup.patch
new file mode 100644
index 0000000..f6cf4a2
--- /dev/null
+++ b/app-text/dblatex/files/dblatex-setup.patch
@@ -0,0 +1,28 @@
+--- dblatex-0.3.7-orig/setup.py 2015-08-07 10:47:53.000000000 +0100
++++ dblatex-0.3.7/setup.py 2015-11-08 22:39:03.076213227 +0000
+@@ -23,7 +23,6 @@
+ from distutils import log
+ from subprocess import Popen, PIPE
+ sys.path.append("lib")
+-from contrib.debian.installer import DebianInstaller
+
+ #
+ # Build the command line script
+@@ -363,15 +362,12 @@
+ status += "no"
+ mis_stys.append(sty)
+ print status
+-
++
+ if mis_stys:
+ raise OSError("not found: %s" % ", ".join(mis_stys))
+
+ def run(self):
+- if self.install_layout == "deb":
+- db = DebianInstaller(self)
+- else:
+- db = None
++ db = None
+
+ if not(db) and not(self.nodeps):
+ try:
diff --git a/app-text/dblatex/metadata.xml b/app-text/dblatex/metadata.xml
new file mode 100644
index 0000000..fe1a819
--- /dev/null
+++ b/app-text/dblatex/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>zoltan@sinustrom.info</email>
+ <name>Zoltan Puskas</name>
+ <description>Proxied maintainer. Assign bugs to him.</description>
+ </maintainer>
+ <longdescription>
+ dbaltex is an opensource DocBook to LaTeX publishing software
+ that originally started as DB2LaTeX clone, but now is more
+ feature rich and easier to use.
+ </longdescription>
+</pkgmetadata>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-text/dblatex/, app-text/dblatex/files/
@ 2020-03-03 6:03 Joonas Niilola
0 siblings, 0 replies; 4+ messages in thread
From: Joonas Niilola @ 2020-03-03 6:03 UTC (permalink / raw
To: gentoo-commits
commit: f5fa69530b40f433b2d1eff27fb800592e38c4de
Author: Zoltan Puskas <zoltan <AT> sinustrom <DOT> info>
AuthorDate: Tue Feb 25 08:54:05 2020 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Tue Mar 3 06:01:41 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f5fa6953
app-text/dblatex: Bump to 3.11 (Python3 compatible) version
Closes: https://bugs.gentoo.org/710690
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Zoltan Puskas <zoltan <AT> sinustrom.info>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
app-text/dblatex/Manifest | 1 +
app-text/dblatex/dblatex-0.3.11.ebuild | 59 ++++++++++++++++++++++
.../dblatex-0.3.11-no-inkscape-dependency.patch | 14 +++++
.../files/dblatex-0.3.11-path-logging.patch | 15 ++++++
app-text/dblatex/files/dblatex-0.3.11-setup.patch | 47 +++++++++++++++++
5 files changed, 136 insertions(+)
diff --git a/app-text/dblatex/Manifest b/app-text/dblatex/Manifest
index 3810a4d1cfa..eac71d584fa 100644
--- a/app-text/dblatex/Manifest
+++ b/app-text/dblatex/Manifest
@@ -1,2 +1,3 @@
DIST dblatex-0.3.10.tar.bz2 1668202 BLAKE2B 2cc7e33ddc1b4732ae880d3443e65e40b16fc21fa31dfc52ef2250433f4c99bb5b590961095e044b2972b1ac9b4e38358e356b7bdcfb607d6f863720feea7cf4 SHA512 33a5ee3d23d3b9a1576be248a312ca741ea7cb629334a98fb6cb49e0f0f932334506ea934312de04ec645c86ec52699687bd2574b1802d3c23815b44c8514b7b
+DIST dblatex-0.3.11py3.tar.bz2 1671505 BLAKE2B 44e89f5f8d81105a3401074ad765479c04a495962c3efb3677cec81bf3b85c67a03585e7da8bdbd103cbea84e38d2bc633bd13704a5835c98d70fed644bfc6ba SHA512 48c1445c702e9c7c3ff83c57bb8a0caf5f4b027669a70887af0a23f75f5f99fb6840c4281b8bad9402910f3850af485d432e3109e5fd93184434cc87eb712695
DIST dblatex-0.3.7.tar.bz2 1513975 BLAKE2B de523640eacc058eaffc2e53407d6faed0969b1485110dca7669c6fb2323d4ecb91c8d73d9a8fdf3ae9d0803f5e5a371af011c0a241f97f08ae4d73ee57e7d89 SHA512 7f7111dfe7d880a93679422a43700787755ebee7f17483b4bc5a8ce55c521d7fe0baeb4890a910b9007141d63a3e3b8f50347e68001ad7c1a14916920e11a40c
diff --git a/app-text/dblatex/dblatex-0.3.11.ebuild b/app-text/dblatex/dblatex-0.3.11.ebuild
new file mode 100644
index 00000000000..523c84b8f4a
--- /dev/null
+++ b/app-text/dblatex/dblatex-0.3.11.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+PYTHON_COMPAT=( python3_{6,7} )
+
+inherit distutils-r1
+
+DESCRIPTION="Transform DocBook using TeX macros"
+HOMEPAGE="http://dblatex.sourceforge.net/"
+SRC_URI="https://downloads.sourceforge.net/project/dblatex/dblatex/${P}/${P}py3.tar.bz2"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="inkscape"
+
+RDEPEND="
+ app-text/docbook-xml-dtd:4.5
+ dev-libs/kpathsea
+ dev-libs/libxslt
+ dev-libs/libxslt
+ dev-texlive/texlive-fontutils
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ dev-texlive/texlive-latexrecommended
+ dev-texlive/texlive-mathscience
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-xetex
+ gnome-base/librsvg
+ media-gfx/imagemagick
+ media-gfx/transfig
+ inkscape? ( media-gfx/inkscape )
+"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${P}py3"
+
+PATCHES=(
+ "${FILESDIR}/${P}-path-logging.patch"
+ "${FILESDIR}/${P}-setup.patch"
+)
+
+python_prepare_all() {
+ # Manual page is precomressed, but we will use our own compression later.
+ gunzip docs/manpage/dblatex.1.gz || die
+ # If we dont have inkscape we need to use an alternative SVG converter
+ use inkscape || eapply "${FILESDIR}/${P}-no-inkscape-dependency.patch"
+ # We need to fix version information in the docs and some metadata
+ grep -l -I -R "0.3.11py3" | xargs -n1 sed -i -e "s/${PV}py3/${PV}/" || die
+ distutils-r1_python_prepare_all
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ # Move package documentation to a folder name containing version number
+ mv "${D}"/usr/share/doc/${PN} "${D}"/usr/share/doc/${PF} || die
+}
diff --git a/app-text/dblatex/files/dblatex-0.3.11-no-inkscape-dependency.patch b/app-text/dblatex/files/dblatex-0.3.11-no-inkscape-dependency.patch
new file mode 100644
index 00000000000..18695b52a5e
--- /dev/null
+++ b/app-text/dblatex/files/dblatex-0.3.11-no-inkscape-dependency.patch
@@ -0,0 +1,14 @@
+diff -Naur dblatex-0.3.11py3/lib/dbtexmf/core/imagedata.py dblatex-0.3.11py3-new/lib/dbtexmf/core/imagedata.py
+--- dblatex-0.3.11py3/lib/dbtexmf/core/imagedata.py 2020-01-29 13:48:33.000000000 -0800
++++ dblatex-0.3.11py3-new/lib/dbtexmf/core/imagedata.py 2020-02-25 00:45:35.627054621 -0800
+@@ -181,8 +181,8 @@
+ class SvgConverter(ImageConverter):
+ def __init__(self, imgsrc, imgdst="", docformat="", backend=""):
+ ImageConverter.__init__(self, imgsrc="svg", imgdst=imgdst)
+- self.add_command(["inkscape", "-z", "-D", "--export-%(dst)s=%(output)s",
+- "%(input)s"])
++ self.add_command(["rsvg-convert", "-f", "%(dst)s", "-o","%(output)s",
++ "%(input)s"])
+
+
+ class FormatRule:
diff --git a/app-text/dblatex/files/dblatex-0.3.11-path-logging.patch b/app-text/dblatex/files/dblatex-0.3.11-path-logging.patch
new file mode 100644
index 00000000000..3d6162848fe
--- /dev/null
+++ b/app-text/dblatex/files/dblatex-0.3.11-path-logging.patch
@@ -0,0 +1,15 @@
+diff -Naur dblatex-0.3.11py3/scripts/dblatex dblatex-0.3.11py3-new/scripts/dblatex
+--- dblatex-0.3.11py3/scripts/dblatex 2020-01-29 13:48:34.000000000 -0800
++++ dblatex-0.3.11py3-new/scripts/dblatex 2020-02-25 01:04:16.169346434 -0800
+@@ -1,8 +1,10 @@
+ #! /usr/bin/env python
+ import sys
+ import os
++import logging
+
+-package_base = os.path.join(os.path.dirname(sys.argv[0]), "..")
++logging.basicConfig()
++package_base = "/usr/share/dblatex"
+ sys.path.insert(0, os.path.realpath(os.path.join(package_base, "lib")))
+
+ from dbtexmf.dblatex import dblatex
diff --git a/app-text/dblatex/files/dblatex-0.3.11-setup.patch b/app-text/dblatex/files/dblatex-0.3.11-setup.patch
new file mode 100644
index 00000000000..80203011839
--- /dev/null
+++ b/app-text/dblatex/files/dblatex-0.3.11-setup.patch
@@ -0,0 +1,47 @@
+diff -Naur dblatex-0.3.11py3/setup.py dblatex-0.3.11py3-new/setup.py
+--- dblatex-0.3.11py3/setup.py 2020-01-29 13:48:34.000000000 -0800
++++ dblatex-0.3.11py3-new/setup.py 2020-02-27 20:25:21.669297793 -0800
+@@ -26,7 +26,6 @@
+ from distutils import log
+ from subprocess import Popen, PIPE
+ sys.path.append("lib")
+-from contrib.debian.installer import DebianInstaller
+
+ #
+ # Build the command line script
+@@ -192,7 +191,7 @@
+ log.info("running build_doc")
+ htmldir = os.path.join("docs", "xhtml")
+ pdfdocs = glob.glob(os.path.join("docs", "[mr]*.pdf"))
+- manpage = os.path.join("docs", "manpage", "dblatex.1.gz")
++ manpage = os.path.join("docs", "manpage", "dblatex.1")
+
+ # Lazy check to avoid a rebuild for nothing
+ if (not(self.force) and os.path.exists(htmldir) and len(pdfdocs) >= 2
+@@ -368,15 +367,12 @@
+ status += "no"
+ mis_stys.append(sty)
+ print(status)
+-
++
+ if mis_stys:
+ raise OSError("not found: %s" % ", ".join(mis_stys))
+
+ def run(self):
+- if self.install_layout == "deb":
+- db = DebianInstaller(self)
+- else:
+- db = None
++ db = None
+
+ if not(db) and not(self.nodeps):
+ try:
+@@ -515,7 +511,7 @@
+ data_files=[('share/dblatex', ['xsl', 'latex', 'etc/schema']),
+ ('share/doc/dblatex', pdfdocs),
+ ('share/doc/dblatex', htmldoc),
+- ('share/man/man1', ['docs/manpage/dblatex.1.gz'])],
++ ('share/man/man1', ['docs/manpage/dblatex.1'])],
+ scripts=['scripts/dblatex'],
+ cmdclass={'build': Build,
+ 'build_scripts': BuildScripts,
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-text/dblatex/, app-text/dblatex/files/
@ 2020-08-05 12:19 Joonas Niilola
0 siblings, 0 replies; 4+ messages in thread
From: Joonas Niilola @ 2020-08-05 12:19 UTC (permalink / raw
To: gentoo-commits
commit: 59929d18c71162e37e32305e8a7a433e60c1f04f
Author: Zoltan Puskas <zoltan <AT> sinustrom <DOT> info>
AuthorDate: Tue Jul 14 05:51:40 2020 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Aug 5 12:18:38 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59929d18
app-text/dblatex: Introduce Python 3.8 and 3.9 support
Additionally make it compatible with >=media-gfx/inkscape-1.0
Closes: https://bugs.gentoo.org/723412
Package-Manager: Portage-2.3.101, Repoman-2.3.22
Signed-off-by: Zoltan Puskas <zoltan <AT> sinustrom.info>
Closes: https://github.com/gentoo/gentoo/pull/16692
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
app-text/dblatex/dblatex-0.3.11-r1.ebuild | 62 ++++++++++++
app-text/dblatex/files/dblatex-0.3.11-encode.patch | 19 ++++
.../files/dblatex-0.3.11-inkscape-1.0.patch | 107 +++++++++++++++++++++
3 files changed, 188 insertions(+)
diff --git a/app-text/dblatex/dblatex-0.3.11-r1.ebuild b/app-text/dblatex/dblatex-0.3.11-r1.ebuild
new file mode 100644
index 00000000000..d9813d2f40b
--- /dev/null
+++ b/app-text/dblatex/dblatex-0.3.11-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+PYTHON_COMPAT=( python3_{6,7,8,9} )
+
+inherit distutils-r1
+
+DESCRIPTION="Transform DocBook using TeX macros"
+HOMEPAGE="http://dblatex.sourceforge.net/"
+SRC_URI="https://downloads.sourceforge.net/project/dblatex/dblatex/${P}/${P}py3.tar.bz2"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="inkscape"
+
+RDEPEND="
+ app-text/docbook-xml-dtd:4.5
+ dev-libs/kpathsea
+ dev-libs/libxslt
+ dev-libs/libxslt
+ dev-texlive/texlive-fontutils
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ dev-texlive/texlive-latexrecommended
+ dev-texlive/texlive-mathscience
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-xetex
+ gnome-base/librsvg
+ media-gfx/imagemagick
+ media-gfx/transfig
+ inkscape? ( media-gfx/inkscape )
+"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${P}py3"
+
+PATCHES=(
+ "${FILESDIR}/${P}-path-logging.patch"
+ "${FILESDIR}/${P}-setup.patch"
+ "${FILESDIR}/${P}-encode.patch"
+)
+
+python_prepare_all() {
+ # Manual page is precomressed, but we will use our own compression later.
+ gunzip docs/manpage/dblatex.1.gz || die
+ # If we dont have inkscape we need to use an alternative SVG converter
+ use inkscape || eapply "${FILESDIR}/${P}-no-inkscape-dependency.patch"
+ # If we use inscape however we want to make dblatex compatible with v1.0
+ use inkscape && eapply "${FILESDIR}/${P}-inkscape-1.0.patch"
+ # We need to fix version information in the docs and some metadata
+ grep -l -I -R "0.3.11py3" | xargs -n1 sed -i -e "s/${PV}py3/${PV}/" || die
+ distutils-r1_python_prepare_all
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ # Move package documentation to a folder name containing version number
+ mv "${D}"/usr/share/doc/${PN} "${D}"/usr/share/doc/${PF} || die
+}
diff --git a/app-text/dblatex/files/dblatex-0.3.11-encode.patch b/app-text/dblatex/files/dblatex-0.3.11-encode.patch
new file mode 100644
index 00000000000..1f32f99074a
--- /dev/null
+++ b/app-text/dblatex/files/dblatex-0.3.11-encode.patch
@@ -0,0 +1,19 @@
+diff -Naur dblatex-0.3.11py3-orig/lib/dbtexmf/dblatex/rawtex.py dblatex-0.3.11py3/lib/dbtexmf/dblatex/rawtex.py
+--- dblatex-0.3.11py3-orig/lib/dbtexmf/dblatex/rawtex.py 2020-01-29 13:48:34.000000000 -0800
++++ dblatex-0.3.11py3/lib/dbtexmf/dblatex/rawtex.py 2020-07-13 23:49:56.296767535 -0700
+@@ -101,10 +101,14 @@
+
+ # If something done, replace the figure in the tex file
+ if newfig != fig:
++ if isinstance(fig, str):
++ fig = fig.encode("utf-8")
++ if isinstance(newfig, str):
++ newfig = newfig.encode("utf-8")
+ line = re.sub(br"{"+fig+br"}", br"{"+newfig+br"}", line)
+
+ return line
+-
++
+
+ def main():
+ c = RawLatex()
diff --git a/app-text/dblatex/files/dblatex-0.3.11-inkscape-1.0.patch b/app-text/dblatex/files/dblatex-0.3.11-inkscape-1.0.patch
new file mode 100644
index 00000000000..48cd9f24972
--- /dev/null
+++ b/app-text/dblatex/files/dblatex-0.3.11-inkscape-1.0.patch
@@ -0,0 +1,107 @@
+diff -Naur dblatex-0.3.11py3-orig/docs/custom/dblatex.xconf dblatex-0.3.11py3/docs/custom/dblatex.xconf
+--- dblatex-0.3.11py3-orig/docs/custom/dblatex.xconf 2020-01-29 13:48:32.000000000 -0800
++++ dblatex-0.3.11py3/docs/custom/dblatex.xconf 2020-07-14 01:05:42.883435133 -0700
+@@ -18,7 +18,7 @@
+ <imagedata>
+ <converter src="svg" dst="*" docformat="pdf">
+ <command>
+- inkscape -z -D --export-dpi=600 --export-%(dst)s=%(output)s %(input)s
++ inkscape -D --export-dpi=600 --export-filename=%(output)s %(input)s
+ </command>
+ </converter>
+ </imagedata>
+diff -Naur dblatex-0.3.11py3-orig/docs/xhtml/manual/sec-specs.html dblatex-0.3.11py3/docs/xhtml/manual/sec-specs.html
+--- dblatex-0.3.11py3-orig/docs/xhtml/manual/sec-specs.html 2020-01-29 13:49:23.000000000 -0800
++++ dblatex-0.3.11py3/docs/xhtml/manual/sec-specs.html 2020-07-14 01:06:19.012860710 -0700
+@@ -36,7 +36,7 @@
+ <imagedata>
+ <converter src="svg" dst="*" docformat="pdf">
+ <command>
+- inkscape -z -D --export-dpi=600 --export-%(dst)s=%(output)s %(input)s
++ inkscape -D --export-dpi=600 --export-filename=%(output)s %(input)s
+ </command>
+ </converter>
+ </imagedata>
+diff -Naur dblatex-0.3.11py3-orig/lib/dbtexmf/core/imagedata.py dblatex-0.3.11py3/lib/dbtexmf/core/imagedata.py
+--- dblatex-0.3.11py3-orig/lib/dbtexmf/core/imagedata.py 2020-01-29 13:48:33.000000000 -0800
++++ dblatex-0.3.11py3/lib/dbtexmf/core/imagedata.py 2020-07-14 01:02:56.729388831 -0700
+@@ -47,16 +47,16 @@
+
+
+ class PoolManager:
+- def __init__(self):
++ def __init__(self):
+ self._used_pool = None
+ self._pending_pools = []
+-
++
+ def set_pool(self, pool):
+ self._used_pool = pool
+ for p in self._pending_pools:
+ pool.preprend(p)
+ self._pending_pools = []
+-
++
+ def prepend_pool(self, pool):
+ if self._used_pool:
+ self._used_pool.prepend(pool)
+@@ -73,7 +73,7 @@
+ self.format_pool = PoolManager()
+
+ _image_setup = ImageSetup()
+-
++
+ def image_setup():
+ global _image_setup
+ return _image_setup
+@@ -181,7 +181,7 @@
+ class SvgConverter(ImageConverter):
+ def __init__(self, imgsrc, imgdst="", docformat="", backend=""):
+ ImageConverter.__init__(self, imgsrc="svg", imgdst=imgdst)
+- self.add_command(["inkscape", "-z", "-D", "--export-%(dst)s=%(output)s",
++ self.add_command(["inkscape", "-D", "--export-filename=%(output)s",
+ "%(input)s"])
+
+
+@@ -224,7 +224,7 @@
+ ImageFormatPool.__init__(self)
+ # There can be a mismatch between PDF-1.4 images and PDF-1.3
+ # document produced by XeTeX
+- self.add_rule(FormatRule(docformat="pdf", backend="xetex",
++ self.add_rule(FormatRule(docformat="pdf", backend="xetex",
+ imgdst="png"))
+ self.add_rule(FormatRule(docformat="pdf", imgdst="pdf"))
+ self.add_rule(FormatRule(docformat="dvi", imgdst="eps"))
+@@ -318,7 +318,7 @@
+ Copy the file in the working directory if its path contains characters
+ unsupported by latex, like spaces.
+ """
+- # Encode to expected output format. If encoding is OK and
++ # Encode to expected output format. If encoding is OK and
+ # supported by tex, just return the encoded path
+ newfig = self._path_encode(fig)
+ if newfig and newfig.find(b" ") == -1:
+@@ -350,7 +350,7 @@
+ if (ext):
+ realfig = self.find(fig)
+ return (realfig, ext[1:])
+-
++
+ # Lookup for the best suited available figure
+ if (self.output_format == "pdf"):
+ formats = ("png", "pdf", "jpg", "eps", "gif", "fig", "svg")
+@@ -369,7 +369,7 @@
+ format = ""
+
+ return (realfig, format)
+-
++
+ def find(self, fig):
+ # First, the obvious absolute path case
+ if os.path.isabs(fig):
+@@ -385,4 +385,4 @@
+ return realfig
+
+ return None
+-
++
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-text/dblatex/, app-text/dblatex/files/
@ 2024-06-13 10:37 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2024-06-13 10:37 UTC (permalink / raw
To: gentoo-commits
commit: 35a1ef8369dfc368ed9ca408bcc117ae76a6e3a3
Author: Zoltan Puskas <zoltan <AT> sinustrom <DOT> info>
AuthorDate: Mon Jun 10 05:51:42 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 13 10:36:49 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35a1ef83
app-text/dblatex: Fix Python issues
Migrate to PEP517 while also adding compatibility for 3.12
Closes: https://bugs.gentoo.org/909897
Closes: https://bugs.gentoo.org/929361
Closes: https://bugs.gentoo.org/922530
Signed-off-by: Zoltan Puskas <zoltan <AT> sinustrom.info>
Closes: https://github.com/gentoo/gentoo/pull/37102
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
app-text/dblatex/dblatex-0.3.12-r3.ebuild | 95 +++++++++++++++++
.../dblatex-0.3.12-adjust-submodule-imports.patch | 62 +++++++++++
.../dblatex-0.3.12-replace-imp-by-importlib.patch | 113 +++++++++++++++++++++
3 files changed, 270 insertions(+)
diff --git a/app-text/dblatex/dblatex-0.3.12-r3.ebuild b/app-text/dblatex/dblatex-0.3.12-r3.ebuild
new file mode 100644
index 000000000000..668691aed385
--- /dev/null
+++ b/app-text/dblatex/dblatex-0.3.12-r3.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit distutils-r1
+
+DESCRIPTION="Transform DocBook using TeX macros"
+HOMEPAGE="https://dblatex.sourceforge.net/"
+SRC_URI="https://downloads.sourceforge.net/project/dblatex/dblatex/${P}/${PN}3-${PV}.tar.bz2"
+S="${WORKDIR}/${PN}3-${PV}"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="inkscape test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ app-text/docbook-xml-dtd:4.5
+ dev-libs/kpathsea
+ dev-libs/libxslt
+ dev-texlive/texlive-fontutils
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ dev-texlive/texlive-latexrecommended
+ dev-texlive/texlive-mathscience
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-xetex
+ gnome-base/librsvg
+ media-gfx/imagemagick
+ >=media-gfx/fig2dev-3.2.9-r1
+ inkscape? ( media-gfx/inkscape )
+"
+DEPEND="
+ ${RDEPEND}
+"
+BDEPEND="
+ ${RDEPEND}
+ test? ( ~${CATEGORY}/${P}[${PYTHON_USEDEP}] )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.3.11-path-logging.patch"
+ "${FILESDIR}/${PN}-0.3.11-setup.patch"
+ "${FILESDIR}/${PN}-0.3.11-encode.patch"
+ "${FILESDIR}/${P}-replace-imp-by-importlib.patch"
+ "${FILESDIR}/${P}-adjust-submodule-imports.patch"
+)
+
+python_prepare_all() {
+ # Manual page is precomressed, but we will use our own compression later.
+ gunzip docs/manpage/dblatex.1.gz || die
+ if use inkscape; then
+ # If we use inscape we want to make dblatex compatible with v1.0
+ eapply "${FILESDIR}/${PN}-0.3.11-inkscape-1.0.patch"
+ else
+ # If we don't have inkscape we need to use an alternative SVG converter
+ eapply "${FILESDIR}/${PN}-0.3.11-no-inkscape-dependency.patch"
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ # After migrating to PEP517 setuptool's distutils behaves a bit differently.
+ # Rather than rewriting the entire build setup we follow Debian's path with
+ # a predefined script.
+ python_newscript - dblatex <<-EOF
+ #!${EPREFIX}/usr/bin/python
+ import sys
+ import os
+
+ package_base = r"${EPREFIX}/usr/share/dblatex"
+
+ from dbtexmf.dblatex import dblatex
+ dblatex.main(base=package_base)
+ EOF
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ # Move package documentation to a folder name containing version number
+ mv "${ED}"/usr/share/doc/${PN} "${ED}"/usr/share/doc/${PF} || die
+}
+
+python_test() {
+ emake -C tests/mathml
+}
diff --git a/app-text/dblatex/files/dblatex-0.3.12-adjust-submodule-imports.patch b/app-text/dblatex/files/dblatex-0.3.12-adjust-submodule-imports.patch
new file mode 100644
index 000000000000..9a09ede9db8e
--- /dev/null
+++ b/app-text/dblatex/files/dblatex-0.3.12-adjust-submodule-imports.patch
@@ -0,0 +1,62 @@
+From f5ce76603178e5465a744cb4feed4686489bebb9 Mon Sep 17 00:00:00 2001
+Message-ID: <f5ce76603178e5465a744cb4feed4686489bebb9.1688648379.git.github@grubix.eu>
+From: Michael J Gruber <github@grubix.eu>
+Date: Thu, 6 Jul 2023 14:58:03 +0200
+Subject: [PATCH] Python 3.12 compatibility: adjust submodule imports
+
+importlib imports behave differently in py 3.11 and py 3.12: py 3.12
+requires explicit imports of the submodules.
+
+While fixing this, reduce the imports to the used submodules. Currently,
+the base is still imported automatically.
+---
+ lib/dbtexmf/core/dbtex.py | 3 ++-
+ lib/dbtexmf/dblatex/grubber/plugins.py | 3 ++-
+ lib/dbtexmf/xslt/xslt.py | 3 ++-
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/lib/dbtexmf/core/dbtex.py b/lib/dbtexmf/core/dbtex.py
+index adac781..4cf9591 100644
+--- a/lib/dbtexmf/core/dbtex.py
++++ b/lib/dbtexmf/core/dbtex.py
+@@ -15,7 +15,8 @@ try:
+ except ImportError:
+ from urllib.request import pathname2url
+ import glob
+-import importlib
++import importlib.machinery
++import importlib.util
+ from optparse import OptionParser
+ from io import open
+
+diff --git a/lib/dbtexmf/dblatex/grubber/plugins.py b/lib/dbtexmf/dblatex/grubber/plugins.py
+index 047f2bb..6b4ecb4 100644
+--- a/lib/dbtexmf/dblatex/grubber/plugins.py
++++ b/lib/dbtexmf/dblatex/grubber/plugins.py
+@@ -4,7 +4,8 @@
+ Mechanisms to dynamically load extra modules to help the LaTeX compilation.
+ All the modules must be derived from the TexModule class.
+ """
+-import importlib
++import importlib.machinery
++import importlib.util
+
+ from os.path import *
+ from dbtexmf.dblatex.grubber.msg import _, msg
+diff --git a/lib/dbtexmf/xslt/xslt.py b/lib/dbtexmf/xslt/xslt.py
+index 57c99a2..7cc2038 100644
+--- a/lib/dbtexmf/xslt/xslt.py
++++ b/lib/dbtexmf/xslt/xslt.py
+@@ -2,7 +2,8 @@
+ # Very simple plugin loader for Xslt classes
+ #
+ import os
+-import importlib
++import importlib.machinery
++import importlib.util
+ import glob
+ import sys
+
+--
+2.41.0.411.gd9071d4297
+
diff --git a/app-text/dblatex/files/dblatex-0.3.12-replace-imp-by-importlib.patch b/app-text/dblatex/files/dblatex-0.3.12-replace-imp-by-importlib.patch
new file mode 100644
index 000000000000..0531733c7f55
--- /dev/null
+++ b/app-text/dblatex/files/dblatex-0.3.12-replace-imp-by-importlib.patch
@@ -0,0 +1,113 @@
+diff --git a/lib/dbtexmf/core/dbtex.py b/lib/dbtexmf/core/dbtex.py
+index b3ec732..adac781 100644
+--- a/lib/dbtexmf/core/dbtex.py
++++ b/lib/dbtexmf/core/dbtex.py
+@@ -15,7 +15,7 @@ try:
+ except ImportError:
+ from urllib.request import pathname2url
+ import glob
+-import imp
++import importlib
+ from optparse import OptionParser
+ from io import open
+
+@@ -540,15 +540,14 @@ class DbTexCommand:
+
+ def load_plugin(self, pathname):
+ moddir, modname = os.path.split(pathname)
+- try:
+- filemod, path, descr = imp.find_module(modname, [moddir])
+- except ImportError:
+- try:
+- filemod, path, descr = imp.find_module(modname)
+- except ImportError:
+- failed_exit("Error: '%s' module not found" % modname)
+- mod = imp.load_module(modname, filemod, path, descr)
+- filemod.close()
++ spec = importlib.machinery.PathFinder.find_spec(modname, [moddir])
++ if not spec:
++ spec = importlib.machinery.PathFinder.find_spec(modname)
++ if not spec:
++ failed_exit("Error: '%s' module not found" % modname)
++ mod = importlib.util.module_from_spec(spec)
++ spec.loader.exec_module(mod)
++ sys.modules[modname] = mod
+ return mod
+
+ def run_setup(self, options):
+diff --git a/lib/dbtexmf/dblatex/grubber/plugins.py b/lib/dbtexmf/dblatex/grubber/plugins.py
+index 9e333c9..047f2bb 100644
+--- a/lib/dbtexmf/dblatex/grubber/plugins.py
++++ b/lib/dbtexmf/dblatex/grubber/plugins.py
+@@ -4,7 +4,7 @@
+ Mechanisms to dynamically load extra modules to help the LaTeX compilation.
+ All the modules must be derived from the TexModule class.
+ """
+-import imp
++import importlib
+
+ from os.path import *
+ from dbtexmf.dblatex.grubber.msg import _, msg
+@@ -108,17 +108,16 @@ class Plugins (object):
+ """
+ if name in self.modules:
+ return 2
+- try:
+- file, path, descr = imp.find_module(name, [""])
+- except ImportError:
++ spec = importlib.machinery.PathFinder.find_spec(name, [""])
++ if not spec:
+ if not self.path:
+ return 0
+- try:
+- file, path, descr = imp.find_module(name, self.path)
+- except ImportError:
+- return 0
+- module = imp.load_module(name, file, path, descr)
+- file.close()
++ spec = importlib.machinery.PathFinder.find_spec(name, self.path)
++ if not spec:
++ return 0
++ module = importlib.util.module_from_spec(spec)
++ spec.loader.exec_module(module)
++ sys.modules[name] = module
+ self.modules[name] = module
+ return 1
+
+diff --git a/lib/dbtexmf/xslt/xslt.py b/lib/dbtexmf/xslt/xslt.py
+index 0350e30..57c99a2 100644
+--- a/lib/dbtexmf/xslt/xslt.py
++++ b/lib/dbtexmf/xslt/xslt.py
+@@ -2,20 +2,21 @@
+ # Very simple plugin loader for Xslt classes
+ #
+ import os
+-import imp
++import importlib
+ import glob
++import sys
+
+ def load(modname):
+- try:
+- file, path, descr = imp.find_module(modname, [""])
+- except ImportError:
+- try:
+- file, path, descr = imp.find_module(modname,
+- [os.path.dirname(__file__)])
+- except ImportError:
+- raise ValueError("Xslt '%s' not found" % modname)
+- mod = imp.load_module(modname, file, path, descr)
+- file.close()
++ spec = importlib.machinery.PathFinder.find_spec(modname, [""])
++ if not spec:
++ spec = importlib.machinery.PathFinder.find_spec(modname,
++ [os.path.dirname(__file__)])
++ if not spec:
++ raise ValueError("Xslt '%s' not found" % modname)
++
++ mod = importlib.util.module_from_spec(spec)
++ spec.loader.exec_module(mod)
++ sys.modules[modname] = mod
+ o = mod.Xslt()
+ return o
+
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-06-13 10:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-13 10:37 [gentoo-commits] repo/gentoo:master commit in: app-text/dblatex/, app-text/dblatex/files/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2020-08-05 12:19 Joonas Niilola
2020-03-03 6:03 Joonas Niilola
2015-11-09 0:27 Amy Winston
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox