anchor.diff: -{ stdenv, lib, fetchurl, pkg-config
  -, bzip2, curlMinimal, expat, libarchive, xz, zlib, libuv, rhash
  +{ lib
  +, stdenv
   , buildPackages
  -# darwin attributes
  +, bzip2
  +, curlMinimal
  +, expat
  +, fetchurl
  +, libarchive
  +, libuv
  +, ncurses
  +, openssl
  +, pkg-config
  +, qtbase
  +, rhash
  +, sphinx
  +, texinfo
  +, wrapQtAppsHook
  +, xz
  +, zlib
   , SystemConfiguration
   , ps
   , isBootstrap ? false
  +, useNcurses ? false
  +, useOpenSSL ? !isBootstrap
   , useSharedLibraries ? (!isBootstrap && !stdenv.isCygwin)
  -, useOpenSSL ? !isBootstrap, openssl
  -, useNcurses ? false, ncurses
  -, withQt5 ? false, qtbase, wrapQtAppsHook
  -, buildDocs ? (!isBootstrap && (useNcurses || withQt5)), sphinx, texinfo
  +, withQt5 ? false
  +, buildDocs ? (!isBootstrap && (useNcurses || withQt5))
   }:
   
   stdenv.mkDerivation rec {
  
positive.code:   configureFlags = [
      "CXXFLAGS=-Wno-elaborated-enum-base"
      "--docdir=share/doc/${pname}${version}"
    ] ++ (if useSharedLibraries then [ "--no-system-jsoncpp" "--system-libs" ] else [ "--no-system-libs" ]) # FIXME: cleanup
    ++ lib.optional withQt5 "--qt-gui"
    ++ lib.optionals buildDocs [
      "--sphinx-build=${sphinx}/bin/sphinx-build"
      "--sphinx-man"
      "--sphinx-info"
    ]
    # Workaround https://gitlab.kitware.com/cmake/cmake/-/issues/20568
    ++ lib.optionals stdenv.hostPlatform.is32bit [
      "CFLAGS=-D_FILE_OFFSET_BITS=64"
      "CXXFLAGS=-D_FILE_OFFSET_BITS=64"
    ] ++ [
      "--"
      # We should set the proper `CMAKE_SYSTEM_NAME`.
      # http://www.cmake.org/Wiki/CMake_Cross_Compiling
  
negative.code:   doCheck = false; # fails
  
    meta = with lib; {
      homepage = "https://cmake.org/";
      description = "Cross-platform, open-source build system generator";
      longDescription = ''
        CMake is an open-source, cross-platform family of tools designed to build,
        test and package software. CMake is used to control the software
        compilation process using simple platform and compiler independent
        configuration files, and generate native makefiles and workspaces that can
        be used in the compiler environment of your choice.
      '';
      changelog = "https://cmake.org/cmake/help/v${lib.versions.majorMinor version}/release/${lib.versions.majorMinor version}.html";
      license = licenses.bsd3;
      maintainers = with maintainers; [ ttuegel lnl7 ];
      platforms = platforms.all;
      broken = (withQt5 && stdenv.isDarwin);
    };
  }
  