<commit_before>{ stdenv, fetchurl, binutils, popt, zlib, pkgconfig, linuxHeaders
, libiberty_static, withGUI ? false , qt4 ? null}:

# libX11 is needed because the Qt build stuff automatically adds `-lX11'.
assert withGUI -> qt4 != null;

stdenv.mkDerivation rec {
  name = "oprofile-1.2.0";

  src = fetchurl {
    url = "mirror://sourceforge/oprofile/${name}.tar.gz";
    sha256 = "0zd5ih6gmm1pkqavd9laa93iff7qv5jkbfjznhlyxl5p826gk5gb";
  };

  buildInputs = [ binutils zlib popt pkgconfig linuxHeaders libiberty_static ]
    ++ stdenv.lib.optionals withGUI [ qt4 ];

  configureFlags = [
      "--with-kernel=${linuxHeaders}"
      "--disable-shared"   # needed because only the static libbfd is available
    ]
    ++ stdenv.lib.optional withGUI "--with-qt-dir=${qt4} --enable-gui=qt4";

  meta = {
    description = "System-wide profiler for Linux";
    longDescription = ''
      OProfile is a system-wide profiler for Linux systems, capable of
      profiling all running code at low overhead.  It consists of a
      kernel driver and a daemon for collecting sample data, and
      several post-profiling tools for turning data into information.

      OProfile leverages the hardware performance counters of the CPU<commit_msg>oprofile: fix hardcoded rm/cp paths<commit_after>{ stdenv, fetchurl, binutils, popt, zlib, pkgconfig, linuxHeaders, coreutils
, libiberty_static, withGUI ? false , qt4 ? null}:

# libX11 is needed because the Qt build stuff automatically adds `-lX11'.
assert withGUI -> qt4 != null;

stdenv.mkDerivation rec {
  name = "oprofile-1.2.0";

  src = fetchurl {
    url = "mirror://sourceforge/oprofile/${name}.tar.gz";
    sha256 = "0zd5ih6gmm1pkqavd9laa93iff7qv5jkbfjznhlyxl5p826gk5gb";
  };

  postPatch = ''
    substituteInPlace opjitconv/opjitconv.c \
      --replace "/bin/rm" "${coreutils}/bin/rm" \
      --replace "/bin/cp" "${coreutils}/bin/cp"
  '';

  buildInputs = [ binutils zlib popt pkgconfig linuxHeaders libiberty_static ]
    ++ stdenv.lib.optionals withGUI [ qt4 ];

  configureFlags = [
      "--with-kernel=${linuxHeaders}"
      "--disable-shared"   # needed because only the static libbfd is available
    ]
    ++ stdenv.lib.optional withGUI "--with-qt-dir=${qt4} --enable-gui=qt4";

  meta = {
    description = "System-wide profiler for Linux";
    longDescription = ''
      OProfile is a system-wide profiler for Linux systems, capable of
      profiling all running code at low overhead.  It consists of a
      kernel driver and a daemon for collecting sample data, and
      several post-profiling tools for turning data into information.

      OProfile leverages the hardware performance counters of the CPU
{'fraction_non_alphanumeric': 0.10512532734754956, 'fraction_numerical': 0.021698466142910586, 'mean_word_length': 3.4125412541254128, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6609551', 'n_tokens_mistral': 887, 'n_tokens_neox': 847, 'n_words': 249}