<commit_before>{ lib, stdenv, fetchurl, gtk2, pkg-config, fftw, file,
  pythonSupport ? false, pythonPackages ? null,
  gnome2 ? null,
  openexrSupport ? true, openexr ? null,
  libzipSupport ? true, libzip ? null,
  libxml2Support ? true, libxml2 ? null,
  libwebpSupport ? true, libwebp ? null,
  # libXmu is not used if libunique is.
  libXmuSupport ? false, xorg ? null,
  libxsltSupport ? true, libxslt ? null,
  fitsSupport ? true, cfitsio ? null,
  zlibSupport ? true, zlib ? null,
  libuniqueSupport ? true, libunique ? null,
  libpngSupport ? true, libpng ? null,
  openglSupport ? !stdenv.isDarwin
}:

assert openexrSupport -> openexr != null;
assert libzipSupport -> libzip != null;
assert libxml2Support -> libxml2 != null;
assert libwebpSupport -> libwebp != null;
assert libXmuSupport -> xorg != null;
assert libxsltSupport -> libxslt != null;
assert fitsSupport -> cfitsio != null;
assert zlibSupport -> zlib != null;
assert libuniqueSupport -> libunique != null;
assert libpngSupport -> libpng != null;
assert openglSupport -> gnome2 != null;
assert pythonSupport -> (pythonPackages != null && gnome2 != null);

let
    inherit (pythonPackages) pygtk pygobject2 python;

in

stdenv.mkDerivation rec {
  pname = "gwyddion";
   version = "2.57";
  src = fetchurl {
    url = "mirror://sourceforge/gwyddion/gwyddion-${version}.tar.xz";
    sha256 = "sha256-kx/WqtNDaJQyVehxZ3weddXyaM1knX+fCuv47A9GaH0=";
  };

  nativeBuildInputs = [ pkg-config file ];

  buildInputs = with lib;
    [ gtk2 fftw ] ++
    optional openglSupport gnome2.gtkglext ++
    optional openexrSupport openexr ++
    optional libXmuSupport xorg.libXmu ++
    optional fitsSupport cfitsio ++
    optional libpngSupport libpng ++
    optional libxsltSupport libxslt ++
    optional libxml2Support libxml2 ++
    optional libwebpSupport libwebp ++
    optional zlibSupport zlib ++
    optional libuniqueSupport libunique ++
    optional libzipSupport libzip;

  propagatedBuildInputs = with lib;
    optionals pythonSupport [ pygtk pygobject2 python gnome2.gtksourceview ];<commit_msg>gwyddion: 2.57 -> 2.58<commit_after>{ lib, stdenv, fetchurl, gtk2, pkg-config, fftw, file,
  pythonSupport ? false, pythonPackages ? null,
  gnome2 ? null,
  openexrSupport ? true, openexr ? null,
  libzipSupport ? true, libzip ? null,
  libxml2Support ? true, libxml2 ? null,
  libwebpSupport ? true, libwebp ? null,
  # libXmu is not used if libunique is.
  libXmuSupport ? false, xorg ? null,
  libxsltSupport ? true, libxslt ? null,
  fitsSupport ? true, cfitsio ? null,
  zlibSupport ? true, zlib ? null,
  libuniqueSupport ? true, libunique ? null,
  libpngSupport ? true, libpng ? null,
  openglSupport ? !stdenv.isDarwin
}:

assert openexrSupport -> openexr != null;
assert libzipSupport -> libzip != null;
assert libxml2Support -> libxml2 != null;
assert libwebpSupport -> libwebp != null;
assert libXmuSupport -> xorg != null;
assert libxsltSupport -> libxslt != null;
assert fitsSupport -> cfitsio != null;
assert zlibSupport -> zlib != null;
assert libuniqueSupport -> libunique != null;
assert libpngSupport -> libpng != null;
assert openglSupport -> gnome2 != null;
assert pythonSupport -> (pythonPackages != null && gnome2 != null);

let
    inherit (pythonPackages) pygtk pygobject2 python;

in

stdenv.mkDerivation rec {
  pname = "gwyddion";
   version = "2.58";
  src = fetchurl {
    url = "mirror://sourceforge/gwyddion/gwyddion-${version}.tar.xz";
    sha256 = "sha256-0xNnzYkuW3nEsO2o+0WEA+Z71XWoq6FYXm342OWO9Sw=";
  };

  nativeBuildInputs = [ pkg-config file ];

  buildInputs = with lib;
    [ gtk2 fftw ] ++
    optional openglSupport gnome2.gtkglext ++
    optional openexrSupport openexr ++
    optional libXmuSupport xorg.libXmu ++
    optional fitsSupport cfitsio ++
    optional libpngSupport libpng ++
    optional libxsltSupport libxslt ++
    optional libxml2Support libxml2 ++
    optional libwebpSupport libwebp ++
    optional zlibSupport zlib ++
    optional libuniqueSupport libunique ++
    optional libzipSupport libzip;

  propagatedBuildInputs = with lib;
    optionals pythonSupport [ pygtk pygobject2 python gnome2.gtksourceview ];
{'fraction_non_alphanumeric': 0.10349819059107358, 'fraction_numerical': 0.01712907117008444, 'mean_word_length': 4.080882352941177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '5104147', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1389, 'n_words': 366}