about summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
authorThiago Kenji Okada <thiagokokada@gmail.com>2022-06-05 18:05:40 +0100
committerThiago Kenji Okada <thiagokokada@gmail.com>2022-06-05 18:05:40 +0100
commit5a8e7406ca7d56b1b1d8590d44ca1966887eb9ed (patch)
treed73168e69893b9cc72a88de4b94627ae97b35b72 /pkgs/applications/graphics
parentec6dd63f838dc264d69409a0193d1127feeaefd1 (diff)
mcomix: init at 2.0.2
This was removed in https://github.com/NixOS/nixpkgs/pull/74295 because
it was compatible with Python 2 only. mcomix3 was a fork originally
introduced to port it to Python 3, however upstream eventually released
version 2.x, porting it to Python 3.
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/mcomix/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/mcomix/default.nix b/pkgs/applications/graphics/mcomix/default.nix
new file mode 100644
index 0000000000000..530ae0013b5a5
--- /dev/null
+++ b/pkgs/applications/graphics/mcomix/default.nix
@@ -0,0 +1,64 @@
+{ lib
+, fetchurl
+, gdk-pixbuf
+, gobject-introspection
+, gtk3
+, mcomix
+, python3
+, testVersion
+, wrapGAppsHook
+
+# Recommended Dependencies:
+, lhasa
+, mupdf
+, p7zip
+, unrar
+, unrarSupport ? false  # unfree software
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "mcomix";
+  version = "2.0.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mcomix/${pname}-${version}.tar.gz";
+    sha256 = "sha256-7zjQcT5WoHxy+YzCDJ6s2ngOOfO4L9exuqBqacecClg=";
+  };
+
+  buildInputs = [ gobject-introspection gtk3 gdk-pixbuf ];
+  nativeBuildInputs = [ wrapGAppsHook ];
+  propagatedBuildInputs = (with python3.pkgs; [ pillow pygobject3 pycairo ]);
+
+  # Tests are broken
+  doCheck = false;
+
+  # Correct wrapper behavior, see https://github.com/NixOS/nixpkgs/issues/56943
+  # until https://github.com/NixOS/nixpkgs/pull/102613
+  strictDeps = false;
+
+  # prevent double wrapping
+  dontWrapGApps = true;
+
+  preFixup = ''
+    makeWrapperArgs+=(
+      "''${gappsWrapperArgs[@]}"
+      "--prefix" "PATH" ":" "${lib.makeBinPath ([ p7zip lhasa mupdf ] ++ lib.optional (unrarSupport) unrar)}"
+    )
+  '';
+
+  passthru.tests.version = testVersion {
+    package = mcomix;
+  };
+
+  meta = with lib; {
+    description = "Comic book reader and image viewer";
+    longDescription = ''
+      User-friendly, customizable image viewer, specifically designed to handle
+      comic books and manga supporting a variety of container formats
+      (including CBR, CBZ, CB7, CBT, LHA and PDF)
+    '';
+    homepage = "https://sourceforge.net/projects/mcomix/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ thiagokokada ];
+  };
+}