about summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-07-07 21:55:51 +0200
committerGitHub <noreply@github.com>2022-07-07 21:55:51 +0200
commit2264184667416499f5da5e22f8940b9a4e8a16cd (patch)
treed9d235413ebbc3142dc4d7b9242dbbf8fb79d2ca /pkgs/applications/office
parente0c66dad5c69e59fd03fa6ffed41fed4f77d2bcb (diff)
parent4950cb01e533fc7d46c5e5f17fcee9260987c891 (diff)
Merge pull request #176272 from necessarily-equal/booklet-imposer
bookletimposer: add new package
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/bookletimposer/configdir.patch20
-rw-r--r--pkgs/applications/office/bookletimposer/default.nix44
-rw-r--r--pkgs/applications/office/bookletimposer/i18n.patch19
3 files changed, 83 insertions, 0 deletions
diff --git a/pkgs/applications/office/bookletimposer/configdir.patch b/pkgs/applications/office/bookletimposer/configdir.patch
new file mode 100644
index 0000000000000..5f7133f79a10c
--- /dev/null
+++ b/pkgs/applications/office/bookletimposer/configdir.patch
@@ -0,0 +1,20 @@
+diff --git a/lib/bookletimposer/config.py b/lib/bookletimposer/config.py
+index 8f107a4..d4d335d 100644
+--- a/lib/bookletimposer/config.py
++++ b/lib/bookletimposer/config.py
+@@ -45,14 +41,7 @@ def debug(msg):
+ 
+ 
+ def get_sharedir():
+-    if debug_enabled and os.path.exists(os.path.join("/", "usr", "local",
+-                                                     "share",
+-                                                     "bookletimposer")):
+-        return os.path.join("/", "usr", "local", "share")
+-    elif os.path.exists(os.path.join("/", "usr", "share", "bookletimposer")):
+-        return os.path.join("/", "usr", "share")
+-    else:
+-        return ""
++    return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", "share"))
+ 
+ 
+ def get_datadir():
diff --git a/pkgs/applications/office/bookletimposer/default.nix b/pkgs/applications/office/bookletimposer/default.nix
new file mode 100644
index 0000000000000..806a9f76addf8
--- /dev/null
+++ b/pkgs/applications/office/bookletimposer/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, fetchFromGitLab
+, python3
+, intltool
+, pandoc
+, gobject-introspection
+, wrapGAppsHook
+, gtk3
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "bookletimposer";
+  version = "0.3.1";
+
+  src = fetchFromGitLab {
+    domain = "git.codecoop.org";
+    owner = "kjo";
+    repo = "bookletimposer";
+    rev = version;
+    sha256 = "sha256-AEpvsFBJfyqLucC0l4AN/nA2+aYBR50BEgAcNDJBSqg=";
+  };
+
+  patches = [
+    ./i18n.patch
+    ./configdir.patch
+  ];
+
+  nativeBuildInputs = [ intltool pandoc wrapGAppsHook ];
+
+  buildInputs = [ gobject-introspection ];
+
+  propagatedBuildInputs = [
+     gtk3
+     (python3.withPackages (ps: with ps; [ distutils_extra pypdf2 pygobject3 ]))
+  ];
+
+  meta = {
+    homepage = "https://kjo.herbesfolles.org/bookletimposer/";
+    description = "A utility to achieve some basic imposition on PDF documents, especially designed to work on booklets";
+    platforms = lib.platforms.linux;
+    license = "GPL-3.0-or-later";
+    maintainers = with lib.maintainers; [ afontain ];
+  };
+}
diff --git a/pkgs/applications/office/bookletimposer/i18n.patch b/pkgs/applications/office/bookletimposer/i18n.patch
new file mode 100644
index 0000000000000..db53372d6ed2f
--- /dev/null
+++ b/pkgs/applications/office/bookletimposer/i18n.patch
@@ -0,0 +1,19 @@
+--- a/setup.cfg	2022-06-04 17:10:10.477581502 +0200
++++ b/setup.cfg	2022-06-04 17:10:15.185594382 +0200
+@@ -1,6 +1,3 @@
+ [build]
+ icons=False
+ help=True
+-
+-[build_i18n]
+-domain=bookletimposer
+--- a/setup.py	2022-06-04 17:25:18.020872735 +0200
++++ b/setup.py	2022-06-04 17:25:23.075884898 +0200
+@@ -115,7 +115,6 @@ It allows:
+       requires = ['gtk', 'PyPDF2'],
+       cmdclass = { "build" :            build_extra.build_extra,
+                    "build_uiheaders" :  build_uiheaders,
+-                   "build_i18n" :       build_i18n.build_i18n,
+                    "build_help" :       build_help.build_help,
+                    "build_icons" :      build_icons.build_icons,
+                    "build_man" :        build_man,