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