1 { lib, stdenv, fetchurl }:
3 stdenv.mkDerivation rec {
8 url = "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/${pname}-${version}.tar.gz";
9 sha256 = "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy";
13 "CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
14 "AR=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar"
15 "RANLIB=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
19 sed -i 's/^\(CFLAGS.*\)$/\1 -fPIC/' Makefile
21 for f in Makefile libjbig/Makefile pbmtools/Makefile; do
22 sed -i -E 's/\bar /$(AR) /g;s/\branlib /$(RANLIB) /g' "$f"
29 install -D -m644 libjbig/libjbig.a $out/lib/libjbig.a
30 install -D -m644 libjbig/libjbig85.a $out/lib/libjbig85.a
31 install -D -m644 libjbig/jbig.h $out/include/jbig.h
32 install -D -m644 libjbig/jbig_ar.h $out/include/jbig_ar.h
33 install -D -m644 libjbig/jbig85.h $out/include/jbig85.h
35 install -d -m755 $out/share/man/man1
36 install -m644 pbmtools/*.1* $out/share/man/man1
38 install -D -m755 pbmtools/jbgtopbm $out/bin/jbgtopbm
39 install -D -m755 pbmtools/pbmtojbg $out/bin/pbmtojbg
40 install -D -m755 pbmtools/jbgtopbm85 $out/bin/jbgtopbm85
41 install -D -m755 pbmtools/pbmtojbg85 $out/bin/pbmtojbg85
47 homepage = "http://www.cl.cam.ac.uk/~mgk25/jbigkit/";
48 description = "A software implementation of the JBIG1 data compression standard";
49 license = licenses.gpl2Plus;
50 platforms = platforms.all;