<commit_before>{ fetchurl, stdenv, pkgconfig
, libgpgerror, libassuan
, qtbase
, libcap ? null
}:

let
  mkFlag = pfxTrue: pfxFalse: cond: name: "--${if cond then pfxTrue else pfxFalse}-${name}";
  mkEnable = mkFlag "enable" "disable";
  mkWith = mkFlag "with" "without";
in
with stdenv.lib;
stdenv.mkDerivation rec {
  name = "pinentry-0.9.6";

  src = fetchurl {
    url = "mirror://gnupg/pinentry/${name}.tar.bz2";
    sha256 = "0rhyw1vk28kgasjp22myf7m2q8kycw82d65pr9kgh93z17lj849a";
  };

  buildInputs = [ libgpgerror libassuan libcap qtbase ];

  # configure cannot find moc on its own
  preConfigure = ''
    export QTDIR="${qtbase}"
    export MOC="${qtbase}/bin/moc"
  '';

  configureFlags = [
    (mkWith   (libcap != null)  "libcap")
    (mkEnable true "pinentry-qt")
  ];

  nativeBuildInputs = [ pkgconfig ];

  meta = {<commit_msg>pinentry: Fix dev reference to qtbase<commit_after>{ fetchurl, stdenv, pkgconfig
, libgpgerror, libassuan
, qtbase
, libcap ? null
}:

let
  mkFlag = pfxTrue: pfxFalse: cond: name: "--${if cond then pfxTrue else pfxFalse}-${name}";
  mkEnable = mkFlag "enable" "disable";
  mkWith = mkFlag "with" "without";
in
with stdenv.lib;
stdenv.mkDerivation rec {
  name = "pinentry-0.9.6";

  src = fetchurl {
    url = "mirror://gnupg/pinentry/${name}.tar.bz2";
    sha256 = "0rhyw1vk28kgasjp22myf7m2q8kycw82d65pr9kgh93z17lj849a";
  };

  buildInputs = [ libgpgerror libassuan libcap qtbase ];

  # configure cannot find moc on its own
  preConfigure = ''
    export QTDIR="${qtbase.dev}"
    export MOC="${qtbase.dev}/bin/moc"
  '';

  configureFlags = [
    (mkWith   (libcap != null)  "libcap")
    (mkEnable true "pinentry-qt")
  ];

  nativeBuildInputs = [ pkgconfig ];

  meta = {
{'fraction_non_alphanumeric': 0.14443155452436196, 'fraction_numerical': 0.03248259860788863, 'mean_word_length': 3.7131147540983607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '1440218', 'n_tokens_mistral': 712, 'n_tokens_neox': 677, 'n_words': 147}