From 0c91ff6f1ef312a814dd439f4c2353c04fbf6f0f Mon Sep 17 00:00:00 2001 From: Petr Hodina 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. 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