pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

foliate: Fixes kindle file format not opening up in foliate.



Module Name:	pkgsrc-wip
Committed By:	Santhosh Raju <fox%NetBSD.org@localhost>
Pushed By:	fox
Date:		Mon Oct 7 17:54:41 2019 -0500
Changeset:	d1f44fc6e49c5d317b2cb46ff5e2659b03f4a0c0

Modified Files:
	foliate/Makefile
	foliate/distinfo
Added Files:
	foliate/patches/patch-src_assets_KindleUnpack_kindleunpack.py
	foliate/patches/patch-src_main.js

Log Message:
foliate: Fixes kindle file format not opening up in foliate.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d1f44fc6e49c5d317b2cb46ff5e2659b03f4a0c0

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 foliate/Makefile                                       |  7 +++++++
 foliate/distinfo                                       |  2 ++
 .../patch-src_assets_KindleUnpack_kindleunpack.py      | 18 ++++++++++++++++++
 foliate/patches/patch-src_main.js                      | 15 +++++++++++++++
 4 files changed, 42 insertions(+)

diffs:
diff --git a/foliate/Makefile b/foliate/Makefile
index 4f3ca6d564..cc1e911194 100644
--- a/foliate/Makefile
+++ b/foliate/Makefile
@@ -14,6 +14,13 @@ USE_TOOLS+=	pkg-config msgfmt xgettext
 
 BUILD_DEPENDS+=	gjs>=1.52.0:../../lang/gjs
 
+SUBST_CLASSES+=		pyvers
+SUBST_MESSAGE.pyvers=	Substitute the correct python version.
+SUBST_STAGE.pyvers=	pre-configure
+SUBST_FILES.pyvers=	src/main.js
+SUBST_VARS.pyvers+=	PYVERSSUFFIX
+#SUBST_SED.pyvers+=	-e 's/@PYVERSSUFFIX@/${PYVERSSUFFIX}/g'
+
 # XXX fails without GNU msgfmt
 _TOOLS_USE_PKGSRC.msgfmt=	yes
 
diff --git a/foliate/distinfo b/foliate/distinfo
index ff2ad5fdf8..0e9b70f052 100644
--- a/foliate/distinfo
+++ b/foliate/distinfo
@@ -4,3 +4,5 @@ SHA1 (foliate-1.5.3.tar.gz) = 04303d725550409259417ba563f2e363a13c8b3f
 RMD160 (foliate-1.5.3.tar.gz) = 77c0e8bfb0f641bb2ca90b5b06278ebd66d61579
 SHA512 (foliate-1.5.3.tar.gz) = 806640ab78794208d344145bad22c668cf17454194707f06caacc368d7f440bfdce6b3801cf8a9320d10b2a441fe4ad43e87a869107c3ed5c0af48e958638c7b
 Size (foliate-1.5.3.tar.gz) = 1486573 bytes
+SHA1 (patch-src_assets_KindleUnpack_kindleunpack.py) = 2b558fe842669982aec6087e9ce1c72f1fc52315
+SHA1 (patch-src_main.js) = 0d5f5be182af898bbe64d25a71f05fdf00a626d5
diff --git a/foliate/patches/patch-src_assets_KindleUnpack_kindleunpack.py b/foliate/patches/patch-src_assets_KindleUnpack_kindleunpack.py
new file mode 100644
index 0000000000..5307d37f2e
--- /dev/null
+++ b/foliate/patches/patch-src_assets_KindleUnpack_kindleunpack.py
@@ -0,0 +1,18 @@
+$NetBSD$
+
+Fixes unicode display correctly, this prevents crashing on opening
+(kindle format files).
+
+--- src/assets/KindleUnpack/kindleunpack.py.orig	2019-10-07 20:49:16.446537408 +0000
++++ src/assets/KindleUnpack/kindleunpack.py
+@@ -952,8 +952,8 @@ def main(argv=unicode_argv()):
+     global SPLIT_COMBO_MOBIS
+ 
+     print("KindleUnpack v0.82")
+-    print("   Based on initial mobipocket version Copyright © 2009 Charles M. Hannum <root%ihack.net@localhost>")
+-    print("   Extensive Extensions and Improvements Copyright © 2009-2014 ")
++    print("   Based on initial mobipocket version Copyright © 2009 Charles M. Hannum <root%ihack.net@localhost>".encode("utf-8"))
++    print("   Extensive Extensions and Improvements Copyright © 2009-2014 ".encode("utf-8"))
+     print("       by:  P. Durrant, K. Hendricks, S. Siebert, fandrieu, DiapDealer, nickredding, tkeo.")
+     print("   This program is free software: you can redistribute it and/or modify")
+     print("   it under the terms of the GNU General Public License as published by")
diff --git a/foliate/patches/patch-src_main.js b/foliate/patches/patch-src_main.js
new file mode 100644
index 0000000000..7fee9a9c89
--- /dev/null
+++ b/foliate/patches/patch-src_main.js
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Adds variable to help substitute the correct python version suffix.
+
+--- src/main.js.orig	2019-10-07 20:50:20.174655390 +0000
++++ src/main.js
+@@ -1796,7 +1796,7 @@ class BookViewerWindow {
+     }
+     open(fileName, realFileName, inputType = 'epub') {
+         if (kindleExts.some(x => fileName.endsWith(x))) {
+-            const python = GLib.find_program_in_path('python') || GLib.find_program_in_path('python3')
++            const python = GLib.find_program_in_path('python@PYVERSSUFFIX@')
+             const kindleUnpack = pkg.pkgdatadir + '/assets/KindleUnpack/kindleunpack.py'
+ 
+             const dir = GLib.dir_make_tmp(null)


Home | Main Index | Thread Index | Old Index