66 lines
1.2 KiB
Nix
66 lines
1.2 KiB
Nix
{ fetchFromGitHub
|
|
, lib
|
|
, makeWrapper
|
|
, stdenv
|
|
|
|
# Dependencies
|
|
, bash
|
|
, bc
|
|
, coreutils
|
|
, diffutils
|
|
, exiftool
|
|
, gnugrep
|
|
, gnused
|
|
, imagemagick
|
|
, xdg-utils
|
|
, xdpyinfo
|
|
}:
|
|
|
|
let
|
|
diffImagePath = lib.makeBinPath [
|
|
bash
|
|
bc
|
|
coreutils
|
|
diffutils
|
|
exiftool
|
|
gnugrep
|
|
gnused
|
|
imagemagick
|
|
xdg-utils
|
|
xdpyinfo
|
|
];
|
|
gitDiffImagePath = lib.makeBinPath [
|
|
bash
|
|
coreutils
|
|
diffutils
|
|
imagemagick
|
|
];
|
|
in
|
|
stdenv.mkDerivation {
|
|
pname = "git-diff-image";
|
|
version = "unstable-2022-11-17";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ewanmellor";
|
|
repo = "git-diff-image";
|
|
rev = "f2663bc34991f6c2793dc20a1f2889ad9577a702";
|
|
hash = "sha256-0+iLE1v5aZhwrHGd9ifJvuMLq3IVhI2AM4HtoAke+rE=";
|
|
};
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
installPhase = ''
|
|
install -D -m755 -t $out/bin \
|
|
$src/diff-image \
|
|
$src/git_diff_image
|
|
wrapProgram $out/bin/diff-image --prefix PATH : ${diffImagePath}
|
|
wrapProgram $out/bin/git_diff_image --prefix PATH : ${gitDiffImagePath}
|
|
'';
|
|
|
|
meta = {
|
|
description = "An extension to 'git diff' that provides support for diffing images.";
|
|
homepage = "https://github.com/ewanmellor/git-diff-image";
|
|
license = lib.licenses.cc0;
|
|
mainProgram = "diff-image";
|
|
};
|
|
}
|