1 { lib, stdenv, fetchurl, unzip, makeWrapper, perlPackages
2 , coreutils, zip, imagemagick, pngcrush, lcms2
5 # TODO: add optional dependencies (snippet from fgallery source):
7 # if(system("jpegoptim -V >/dev/null 2>&1")) {
11 stdenv.mkDerivation rec {
16 url = "https://www.thregr.org/~wavexx/software/fgallery/releases/fgallery-${version}.zip";
17 hash = "sha256-FvF0wkRe3wTPUG9/GEBxkaxvZ1B4wEd9kI9rURHKxn0=";
20 nativeBuildInputs = [ makeWrapper unzip ];
21 buildInputs = (with perlPackages; [ perl ImageExifTool CpanelJSONXS ]);
24 substituteInPlace Makefile \
30 mkdir -p "$out/share/fgallery"
32 cp -r * "$out/share/fgallery"
33 ln -s -r "$out/share/fgallery/fgallery" "$out/bin/fgallery"
35 # Don't preserve file attributes when copying files to output directories.
36 # (fgallery copies parts of itself to each output directory, and without
37 # this change the read-only nix store causes some bumps in the workflow.)
38 sed -i -e "s|'cp'|'cp', '--no-preserve=all'|g" "$out/share/fgallery/fgallery"
40 wrapProgram "$out/share/fgallery/fgallery" \
41 --set PERL5LIB "$PERL5LIB" \
42 --set PATH "${lib.makeBinPath
43 [ coreutils zip imagemagick pngcrush lcms2 facedetect fbida ]}"
47 description = "Static photo gallery generator";
48 homepage = "https://www.thregr.org/~wavexx/software/fgallery/";
49 license = licenses.gpl2Only;
50 platforms = platforms.all;
51 maintainers = [ maintainers.bjornfor ];
52 mainProgram = "fgallery";