about summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
authorSerhii Khoma <srghma@gmail.com>2019-03-17 22:18:41 +0200
committerSerhii Khoma <srghma@gmail.com>2019-03-17 22:18:41 +0200
commit1d7a5d87ea4ce4178d2bb52208ccd66f523007b5 (patch)
tree07a725387f1964766f9c2ea7e246321696624139 /pkgs/applications/graphics
parent11c3040ec97e1b56157c1a00a54b52eddbab0fe1 (diff)
jpeg-archive: init at 2.2.0
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/jpeg-archive/default.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/jpeg-archive/default.nix b/pkgs/applications/graphics/jpeg-archive/default.nix
new file mode 100644
index 0000000000000..8002da5570354
--- /dev/null
+++ b/pkgs/applications/graphics/jpeg-archive/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, mozjpeg, makeWrapper, coreutils, parallel, findutils }:
+
+stdenv.mkDerivation rec {
+  name = "jpeg-archive-${version}";
+  version = "2.2.0"; # can be found here https://github.com/danielgtaylor/jpeg-archive/blob/master/src/util.c#L15
+
+  # update with
+  # nix-prefetch-git https://github.com/danielgtaylor/jpeg-archive
+  src = fetchFromGitHub {
+    owner = "danielgtaylor";
+    repo = "jpeg-archive";
+    rev = "8da4bf76b6c3c0e11e4941294bfc1857c119419b";
+    sha256 = "1639y9qp2ls80fzimwmwds792q8rq5p6c14c0r4jswx4yp6dcs33";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ mozjpeg ];
+
+  prePatch = ''
+    # allow override LIBJPEG
+    substituteInPlace Makefile --replace 'LIBJPEG =' 'LIBJPEG ?='
+  '';
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "MOZJPEG_PREFIX=${mozjpeg}"
+    "LIBJPEG=${mozjpeg}/lib/libjpeg.so"
+  ];
+
+  postInstall = ''
+    wrapProgram $out/bin/jpeg-archive \
+      --set PATH "$out/bin:${coreutils}/bin:${parallel}/bin:${findutils}/bin"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Utilities for archiving photos for saving to long term storage or serving over the web";
+    homepage    = "https://github.com/danielgtaylor/jpeg-archive";
+    # license = ...; # mixed?
+    maintainers = [ maintainers.srghma ];
+    platforms   = platforms.all;
+  };
+}