2022-05-07 08:34:24 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, perl, perlPackages, libjpeg_original }:
|
2016-07-06 06:49:34 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "jpegrescan";
|
2022-05-07 08:34:24 +00:00
|
|
|
version = "unstable-2019-03-27";
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
2016-07-06 06:49:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kud";
|
|
|
|
repo = pname;
|
2022-05-07 08:34:24 +00:00
|
|
|
rev = "3a7de06feabeb3c3235c3decbe2557893c1abe51";
|
|
|
|
sha256 = "0cnl46z28lkqc5x27b8rpghvagahivrqcfvhzcsv9w1qs8qbd6dm";
|
2016-07-06 06:49:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-05-07 08:34:24 +00:00
|
|
|
wrapProgram $out/bin/jpegrescan \
|
|
|
|
--prefix PATH : "${libjpeg_original}/bin:" \
|
|
|
|
--prefix PERL5LIB : $PERL5LIB
|
2016-07-06 06:49:34 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ perlPackages.FileSlurp ];
|
|
|
|
|
2022-05-07 08:34:24 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2022-04-05 07:34:48 +00:00
|
|
|
|
2022-05-07 08:34:24 +00:00
|
|
|
buildInputs = [ perl ];
|
2016-07-06 06:49:34 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-05-07 08:34:24 +00:00
|
|
|
description = "Losslessly shrink any JPEG file";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/kud/jpegrescan";
|
2016-07-06 06:49:34 +00:00
|
|
|
license = licenses.publicDomain;
|
2022-05-07 08:34:24 +00:00
|
|
|
maintainers = with maintainers; [ ramkromberg ];
|
2016-07-06 06:49:34 +00:00
|
|
|
platforms = platforms.all;
|
2022-05-07 08:34:24 +00:00
|
|
|
mainProgram = "jpegrescan";
|
2016-07-06 06:49:34 +00:00
|
|
|
};
|
|
|
|
}
|