commit 7021b57277bc9fad540ffb7ee9721b293aca1149
Author: Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl>
Date: Wed Jan 8 16:15:10 2020 +0100
Adopt to use new inkscape (>=1.0)
...e5viewer-Fix-for-new-inkscape-and-python3.patch | 86 ++++++++++++++++++++++
ldoce5viewer.spec | 8 +-
2 files changed, 93 insertions(+), 1 deletion(-)
---
diff --git a/ldoce5viewer-Fix-for-new-inkscape-and-python3.patch
b/ldoce5viewer-Fix-for-new-inkscape-and-python3.patch
new file mode 100644
index 0000000..8cb80bb
--- /dev/null
+++ b/ldoce5viewer-Fix-for-new-inkscape-and-python3.patch
@@ -0,0 +1,86 @@
+From e17a19a86c5f7a02c6005fe0ebe2e608226fe694 Mon Sep 17 00:00:00 2001
+From: Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl>
+Date: Wed, 8 Jan 2020 15:58:39 +0100
+Subject: [PATCH] Fix for new inkscape and python3
+
+New inkscape do not longer support -e option (use -o instead).
+---
+ ldoce5viewer/qtgui/resources/icons/Makefile | 6 ++++--
+ ldoce5viewer/qtgui/resources/icons/icongen.py | 14 +++++++-------
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/ldoce5viewer/qtgui/resources/icons/Makefile
b/ldoce5viewer/qtgui/resources/icons/Makefile
+index c2a784a..ba46712 100644
+--- a/ldoce5viewer/qtgui/resources/icons/Makefile
++++ b/ldoce5viewer/qtgui/resources/icons/Makefile
+@@ -8,13 +8,15 @@ PNG_16 := $(patsubst %-src.png, %-16.png, $(PNG_SRC))
+ all: $(PNG_24) $(PNG_22) $(PNG_16)
+
+ %-48-src.png: %.svg icongen.py
+- inkscape -w 96 -h 96 -e $@ $<
++ inkscape --help | grep -- --export-file= >/dev/null \
++ && inkscape -w 96 -h 96 -o $@ $< \
++ || inkscape -w 96 -h 96 -e $@ $<
+
+ edit-clear-48.png: edit-clear-48-src.png
+ cp $< $@
+
+ %-48.png: %-48-src.png
+- python2 icongen.py $< $@
++ python3 icongen.py $< $@
+
+ %-24.png: %-48.png
+ convert $< -filter Lanczos -resize 24x24 $@
+diff --git a/ldoce5viewer/qtgui/resources/icons/icongen.py
b/ldoce5viewer/qtgui/resources/icons/icongen.py
+index e27000c..aed5c6c 100644
+--- a/ldoce5viewer/qtgui/resources/icons/icongen.py
++++ b/ldoce5viewer/qtgui/resources/icons/icongen.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python3
+
+ import sys
+
+@@ -12,22 +12,22 @@
+ def cast_gradation(img, b1, b2):
+ (w, h) = img.size
+ pix = img.load()
+- for y in xrange(h):
++ for y in range(h):
+ c = b1 + (b2 - b1) * (float(y) / (h - 1))
+- for x in xrange(w):
++ for x in range(w):
+ pix[x, y] += int(c + 0.5)
+ return img
+
+
+ def make_inset_shadow(alpha):
+ mc = alpha.copy()
+- for i in xrange(6):
++ for i in range(6):
+ mc = mc.filter(ImageFilter.SMOOTH_MORE)
+ mc = ImageChops.subtract(alpha, mc)
+ mcb = ImageEnhance.Brightness(mc).enhance(0.35)
+
+ m1 = alpha.copy()
+- for i in xrange(6):
++ for i in range(6):
+ m1 = m1.filter(ImageFilter.SMOOTH_MORE)
+ m1 = ImageChops.offset(m1, 0, OFFSET_S)
+ m1 = ImageChops.subtract(alpha, m1)
+@@ -40,13 +40,13 @@ def make_inset_shadow(alpha):
+
+ def make_highlight(alpha):
+ mc = alpha.copy()
+- for i in xrange(3):
++ for i in range(3):
+ mc = mc.filter(ImageFilter.SMOOTH_MORE)
+ mc = ImageChops.subtract(mc, alpha)
+ mcb = ImageEnhance.Brightness(mc).enhance(0.35)
+
+ m1 = alpha.copy()
+- for i in xrange(2):
++ for i in range(2):
+ m1 = m1.filter(ImageFilter.SMOOTH_MORE)
+ m1 = ImageChops.offset(m1, 0, OFFSET_H)
+ m1 = ImageChops.subtract(m1, alpha)
diff --git a/ldoce5viewer.spec b/ldoce5viewer.spec
index 27c849c..cf50d23 100644
--- a/ldoce5viewer.spec
+++ b/ldoce5viewer.spec
@@ -4,7 +4,7 @@
Name: ldoce5viewer
Version: 0
-Release: 11.%{date}git%{shortcommit0}%{?dist}
+Release: 12.%{date}git%{shortcommit0}%{?dist}
Summary: Viewer Application for the Longman Dictionary (LDOCE 5)
License: GPLv3+ and Public Domain
URL:
https://forward-backward.co.jp/ldoce5viewer/
@@ -17,6 +17,9 @@ Patch0:
https://patch-diff.githubusercontent.com/raw/ciscorn/ldoce5viewe
Patch1:
https://patch-diff.githubusercontent.com/raw/ciscorn/ldoce5viewer/pull/69...
# Not sent upstream as it's read-only now.
Patch2:
https://github.com/dwrobel/ldoce5viewer/commit/85690cc4bec3f0c9352d64a215...
+# Adopt to use new inkscape (>=1.0) (use -o instead of -o option)
+# Not sent upstream as it's read-only now.
+Patch3:
https://github.com/dwrobel/ldoce5viewer/commit/e17a19a86c5f7a02c6005fe0eb...
BuildArch: noarch
@@ -138,6 +141,9 @@ appstream-util validate-relax --nonet
%{buildroot}/%{_datadir}/appdata/*.appdata
%changelog
+* Wed Jan 08 2020 Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl> -
0-12.20180309git377ff48
+- Adopt to use new inkscape (>=1.0)
+
* Tue Jan 07 2020 Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl> -
0-11.20180309git377ff48
- Add missing patch