depot/third_party/nixpkgs/pkgs/applications/graphics/jpegrescan/default.nix
Default email 2ce5db779a Project import generated by Copybara.
GitOrigin-RevId: 48037fd90426e44e4bf03e6479e88a11453b9b66
2022-05-18 16:49:53 +02:00

47 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, makeWrapper, perl, perlPackages, libjpeg_original }:
stdenv.mkDerivation rec {
pname = "jpegrescan";
version = "unstable-2019-03-27";
dontBuild = true;
dontConfigure = true;
src = fetchFromGitHub {
owner = "kud";
repo = pname;
rev = "3a7de06feabeb3c3235c3decbe2557893c1abe51";
sha256 = "0cnl46z28lkqc5x27b8rpghvagahivrqcfvhzcsv9w1qs8qbd6dm";
};
patchPhase = ''
patchShebangs jpegrescan
'';
installPhase = ''
mkdir -p $out/share/jpegrescan
mv README.md $out/share/jpegrescan/
mkdir $out/bin
mv jpegrescan $out/bin
chmod +x $out/bin/jpegrescan
wrapProgram $out/bin/jpegrescan \
--prefix PATH : "${libjpeg_original}/bin:" \
--prefix PERL5LIB : $PERL5LIB
'';
propagatedBuildInputs = [ perlPackages.FileSlurp ];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl ];
meta = with lib; {
description = "Losslessly shrink any JPEG file";
homepage = "https://github.com/kud/jpegrescan";
license = licenses.publicDomain;
maintainers = with maintainers; [ ramkromberg ];
platforms = platforms.all;
mainProgram = "jpegrescan";
};
}