<commit_before>{ lib, stdenv, fetchurl }:

stdenv.mkDerivation rec {
  pname = "shapelib";
  version = "1.5.0";

  src = fetchurl {
    url = "https://download.osgeo.org/shapelib/shapelib-${version}.tar.gz";
    sha256 = "1qfsgb8b3yiqwvr6h9m81g6k9fjhfys70c22p7kzkbick20a9h0z";
  };

  meta = with lib; {
    description = "C Library for reading, writing and updating ESRI Shapefiles";
    homepage = "http://shapelib.maptools.org/";
    license = licenses.gpl2;
    maintainers = [ maintainers.ehmry ];
  };
}<commit_msg>shapelib: add patch for CVE-2022-0699<commit_after>{ lib
, stdenv
, fetchurl
, fetchpatch
}:

stdenv.mkDerivation rec {
  pname = "shapelib";
  version = "1.5.0";

  src = fetchurl {
    url = "https://download.osgeo.org/shapelib/shapelib-${version}.tar.gz";
    sha256 = "1qfsgb8b3yiqwvr6h9m81g6k9fjhfys70c22p7kzkbick20a9h0z";
  };

  patches = [
    (fetchpatch {
      name = "CVE-2022-0699.patch";
      url = "https://github.com/OSGeo/shapelib/commit/c75b9281a5b9452d92e1682bdfe6019a13ed819f.patch";
      sha256 = "sha256-zJ7JHUtInA5q/RbkSs1DqVK+UQi2vIw2t1jqxocnQQI=";
    })
  ];

  meta = with lib; {
    description = "C Library for reading, writing and updating ESRI Shapefiles";
    homepage = "http://shapelib.maptools.org/";
    license = licenses.gpl2;
    maintainers = [ maintainers.ehmry ];
  };
}
{'fraction_non_alphanumeric': 0.14082397003745317, 'fraction_numerical': 0.07790262172284644, 'mean_word_length': 3.5597269624573378, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, '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': '2133008', 'n_tokens_mistral': 625, 'n_tokens_neox': 575, 'n_words': 83}