2019-10-31 21:02:34 +00:00
|
|
|
{ stdenv, fetchurl, fetchpatch, libjpeg }:
|
2009-10-11 16:52:14 +01:00
|
|
|
|
2015-12-18 23:29:32 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "jhead";
|
2019-01-03 18:13:34 +00:00
|
|
|
version = "3.03";
|
2009-10-11 16:52:14 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "http://www.sentex.net/~mwandel/jhead/${pname}-${version}.tar.gz";
|
2019-01-03 18:13:34 +00:00
|
|
|
sha256 = "1hn0yqcicq3qa20h1g313l1a671r8mccpb9gz0w1056r500lw6c2";
|
2009-10-11 16:52:14 +01:00
|
|
|
};
|
|
|
|
|
2019-10-31 21:02:34 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2019-1010301.patch";
|
|
|
|
url = "https://sources.debian.org/data/main/j/jhead/1:3.03-3/debian/patches/36_CVE-2019-1010301";
|
|
|
|
sha256 = "1vvrg50z5y7sjhfi973wh1q1v79sqp7hk5d4z0dlnx3fqgkjrx7q";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2019-1010302.patch";
|
|
|
|
url = "https://sources.debian.org/data/main/j/jhead/1:3.03-3/debian/patches/37_CVE-2019-1010302";
|
|
|
|
sha256 = "1h11mpsi7hpwbi8kpnkjwn6zpqf88f132h0rsg8sggcs3vva2x8y";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2016-01-06 19:33:00 +00:00
|
|
|
buildInputs = [ libjpeg ];
|
|
|
|
|
2009-10-11 16:52:14 +01:00
|
|
|
patchPhase = ''
|
2015-12-18 23:29:32 +00:00
|
|
|
substituteInPlace makefile \
|
|
|
|
--replace /usr/local/bin $out/bin
|
|
|
|
|
|
|
|
substituteInPlace jhead.c \
|
2016-01-06 19:33:00 +00:00
|
|
|
--replace "\" Compiled: \"__DATE__" "" \
|
2016-02-01 18:46:10 +00:00
|
|
|
--replace "jpegtran -trim" "${libjpeg.bin}/bin/jpegtran -trim"
|
2009-10-11 16:52:14 +01:00
|
|
|
'';
|
|
|
|
|
2015-12-18 23:29:32 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p \
|
|
|
|
$out/bin \
|
|
|
|
$out/man/man1 \
|
2019-08-15 13:41:18 +01:00
|
|
|
$out/share/doc/${pname}-${version}
|
2015-12-18 23:29:32 +00:00
|
|
|
|
|
|
|
cp -v jhead $out/bin
|
|
|
|
cp -v jhead.1 $out/man/man1
|
2019-08-15 13:41:18 +01:00
|
|
|
cp -v *.txt $out/share/doc/${pname}-${version}
|
2009-10-11 16:52:14 +01:00
|
|
|
'';
|
|
|
|
|
2015-12-18 23:29:32 +00:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.sentex.net/~mwandel/jhead/";
|
2009-10-11 16:52:14 +01:00
|
|
|
description = "Exif Jpeg header manipulation tool";
|
2015-12-18 23:29:32 +00:00
|
|
|
license = licenses.publicDomain;
|
2018-07-22 20:50:19 +01:00
|
|
|
maintainers = with maintainers; [ rycee ];
|
2015-12-18 23:29:32 +00:00
|
|
|
platforms = platforms.all;
|
2009-10-11 16:52:14 +01:00
|
|
|
};
|
|
|
|
}
|