summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSilvan Mosberger <infinisil@icloud.com>2018-05-19 23:33:09 +0200
committerxeji <36407913+xeji@users.noreply.github.com>2018-05-19 23:33:09 +0200
commitc8a8ecb5b38865ca3d703993e953ea50e36ede6d (patch)
treed06a02940bb1bcd20a04998a1f2d39495a75c5b4 /pkgs
parent548417c209d1e1531b1811d813c243c8cc8af259 (diff)
downloadnixlib-c8a8ecb5b38865ca3d703993e953ea50e36ede6d.tar
nixlib-c8a8ecb5b38865ca3d703993e953ea50e36ede6d.tar.gz
nixlib-c8a8ecb5b38865ca3d703993e953ea50e36ede6d.tar.bz2
nixlib-c8a8ecb5b38865ca3d703993e953ea50e36ede6d.tar.lz
nixlib-c8a8ecb5b38865ca3d703993e953ea50e36ede6d.tar.xz
nixlib-c8a8ecb5b38865ca3d703993e953ea50e36ede6d.tar.zst
nixlib-c8a8ecb5b38865ca3d703993e953ea50e36ede6d.zip
blockhash: init at 0.3 (#40737)
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/graphics/blockhash/default.nix32
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/tools/graphics/blockhash/default.nix b/pkgs/tools/graphics/blockhash/default.nix
new file mode 100644
index 000000000000..c48b85cedb26
--- /dev/null
+++ b/pkgs/tools/graphics/blockhash/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, python, pkgconfig, imagemagick }:
+
+stdenv.mkDerivation rec {
+  name = "blockhash-${version}";
+  version = "0.3";
+
+  src = fetchFromGitHub {
+    owner = "commonsmachinery";
+    repo = "blockhash";
+    rev = "v${version}";
+    sha256 = "15iwljpkykn2711jhls7cwkb23gk6iawlvvk4prl972wic2wlxcj";
+  };
+
+  nativeBuildInputs = [ python pkgconfig ];
+  buildInputs = [ imagemagick ];
+
+  configurePhase = "python waf configure --prefix=$out";
+  buildPhase = "python waf";
+  installPhase = "python waf install";
+
+  meta = with stdenv.lib; {
+    homepage = "http://blockhash.io/";
+    description = ''
+      This is a perceptual image hash calculation tool based on algorithm
+      descibed in Block Mean Value Based Image Perceptual Hashing by Bian Yang,
+      Fan Gu and Xiamu Niu.
+    '';
+    license = licenses.mit;
+    maintainers = [ maintainers.infinisil ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 8ac26897741d..1f8357ea9b80 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -844,6 +844,8 @@ with pkgs;
 
   blink = callPackage ../applications/networking/instant-messengers/blink { };
 
+  blockhash = callPackage ../tools/graphics/blockhash { };
+
   bluemix-cli = callPackage ../tools/admin/bluemix-cli { };
 
   libqmatrixclient = libsForQt5.callPackage ../development/libraries/libqmatrixclient { };