anchor.diff:      echo "" > python/tests/tstLastError.py
     '';
   
  -  doCheck = (stdenv.hostPlatform == stdenv.buildPlatform) && !stdenv.isDarwin &&
  -    stdenv.hostPlatform.libc != "musl";
  -
     preInstall = lib.optionalString pythonSupport
       ''substituteInPlace python/libxml2mod.la --replace "${python}" "$py"'';
  -  installFlags = lib.optional pythonSupport
  -    "pythondir=\"${placeholder "py"}/lib/${python.libPrefix}/site-packages\"";
   
     postFixup = ''
       moveToOutput bin/xml2-config "$dev"
  
positive.code:     })
    ];
  
    outputs = [ "bin" "dev" "out" "man" "doc" ]
      ++ lib.optional pythonSupport "py"
      ++ lib.optional (enableStatic && enableShared) "static";
  
    strictDeps = true;
  
    buildInputs = lib.optional pythonSupport python
      ++ lib.optional (pythonSupport && python?isPy2 && python.isPy2) gettext
      ++ lib.optional (pythonSupport && python?isPy3 && python.isPy3) ncurses
      ++ lib.optional (stdenv.isDarwin &&
                       pythonSupport && python?isPy2 && python.isPy2) libintl
      # Libxml2 has an optional dependency on liblzma.  However, on impure
      # platforms, it may end up using that from /usr/lib, and thus lack a
      # RUNPATH for that, leading to undefined references for its users.
      ++ lib.optional stdenv.isFreeBSD xz;
  
    propagatedBuildInputs = [ zlib findXMLCatalogs ]
      ++ lib.optional stdenv.isDarwin libiconv
      ++ lib.optional icuSupport icu;
  
    configureFlags = [
      "--exec_prefix=$dev"
  
negative.code:     (lib.withFeatureAs pythonSupport "python" python)
    ];
  
    installFlags = lib.optionals pythonSupport [
      "pythondir=\"${placeholder "py"}/lib/${python.libPrefix}/site-packages\""
    ];
  
    enableParallelBuilding = true;
  
    doCheck =
      (stdenv.hostPlatform == stdenv.buildPlatform) &&
      !stdenv.isDarwin &&
      stdenv.hostPlatform.libc != "musl";
  
    preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
      MACOSX_DEPLOYMENT_TARGET=10.16
    '';
  
    # disable test that's problematic with newer pythons: see
    # https://mail.gnome.org/archives/xml/2017-August/msg00014.html
  