Subject: [PATCH] gnu: Add okular.

From: Z572 <[email-masked]>
Date: Sat, 12 Dec 2020 18:54:31 +0800

diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index a23c677880..b533ea96c1 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2020 Marius Bakke <[email-masked]>
 ;;; Copyright © 2020 Vinicius Monego <[email-masked]>
+;;; Copyright © 2020 Zheng Junjie <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
   #:use-module (guix download)
   #:use-module (guix utils)
   #:use-module (guix git-download)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
@@ -314,6 +316,31 @@ e-books for convenient reading.")
                    license:silofl1.1
                    license:cc-by-sa3.0))))
 
+(define-public ebook-tools
+  (package
+    (name "ebook-tools")
+    (version "0.2.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/ebook-tools/"
+                           name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1bi7wsz3p5slb43kj7lgb3r6lb91lvb6ldi556k4y50ix6b5khyb"))))
+    (arguments
+     `(#:tests? #f))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libzip" ,libzip)
+       ("libxml2" ,libxml2)))
+    (home-page "http://ebook-tools.sourceforge.net")
+    (synopsis "Tools and library for dealing with various ebook file formats")
+    (description "Tools and library for dealing with various ebook file formats")
+    (license license:expat)))
+
 (define-public liblinebreak
   (package
     (name "liblinebreak")
diff --git a/gnu/packages/kde.scm b/gnu/packages/kde.scm
index 1f747ecfd4..5bde6ebcc8 100644
--- a/gnu/packages/kde.scm
+++ b/gnu/packages/kde.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2020 Marius Bakke <[email-masked]>
 ;;; Copyright © 2020 Michael Rohleder <[email-masked]>
 ;;; Copyright © 2020 Prafulla Giri <[email-masked]>
+;;; Copyright © 2020 Zheng Junjie <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -765,6 +766,30 @@ Python, PHP, and Perl.")
     (description "Runtime library for kdegames")
     (license (list license:gpl2+  license:fdl1.2+))))
 
+(define-public kdegraphics-mobipocket
+  (package
+    (name "kdegraphics-mobipocket")
+    (version "20.12.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://kde/stable/release-service/" version
+                           "/src/" name "-" version ".tar.xz"))
+       (file-name (string-append name "-" version "-checkout"))
+       (sha256
+        (base32 "0fm880lp9g60zgrkjyh4jxws6x0s77l9ia4f8pza3w8sxcbbswk5"))))
+    (arguments
+     `(#:tests? #f))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (inputs
+     `(("kio" ,kio)
+       ("qtbase" ,qtbase)))
+    (home-page "https://apps.kde.org/graphics/")
+    (synopsis "Tools and library for dealing with various ebook file formats")
+    (description "Tools and library for dealing with various ebook file formats")
+    (license license:gpl2+)))
 (define-public zeroconf-ioslave
   (package
     (name "zeroconf-ioslave")
diff --git a/gnu/packages/kde.scm b/gnu/packages/kde.scm
index 5bde6ebcc8..acb5b4da30 100644
--- a/gnu/packages/kde.scm
+++ b/gnu/packages/kde.scm
@@ -790,6 +790,30 @@ Python, PHP, and Perl.")
     (synopsis "Tools and library for dealing with various ebook file formats")
     (description "Tools and library for dealing with various ebook file formats")
     (license license:gpl2+)))
+(define-public libkexiv2
+  (package
+    (name "libkexiv2")
+    (version "20.12.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://kde/stable/release-service/" version
+                           "/src/" name "-" version ".tar.xz"))
+       (file-name (string-append name "-" version "-checkout"))
+       (sha256
+        (base32 "0k0iinf7s8qlk3fwvq7iic1b4zn2gm65rfd58q7d3wb1i1j2hjjk"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("exiv2" ,exiv2)
+       ("qtbase" ,qtbase)))
+    (home-page "https://apps.kde.org/graphics/")
+    (synopsis "A library to manipulate pictures metadata")
+    (description "A library to manipulate pictures metadata")
+    (license license:gpl2+)))
+
 (define-public zeroconf-ioslave
   (package
     (name "zeroconf-ioslave")
diff --git a/gnu/packages/kde.scm b/gnu/packages/kde.scm
index acb5b4da30..55a78a62ad 100644
--- a/gnu/packages/kde.scm
+++ b/gnu/packages/kde.scm
@@ -62,6 +62,9 @@
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages pdf)
+  #:use-module (gnu packages ebook)
+  #:use-module (gnu packages djvu)
+  #:use-module (gnu packages markup)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages photo)
   #:use-module (gnu packages pkg-config)
@@ -790,6 +793,67 @@ Python, PHP, and Perl.")
     (synopsis "Tools and library for dealing with various ebook file formats")
     (description "Tools and library for dealing with various ebook file formats")
     (license license:gpl2+)))
+
+(define-public okular
+  (package
+    (name "okular")
+    (version "20.12.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://kde/stable/release-service/" version
+                           "/src/" name "-" version ".tar.xz"))
+       (file-name (string-append name "-" version "-checkout"))
+       (sha256
+        (base32 "1kib8zqfd9qgqn7bz88hay2j3kcvarnlfyr3a417pi6rvaam6b4p"))))
+    (build-system qt-build-system)
+    (arguments
+     `(#:tests? #f))
+    (native-inputs
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("ebook-tools" ,ebook-tools)
+       ("discount" ,discount)
+       ("djvulibre" ,djvulibre)
+       ("kactivities" ,kactivities)
+       ("khtml" ,khtml)
+       ("chmlib" ,chmlib)
+       ("kdoctools" ,kdoctools)
+       ("kdegraphics-mobipocket" ,kdegraphics-mobipocket)
+       ("karchive" ,karchive)
+       ("kbookmarks" ,kbookmarks)
+       ("kcompletion" ,kcompletion)
+       ("kconfig" ,kconfig)
+       ("qtbase" ,qtbase)
+       ("kconfigwidgets" ,kconfigwidgets)
+       ("kcoreaddons" ,kcoreaddons)
+       ("kdbusaddons" ,kdbusaddons)
+       ("kiconthemes" ,kiconthemes)
+       ("kio" ,kio)
+       ("kparts" ,kparts)
+       ("kpty" ,kpty)
+       ("kwallet" ,kwallet)
+       ("kwindowsystem" ,kwindowsystem)
+       ("libkexiv2" ,libkexiv2)
+       ("libspectre" ,libspectre)
+       ("libzip" ,libzip)
+       ("phonon" ,phonon)
+       ("poppler" ,poppler)
+       ("qca" ,qca)
+       ("qtdeclarative" ,qtdeclarative)
+       ("qtsvg" ,qtsvg)
+       ("threadweaver" ,threadweaver)
+       ("kcrash" ,kcrash)
+       ("kjs" ,kjs)))
+    (home-page "https://kde.org/applications/graphics/okular/")
+    (synopsis "Document Viewer")
+    (description "
+Okular is a universal document viewer developed by KDE.
+ Okular works on multiple platforms, including but not limited to
+ Linux, Windows, macOS, *BSD, etc.")
+    (license license:gpl2+)))
+
 (define-public libkexiv2
   (package
     (name "libkexiv2")