2015-03-27 21:30:44 +00:00
|
|
|
{ stdenv, fetchurl }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "jbigkit-2.1";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/${name}.tar.gz";
|
2015-03-27 21:30:44 +00:00
|
|
|
sha256 = "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy";
|
|
|
|
};
|
|
|
|
|
2015-03-27 22:34:06 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's/^\(CFLAGS.*\)$/\1 -fPIC/' Makefile
|
2015-05-11 22:37:53 +01:00
|
|
|
'' + stdenv.lib.optionalString stdenv.cc.isClang ''
|
2017-09-11 23:15:12 +01:00
|
|
|
for f in Makefile libjbig/Makefile pbmtools/Makefile; do
|
|
|
|
substituteInPlace $f --replace "CC = gcc" "CC = clang"
|
|
|
|
done
|
2015-03-27 22:34:06 +00:00
|
|
|
'';
|
|
|
|
|
2015-03-27 21:30:44 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -D -m644 libjbig/libjbig.a $out/lib/libjbig.a
|
|
|
|
install -D -m644 libjbig/libjbig85.a $out/lib/libjbig85.a
|
|
|
|
install -D -m644 libjbig/jbig.h $out/include/jbig.h
|
|
|
|
install -D -m644 libjbig/jbig_ar.h $out/include/jbig_ar.h
|
|
|
|
install -D -m644 libjbig/jbig85.h $out/include/jbig85.h
|
|
|
|
|
|
|
|
install -d -m755 $out/share/man/man1
|
|
|
|
install -m644 pbmtools/*.1* $out/share/man/man1
|
|
|
|
|
|
|
|
install -D -m755 pbmtools/jbgtopbm $out/bin/jbgtopbm
|
|
|
|
install -D -m755 pbmtools/pbmtojbg $out/bin/pbmtojbg
|
|
|
|
install -D -m755 pbmtools/jbgtopbm85 $out/bin/jbgtopbm85
|
|
|
|
install -D -m755 pbmtools/pbmtojbg85 $out/bin/pbmtojbg85
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://www.cl.cam.ac.uk/~mgk25/jbigkit/;
|
2016-06-20 11:53:46 +01:00
|
|
|
description = "A software implementation of the JBIG1 data compression standard";
|
2015-03-27 21:30:44 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|