anchor.diff: -{ stdenv, fetchurl, gettext, pkgconfig, perl, python
  -, libiconv, zlib, libffi, pcre, libelf, gnome3
  +{ stdenv, fetchurl, gettext, meson, ninja, pkgconfig, perl, python3, glibcLocales
  +, libiconv, zlib, libffi, pcre, libelf, gnome3, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45
   # use utillinuxMinimal to avoid circular dependency (utillinux, systemd, glib)
   , utillinuxMinimal ? null
   
  
positive.code:     ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
    '';
  
    version = "2.56.0";
  in
  
  stdenv.mkDerivation rec {
  
negative.code: 
    setupHook = ./setup-hook.sh;
  
    buildInputs = [
      libelf setupHook pcre
      bash gnum4 # install glib-gettextize and m4 macros for other apps to use
    ] ++ optionals stdenv.isLinux [
      libselinux
      utillinuxMinimal # for libmount
    ];
  
    nativeBuildInputs = [ meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 glibcLocales ];
  
    propagatedBuildInputs = [ zlib libffi gettext libiconv ];
  
    mesonFlags = [
      "-Dgtk_doc=true"
    ];
  
    LC_ALL = "en_US.UTF-8";
  
    NIX_CFLAGS_COMPILE = optional stdenv.isSunOS "-DBSD_COMP";
  
    postPatch = ''
      substituteInPlace meson.build --replace "install_dir : 'bin'," "install_dir : glib_bindir,"
      chmod +x gio/tests/gengiotypefuncs.py
      patchShebangs gio/tests/gengiotypefuncs.py
      patchShebangs glib/gen-unicode-tables.pl
      patchShebangs tests/gen-casefold-txt.py
      patchShebangs tests/gen-casemap-txt.py
    '';
  
    LIBELF_CFLAGS = optional stdenv.isFreeBSD "-I${libelf}";
    LIBELF_LIBS = optional stdenv.isFreeBSD "-L${libelf} -lelf";
  
    DETERMINISTIC_BUILD = 1;
  
    postInstall = ''
  