commit:     f98144fc46bc93d25acb728dfc2c91fad61b7382
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 10 05:57:50 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jun 10 05:57:50 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f98144fc

dev-python/nbconvert: Backport inkscape-1+ fix

Thanks to sam_c for finding out.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../files/nbconvert-5.6.1-inkscape-1.patch         | 40 ++++++++++++++++++++++
 dev-python/nbconvert/nbconvert-5.6.1.ebuild        |  4 +++
 2 files changed, 44 insertions(+)

diff --git a/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch 
b/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch
new file mode 100644
index 00000000000..06e8d06c935
--- /dev/null
+++ b/dev-python/nbconvert/files/nbconvert-5.6.1-inkscape-1.patch
@@ -0,0 +1,40 @@
+From 61757ce936ab37855a5289d31ef59ef898061bcf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <m...@hroncok.cz>
+Date: Sun, 3 May 2020 15:41:07 +0200
+Subject: [PATCH] Fix CLI options given to Inkscape 1.0rc1+
+
+Fixes https://github.com/jupyter/nbconvert/issues/1246
+---
+ nbconvert/preprocessors/svg2pdf.py            | 7 ++++---
+ nbconvert/preprocessors/tests/test_svg2pdf.py | 2 +-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/nbconvert/preprocessors/svg2pdf.py 
b/nbconvert/preprocessors/svg2pdf.py
+index d4c48af6..af6a7dea 100644
+--- a/nbconvert/preprocessors/svg2pdf.py
++++ b/nbconvert/preprocessors/svg2pdf.py
+@@ -76,10 +76,11 @@ def _inkscape_version_default(self):
+     @default('command')
+     def _command_default(self):
+         major_verison = self.inkscape_version.split('.')[0]
+-        export_option = '--export-file' if int(major_verison) > 0 else 
'--export-pdf'
++        export_option = ' --export-filename' if int(major_verison) > 0 else ' 
--export-pdf'
++        gui_option = '' if int(major_verison) > 0 else ' --without-gui'
+ 
+-        return '{inkscape} --without-gui {export_option}='.format(
+-            inkscape=self.inkscape, export_option=export_option
++        return '{inkscape}{gui_option}{export_option}='.format(
++            inkscape=self.inkscape, export_option=export_option, 
gui_option=gui_option
+         ) + '"{to_filename}" "{from_filename}"'
+ 
+     inkscape = Unicode(help="The path to Inkscape, if 
necessary").tag(config=True)
+diff --git a/nbconvert/preprocessors/tests/test_svg2pdf.py 
b/nbconvert/preprocessors/tests/test_svg2pdf.py
+index 5e13b282..d9ccec8c 100644
+--- a/nbconvert/preprocessors/tests/test_svg2pdf.py
++++ b/nbconvert/preprocessors/tests/test_svg2pdf.py
+@@ -91,4 +91,4 @@ def test_inkscape_pre_v1_command(self):
+ 
+     def test_inkscape_v1_command(self):
+         preprocessor = self.build_preprocessor(inkscape='fake-inkscape', 
inkscape_version='1.0beta2')
+-        self.assertEquals(preprocessor.command, 'fake-inkscape --without-gui 
--export-file="{to_filename}" "{from_filename}"')
++        self.assertEquals(preprocessor.command, 'fake-inkscape 
--export-filename="{to_filename}" "{from_filename}"')

diff --git a/dev-python/nbconvert/nbconvert-5.6.1.ebuild 
b/dev-python/nbconvert/nbconvert-5.6.1.ebuild
index 64b91a7af87..c2041fa935c 100644
--- a/dev-python/nbconvert/nbconvert-5.6.1.ebuild
+++ b/dev-python/nbconvert/nbconvert-5.6.1.ebuild
@@ -44,6 +44,10 @@ distutils_enable_sphinx docs \
        dev-python/{ipython,jupyter_client,nbsphinx,sphinx_rtd_theme}
 distutils_enable_tests pytest
 
+PATCHES=(
+       "${FILESDIR}"/${P}-inkscape-1.patch
+)
+
 python_test() {
        distutils_install_for_testing bdist_egg
        cd "${TEST_DIR}"/lib || die

Reply via email to