<commit_before>{ fetchurl, stdenv, cmake, fetchpatch }:

stdenv.mkDerivation rec {
  name = "cmocka-${version}";
  version = "1.0.1";

  src = fetchurl {
    url = "https://cmocka.org/files/1.0/cmocka-${version}.tar.xz";
    sha256 = "0fvm6rdalqcxckbddch8ycdw6n2ckldblv117n09chi2l7bm0q5k";
  };

  patches = [
    # This fixes the build for clang-3.7.0 and thus Darwin.
    # See https://open.cryptomilk.org/issues/43 for more info.
    #
    # The patch is already merged to upstream, so it should be removed
    # here on next release.
    (fetchpatch {
      url = "https://git.cryptomilk.org/projects/cmocka.git/patch/?id=1b595a80934fa95234fb290913cfe533f740d965";
      sha256 = "1fg8xwb1mrrmw4dqa65ghnvgfdkpi0lv4j2gq0lm9ayvsi3v00vp";
    })
  ];

  nativeBuildInputs = [ cmake ];

  meta = with stdenv.lib; {
    description = "Lightweight library to simplify and generalize unit tests for C";

    longDescription =
      ''There are a variety of C unit testing frameworks available however
        many of them are fairly complex and require the latest compiler
        technology.  Some development requires the use of old compilers which
        makes it difficult to use some unit testing frameworks. In addition
        many unit testing frameworks assume the code being tested is an
        application or module that is targeted to the same platform that will
        ultimately execute the test.  Because of this assumption many
        frameworks require the inclusion of standard C library headers in the
        code module being tested which may collide with the custom or
        incomplete implementation of the C library utilized by the code under
        test.<commit_msg>cmocka: 1.0.1 -> 1.1.1<commit_after>{ fetchurl, stdenv, cmake }:

stdenv.mkDerivation rec {
  name = "cmocka-${version}";
  majorVersion = "1.1";
  version = "${majorVersion}.1";

  src = fetchurl {
    url = "https://cmocka.org/files/${majorVersion}/cmocka-${version}.tar.xz";
    sha256 = "f02ef48a7039aa77191d525c5b1aee3f13286b77a13615d11bc1148753fc0389";
  };

  nativeBuildInputs = [ cmake ];

  meta = with stdenv.lib; {
    description = "Lightweight library to simplify and generalize unit tests for C";

    longDescription =
      ''There are a variety of C unit testing frameworks available however
        many of them are fairly complex and require the latest compiler
        technology.  Some development requires the use of old compilers which
        makes it difficult to use some unit testing frameworks. In addition
        many unit testing frameworks assume the code being tested is an
        application or module that is targeted to the same platform that will
        ultimately execute the test.  Because of this assumption many
        frameworks require the inclusion of standard C library headers in the
        code module being tested which may collide with the custom or
        incomplete implementation of the C library utilized by the code under
        test.
{'fraction_non_alphanumeric': 0.06755852842809365, 'fraction_numerical': 0.0431438127090301, 'mean_word_length': 3.1426592797783934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6098141', 'n_tokens_mistral': 931, 'n_tokens_neox': 854, 'n_words': 324}