<commit_before>{ stdenv, fetchurl, pkgconfig, smlnj, rsync }:

stdenv.mkDerivation rec {
  name = "twelf-${version}";
  version = "1.7.1";

  src = fetchurl {
    url = "http://twelf.plparty.org/releases/twelf-src-${version}.tar.gz";
    sha256 = "0fi1kbs9hrdrm1x4k13angpjasxlyd1gc3ys8ah54i75qbcd9c4i";
  };

  buildInputs = [ pkgconfig smlnj rsync ];

  buildPhase = ''
    export SMLNJ_HOME=${smlnj}
    make smlnj
  '';

  installPhase = ''
    mkdir -p $out/bin
    rsync -av bin/{*,.heap} $out/bin/
    bin/.mkexec ${smlnj}/bin/sml $out/ twelf-server twelf-server

    mkdir -p $out/share/emacs/site-lisp/twelf/
    rsync -av emacs/ $out/share/emacs/site-lisp/twelf/

    mkdir -p $out/share/twelf/examples
    rsync -av examples/ $out/share/twelf/examples/
    mkdir -p $out/share/twelf/vim
    rsync -av vim/ $out/share/twelf/vim/
  '';

  meta = {
    description = "Logic proof assistant";
    longDescription = ''
      Twelf is a language used to specify, implement, and prove properties of<commit_msg>twelf: fix emacs mode<commit_after>{ stdenv, fetchurl, pkgconfig, smlnj, rsync }:

stdenv.mkDerivation rec {
  name = "twelf-${version}";
  version = "1.7.1";

  src = fetchurl {
    url = "http://twelf.plparty.org/releases/twelf-src-${version}.tar.gz";
    sha256 = "0fi1kbs9hrdrm1x4k13angpjasxlyd1gc3ys8ah54i75qbcd9c4i";
  };

  buildInputs = [ pkgconfig smlnj rsync ];

  buildPhase = ''
    export SMLNJ_HOME=${smlnj}
    make smlnj
  '';

  installPhase = ''
    mkdir -p $out/bin
    rsync -av bin/{*,.heap} $out/bin/
    bin/.mkexec ${smlnj}/bin/sml $out/ twelf-server twelf-server

    substituteInPlace emacs/twelf-init.el \
      --replace '(concat twelf-root "emacs")' '(concat twelf-root "share/emacs/site-lisp/twelf")'

    mkdir -p $out/share/emacs/site-lisp/twelf/
    rsync -av emacs/ $out/share/emacs/site-lisp/twelf/

    mkdir -p $out/share/twelf/examples
    rsync -av examples/ $out/share/twelf/examples/
    mkdir -p $out/share/twelf/vim
    rsync -av vim/ $out/share/twelf/vim/
  '';

  meta = {
    description = "Logic proof assistant";
    longDescription = ''
      Twelf is a language used to specify, implement, and prove properties of
{'fraction_non_alphanumeric': 0.14745062011943041, 'fraction_numerical': 0.020211299954065228, 'mean_word_length': 2.938517179023508, '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': '4932929', 'n_tokens_mistral': 909, 'n_tokens_neox': 860, 'n_words': 169}