From c7b21cd1911f880630102996b54956d19c974295 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@nh2.me>
Date: Wed, 2 May 2018 22:35:15 +0200
Subject: [PATCH] epeg: init at 0.9.1.042
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Niklas Hambüchen <mail@nh2.me>
---
 pkgs/applications/graphics/epeg/default.nix | 31 +++++++++++++++++++++
 pkgs/top-level/all-packages.nix             |  2 ++
 2 files changed, 33 insertions(+)
 create mode 100644 pkgs/applications/graphics/epeg/default.nix

diff --git a/pkgs/applications/graphics/epeg/default.nix b/pkgs/applications/graphics/epeg/default.nix
new file mode 100644
index 000000000000..02528a43e31b
--- /dev/null
+++ b/pkgs/applications/graphics/epeg/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, pkgconfig, libtool, autoconf, automake
+, libjpeg, libexif
+}:
+
+stdenv.mkDerivation rec {
+  name = "epeg-0.9.1.042"; # version taken from configure.ac
+
+  src = fetchFromGitHub {
+    owner = "mattes";
+    repo = "epeg";
+    rev = "248ae9fc3f1d6d06e6062a1f7bf5df77d4f7de9b";
+    sha256 = "14ad33w3pxrg2yfc2xzyvwyvjirwy2d00889dswisq8b84cmxfia";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ pkgconfig libtool autoconf automake ];
+
+  propagatedBuildInputs = [ libjpeg libexif ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/mattes/epeg;
+    description = "Insanely fast JPEG/ JPG thumbnail scaling";
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ nh2 ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index d1c4e2e09a84..fcc6967b08fb 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -15571,6 +15571,8 @@ with pkgs;
 
   epdfview = callPackage ../applications/misc/epdfview { };
 
+  epeg = callPackage ../applications/graphics/epeg/default.nix { };
+
   inherit (gnome3) epiphany;
 
   epic5 = callPackage ../applications/networking/irc/epic5 { };