[PATCH 1/3] gnu: Add kindle-tool.

  • Open
  • quality assurance status badge
Details
One participant
  • phodina
Owner
unassigned
Submitted by
phodina
Severity
normal
P
P
phodina wrote on 28 Dec 2022 02:09
(name . Guix Patches)(address . guix-patches@gnu.org)
IcFHJ5nlh_IRFprLQzLEYqc2D8H4Bo6IMqjbSD5M0Wm_4XnOXhuIItSl8xn4SiDXdo-0WctbtJ3uLuSB1TtztLpFujH0dK3xxq_UlyynXkM=@protonmail.com
Hello,

here are 3 patches for better ebook experience without DRM and on mobile devices :-)

----
Petr
Attachment: file
From f04f0eb6acc4367141e117d19eba7a72e5ef714b Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 19 Jun 2022 11:03:02 +0200
Subject: [PATCH 1/3] gnu: Add kindle-tool.

* gnu/packages/ebook.scm (kindle-tool): New variable.

Toggle diff (70 lines)
diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index 8dff0f2ec8..c6f3136405 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -9,7 +9,7 @@
;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2020 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2021 la snesne <lasnesne@lagunposprasihopre.org>
-;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2021, 2022 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2021 Mathieu Laparie <mlaparie@disr.it>
;;;
;;; This file is part of GNU Guix.
@@ -42,6 +42,7 @@ (define-module (gnu packages ebook)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages bash)
+ #:use-module (gnu packages backup)
#:use-module (gnu packages compression)
#:use-module (gnu packages curl)
#:use-module (gnu packages databases)
@@ -62,6 +63,7 @@ (define-module (gnu packages ebook)
#:use-module (gnu packages language)
#:use-module (gnu packages libusb)
#:use-module (gnu packages libreoffice)
+ #:use-module (gnu packages nettle)
#:use-module (gnu packages music)
#:use-module (gnu packages pantheon)
#:use-module (gnu packages pdf)
@@ -420,6 +422,38 @@ (define-public inkbox
(description "This package provides InkBox eBook reader.")
(license license:gpl3)))
+(define-public kindle-tool
+ ;; last release from 2018
+ (let ((commit "ad7300390b0e641d2d6c158f1bd7109bedb14425")
+ (revision "1"))
+ (package
+ (name "kindle-tool")
+ (version "1.6.5")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/NiLuJe/KindleTool")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0qywyrb6l5a5xhm2n2m4zjp13dmvz41xbpxijy0938j32c6nnlfl"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:tests? #f
+ #:make-flags #~(list (string-append "DESTDIR="
+ #$output) "PREFIX="
+ (string-append "CC="
+ #$(cc-for-target)))
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure))))
+ (inputs (list zlib libarchive nettle))
+ (home-page "https://github.com/NiLuJe/KindleTool")
+ (synopsis "Tool for creating and extracting Kindle updates")
+ (description "This package provides tools for creating and extracting
+Kindle updates.")
+ (license license:gpl3+))))
+
(define-public liblinebreak
(package
(name "liblinebreak")
--
2.38.1
From 0c91ff6f1ef312a814dd439f4c2353c04fbf6f0f Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 19 Jun 2022 11:14:39 +0200
Subject: [PATCH 2/3] gnu: Add calibre-plugin-dedrm.

* gnu/packages/ebook.scm (calibre-plugin-dedrm): New variable.

Toggle diff (73 lines)
diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index c6f3136405..d0cd08c8c6 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -360,6 +360,66 @@ (define-public calibre
license:silofl1.1
license:cc-by-sa3.0))))
+(define-public calibre-plugin-dedrm
+ (package
+ (name "calibre-plugin-dedrm")
+ (version "10.0.3")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/noDRM/DeDRM_tools")
+ (commit (string-append "v" version))))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Unbundle shared libs
+ (with-directory-excursion "DeDRM_plugin"
+ (delete-file "alfcrypto64.dll")
+ (delete-file "alfcrypto.dll")
+ (delete-file "libalfcrypto64.so")
+ (delete-file "libalfcrypto32.so")
+ (delete-file "libalfcrypto.dylib"))))
+ (sha256
+ (base32
+ "12rqy6qj9r0zwzyxsflk5ibfwajw0cxjy3jkfxwd0r9dn8vmr906"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:tests? #f ;no test suite
+ `#:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'unzip-alfcrypto
+ (lambda* (#:key inputs #:allow-other-keys)
+ (with-directory-excursion "DeDRM_plugin"
+ (invoke (search-input-file inputs "/bin/unzip")
+ "alfcrypto_src.zip"))))
+ (replace 'build
+ (lambda* (#:key inputs #:allow-other-keys)
+ (with-directory-excursion "DeDRM_plugin/alfcrypto_src"
+ (chmod "makelinux.sh" #o755)
+ (invoke (search-input-file inputs "/bin/bash")
+ "./makelinux.sh"))))
+ (replace 'install
+ (lambda* (#:key inputs #:allow-other-keys)
+ (install-file "DeDRM_plugin//alfcrypto_src/libalfcrypto.so"
+ ".")
+ (invoke "./make_release.py"
+ #$(package-version calibre-plugin-dedrm))
+ (invoke (search-input-file inputs "/bin/unzip")
+ (string-append "DeDRM_tools_"
+ #$(package-version
+ calibre-plugin-dedrm) ".zip")
+ "DeDRM_plugin.zip")
+ (mkdir-p (string-append #$output
+ "/share/calibre/system-plugins"))
+ (install-file "DeDRM_plugin.zip"
+ (string-append #$output
+ "/share/calibre/system-plugins")))))))
+ (native-inputs (list bash-minimal unzip))
+ (home-page "https://github.com/noDRM/DeDRM_tools")
+ (synopsis "DeDRM tools for ebooks")
+ (description "This package contains tools to remove DRM from various ebook
+formats.")
+ (license license:gpl3)))
+
(define-public ebook-tools
(package
(name "ebook-tools")
--
2.38.1
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 60371@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 60371
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch