<commit_before>{ stdenv, fetchurl, gfortran, gnumake, imake, makedepend, motif, xorg }:

stdenv.mkDerivation rec {
  version = "2006";
  name = "cernlib-${version}";

  src = fetchurl {
    url = "https://cernlib.web.cern.ch/cernlib/download/${version}_source/tar/${version}_src.tar.gz";
    sha256 = "0awla1rl96z82br7slcmg8ks1d2a7slk6dj79ywb871j2ksi3fky";
  };

  buildInputs = with xorg; [ gfortran motif libX11 libXft libXt ];
  nativeBuildInputs = [ gnumake imake makedepend ];
  sourceRoot = ".";

  patches = [ ./patch ];

  postPatch = ''
    substituteInPlace 2006/src/config/site.def \
      --replace "# define MakeCmd gmake" "# define MakeCmd make"
  '';

  configurePhase = ''
    export CERN=`pwd`
    export CERN_LEVEL=${version}
    export CERN_ROOT=$CERN/$CERN_LEVEL
    export CVSCOSRC=`pwd`/$CERN_LEVEL/src
    export PATH=$PATH:$CERN_ROOT/bin
  '';

  buildPhase = ''
    cd $CERN_ROOT
    mkdir -p build bin lib

    cd $CERN_ROOT/build
    $CVSCOSRC/config/imake_boot
    make bin/kuipc
    make scripts/Makefile
    pushd scripts
    make install.bin
    popd
    make
  '';

  installPhase = ''
    mkdir "$out"
    cp -r "$CERN_ROOT/bin" "$out"
    cp -r "$CERN_ROOT/lib" "$out"
    mkdir "$out/$CERN_LEVEL"
    ln -s "$out/bin" "$out/$CERN_LEVEL/bin"
    ln -s "$out/lib" "$out/$CERN_LEVEL/lib"
  '';

  setupHook = ./setup-hook.sh;

  meta = {
    homepage = http://cernlib.web.cern.ch;
    description = "Legacy collection of libraries and modules for data analysis in high energy physics";
    platforms = stdenv.lib.platforms.unix;
    maintainers = with stdenv.lib.maintainers; [ veprbl ];
    license = stdenv.lib.licenses.gpl2;
  };
}<commit_msg>cernlib: mark broken on darwin<commit_after>{ stdenv, fetchurl, gfortran, gnumake, imake, makedepend, motif, xorg }:

stdenv.mkDerivation rec {
  version = "2006";
  name = "cernlib-${version}";

  src = fetchurl {
    url = "https://cernlib.web.cern.ch/cernlib/download/${version}_source/tar/${version}_src.tar.gz";
    sha256 = "0awla1rl96z82br7slcmg8ks1d2a7slk6dj79ywb871j2ksi3fky";
  };

  buildInputs = with xorg; [ gfortran motif libX11 libXft libXt ];
  nativeBuildInputs = [ gnumake imake makedepend ];
  sourceRoot = ".";

  patches = [ ./patch ];

  postPatch = ''
    substituteInPlace 2006/src/config/site.def \
      --replace "# define MakeCmd gmake" "# define MakeCmd make"
  '';

  configurePhase = ''
    export CERN=`pwd`
    export CERN_LEVEL=${version}
    export CERN_ROOT=$CERN/$CERN_LEVEL
    export CVSCOSRC=`pwd`/$CERN_LEVEL/src
    export PATH=$PATH:$CERN_ROOT/bin
  '';

  buildPhase = ''
    cd $CERN_ROOT
    mkdir -p build bin lib

    cd $CERN_ROOT/build
    $CVSCOSRC/config/imake_boot
    make bin/kuipc
    make scripts/Makefile
    pushd scripts
    make install.bin
    popd
    make
  '';

  installPhase = ''
    mkdir "$out"
    cp -r "$CERN_ROOT/bin" "$out"
    cp -r "$CERN_ROOT/lib" "$out"
    mkdir "$out/$CERN_LEVEL"
    ln -s "$out/bin" "$out/$CERN_LEVEL/bin"
    ln -s "$out/lib" "$out/$CERN_LEVEL/lib"
  '';

  setupHook = ./setup-hook.sh;

  meta = {
    homepage = http://cernlib.web.cern.ch;
    description = "Legacy collection of libraries and modules for data analysis in high energy physics";
    broken = stdenv.isDarwin;
    platforms = stdenv.lib.platforms.unix;
    maintainers = with stdenv.lib.maintainers; [ veprbl ];
    license = stdenv.lib.licenses.gpl2;
  };
}
{'fraction_non_alphanumeric': 0.13811342932706436, 'fraction_numerical': 0.01939465177784308, 'mean_word_length': 3.106151990349819, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4551091', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1264, 'n_words': 258}