<commit_before>{ stdenv, fetchurl, openssl, trousers, automake, autoconf, libtool, bison, flex }:

stdenv.mkDerivation rec {
  version = "3.2";
  name = "opencryptoki-${version}";

  src = fetchurl {
    url = "mirror://sourceforge/opencryptoki/opencryptoki/v${version}/opencryptoki-v${version}.tgz";
    sha256 = "06r6zp299vxdspl6k65myzgjv0bihg7kc500v7s4jd3mcrkngd6h";
  };

  buildInputs = [ automake autoconf libtool openssl trousers bison flex ];

  preConfigure = ''
    substituteInPlace configure.in --replace "chown" "true"
    substituteInPlace configure.in --replace "chgrp" "true"
    sh bootstrap.sh --prefix=$out
  '';

  configureFlags = [ "--disable-ccatok" "--disable-icatok" ];

  makeFlags = "DESTDIR=$(out)";

  # work around the build script of opencryptoki
  postInstall = ''
    cp -r $out/$out/* $out
    rm -r $out/nix
    '';

  meta = with stdenv.lib; {
    description = "PKCS#11 implementation for Linux";
    homepage    = http://opencryptoki.sourceforge.net/;
    license     = licenses.cpl10;
    maintainers = [ maintainers.tstrobel ];
    platforms   = platforms.unix;
  };
}

<commit_msg>opencryptoki: 3.2 -> 3.8.1<commit_after>{ stdenv, fetchFromGitHub, openssl, trousers, autoreconfHook, libtool, bison, flex }:

stdenv.mkDerivation rec {
  name = "opencryptoki-${version}";
  version = "3.8.1";

  src = fetchFromGitHub {
    owner = "opencryptoki";
    repo = "opencryptoki";
    rev = "v${version}";
    sha256 = "1m618pjfzw18irmh6i4pfq1gvcxgyfh9ikjn33nrdj55v2l27g31";
  };

  nativeBuildInputs = [ autoreconfHook libtool bison flex ];
  buildInputs = [ openssl trousers ];

  postPatch = ''
    substituteInPlace configure.ac \
      --replace "usermod" "true" \
      --replace "groupadd" "true" \
      --replace "chmod" "true" \
      --replace "chgrp" "true"
    substituteInPlace usr/lib/Makefile.am --replace "DESTDIR" "out"
  '';

  configureFlags = [
    "--prefix=$(out)"
    "--disable-ccatok"
    "--disable-icatok"
  ];

  enableParallelBuilding = true;

  meta = with stdenv.lib; {
    description = "PKCS#11 implementation for Linux";
    homepage    = https://github.com/opencryptoki/opencryptoki;
    license     = licenses.cpl10;
    maintainers = [ maintainers.tstrobel ];
    platforms   = platforms.unix;
  };
}

{'fraction_non_alphanumeric': 0.14084507042253522, 'fraction_numerical': 0.026848591549295774, 'mean_word_length': 3.2645403377110696, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 1, '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': '6530873', 'n_tokens_mistral': 871, 'n_tokens_neox': 821, 'n_words': 157}