<commit_before>{ lib, stdenv, fetchFromGitLab, xorgproto, motif, libX11, libXt, libXpm, bison
, flex, automake, autoconf, libtool
}:

stdenv.mkDerivation rec {
  pname = "alliance";
  version = "unstable-2021-09-15";

  src = fetchFromGitLab {
    domain = "gitlab.lip6.fr";
    owner = "vlsi-eda";
    repo = "alliance";
    rev = "5e83c92d0307cce9d599f7099fb0023f81d26d65";
    sha256 = "Vd3MTT4eKn4FMt0/F4fQUPcWq25kH0FpeGxQUOetKPY=";
  };

  prePatch = "cd alliance/src";

  nativeBuildInputs = [ libtool automake autoconf flex ];
  buildInputs = [ xorgproto motif libX11 libXt libXpm bison ];

  # Disable parallel build, errors:
  #  ./pat_decl_y.y:736:5: error: expected '=', ...
  enableParallelBuilding = false;

  ALLIANCE_TOP = placeholder "out";

  configureFlags = [
    "--prefix=${placeholder "out"}" "--enable-alc-shared"
  ];

  postPatch = ''
    # texlive for docs seems extreme
    substituteInPlace autostuff \
      --replace "$newdirs documentation" "$newdirs"

    substituteInPlace sea/src/DEF_grammar_lex.l --replace "ifndef FLEX_BETA" \
      "if (YY_FLEX_MAJOR_VERSION <= 2) && (YY_FLEX_MINOR_VERSION < 6)"

    ./autostuff<commit_msg>alliance: unstable-2021-09-15 -> unstable-2022-01-13<commit_after>{ lib, stdenv, fetchFromGitLab, xorgproto, motif, libX11, libXt, libXpm, bison
, flex, automake, autoconf, libtool
}:

stdenv.mkDerivation rec {
  pname = "alliance";
  version = "unstable-2022-01-13";

  src = fetchFromGitLab {
    domain = "gitlab.lip6.fr";
    owner = "vlsi-eda";
    repo = "alliance";
    rev = "ebece102e15c110fc79f1da50524c68fd9523f0c";
    hash = "sha256-NGtE3ZmN9LrgXG4NIKrp7dFRVzrKMoudlPUtYYKrZjY=";
  };

  prePatch = "cd alliance/src";

  nativeBuildInputs = [ libtool automake autoconf flex ];
  buildInputs = [ xorgproto motif libX11 libXt libXpm bison ];

  # Disable parallel build, errors:
  #  ./pat_decl_y.y:736:5: error: expected '=', ...
  enableParallelBuilding = false;

  ALLIANCE_TOP = placeholder "out";

  configureFlags = [
    "--prefix=${placeholder "out"}" "--enable-alc-shared"
  ];

  postPatch = ''
    # texlive for docs seems extreme
    substituteInPlace autostuff \
      --replace "$newdirs documentation" "$newdirs"

    substituteInPlace sea/src/DEF_grammar_lex.l --replace "ifndef FLEX_BETA" \
      "if (YY_FLEX_MAJOR_VERSION <= 2) && (YY_FLEX_MINOR_VERSION < 6)"

    ./autostuff
{'fraction_non_alphanumeric': 0.13133445945945946, 'fraction_numerical': 0.05152027027027027, 'mean_word_length': 3.7285429141716566, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, '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': '3106272', 'n_tokens_mistral': 1007, 'n_tokens_neox': 908, 'n_words': 173}