<commit_before>{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "jbigkit-2.1";

  src = fetchurl {
    url = "http://www.cl.cam.ac.uk/~mgk25/jbigkit/download/${name}.tar.gz";
    sha256 = "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy";
  };

  postPatch = ''
    sed -i 's/^\(CFLAGS.*\)$/\1 -fPIC/' Makefile
  '';

  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; {
    homepage = "http://www.cl.cam.ac.uk/~mgk25/jbigkit/";
    description = "a software implementation of the JBIG1 data compression standard";
    license = licenses.gpl2;
    platforms = platforms.all;
    maintainers = with maintainers; [ wkennington ];
  };
}<commit_msg>jbigkit: patch makefiles to use Clang when needed<commit_after>{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "jbigkit-2.1";

  src = fetchurl {
    url = "http://www.cl.cam.ac.uk/~mgk25/jbigkit/download/${name}.tar.gz";
    sha256 = "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy";
  };

  postPatch = ''
    sed -i 's/^\(CFLAGS.*\)$/\1 -fPIC/' Makefile
  '' + stdenv.lib.optionalString (stdenv.cc.cc.isClang or false) ''
    substituteInPlace Makefile libjbig/Makefile pbmtools/Makefile \
      --replace "CC = gcc" "CC = clang"
  '';

  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; {
    homepage = "http://www.cl.cam.ac.uk/~mgk25/jbigkit/";
    description = "a software implementation of the JBIG1 data compression standard";
    license = licenses.gpl2;
    platforms = platforms.all;
    maintainers = with maintainers; [ wkennington ];
  };
}
{'fraction_non_alphanumeric': 0.14316392269148176, 'fraction_numerical': 0.0572655690765927, 'mean_word_length': 3.0215827338129495, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7141947', 'n_tokens_mistral': 1277, 'n_tokens_neox': 1181, 'n_words': 212}