about summary refs log tree commit diff
path: root/pkgs/applications/misc/metamorphose2/default.nix
diff options
context:
space:
mode:
authorRam Kromberg <ramkromberg@mail.com>2022-05-25 18:20:59 +0300
committerRam Kromberg <ramkromberg@mail.com>2022-05-25 20:22:14 +0300
commit61f655ccec8decd3df9efad56ec9756350a330cd (patch)
tree3add6baf4701362075e968b6eef76a5a0dbe5e68 /pkgs/applications/misc/metamorphose2/default.nix
parent8dc951af1d1a3de2031ac28fa0fd67852a44a215 (diff)
Revert "metamorphose2: drop"
This reverts commit 608cde3bd4485d8e0337dc9495ed3909459a052a.
Diffstat (limited to 'pkgs/applications/misc/metamorphose2/default.nix')
-rw-r--r--pkgs/applications/misc/metamorphose2/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/applications/misc/metamorphose2/default.nix b/pkgs/applications/misc/metamorphose2/default.nix
new file mode 100644
index 0000000000000..277d00fe050b9
--- /dev/null
+++ b/pkgs/applications/misc/metamorphose2/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchgit, makeWrapper, gettext
+, python27, python2Packages
+}:
+
+stdenv.mkDerivation {
+  pname = "metamorphose2";
+  version = "0.9.0beta";
+
+  # exif-py vendored via submodule
+  # mutagen vendored via copy
+  src = fetchgit {
+    url = "https://github.com/metamorphose/metamorphose2.git";
+    #rev = "refs/tags/v2.${version}"; #for when wxPython3 support is released
+    rev = "d2bdd6a86340b9668e93b35a6a568894c9909d68";
+    sha256 = "0ivcb3c8hidrff0ivl4dnwa2p3ihpqjdbvdig8dhg9mm5phdbabn";
+  };
+
+  postPatch = ''
+    substituteInPlace messages/Makefile \
+      --replace "\$(shell which msgfmt)" "${gettext}/bin/msgfmt"
+  '';
+
+  postInstall = ''
+    rm $out/bin/metamorphose2
+    makeWrapper ${python27}/bin/python $out/bin/metamorphose2 \
+      --prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath "$out") \
+      --add-flags "-O $out/share/metamorphose2/metamorphose2.py -w=3"
+  '';
+
+  buildInput = [ gettext python27 ];
+  nativeBuildInputs = [ makeWrapper ];
+  propagatedBuildInputs = [ python2Packages.wxPython python2Packages.pillow ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    description = "a graphical mass renaming program for files and folders";
+    homepage    = "https://github.com/metamorphose/metamorphose2";
+    license     = with licenses; gpl3Plus;
+    maintainers = with maintainers; [ ramkromberg ];
+    platforms   = with platforms; linux;
+  };
+}