anchor.diff:    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);
  -    homepage = "https://cmake.org/";
  -    changelog = "https://cmake.org/cmake/help/v${lib.versions.majorMinor version}/release/${lib.versions.majorMinor version}.html";
  -    description = "Cross-Platform Makefile 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.
  -    '';
  -    platforms = platforms.all;
  -    maintainers = with maintainers; [ ttuegel lnl7 ];
  -    license = licenses.bsd3;
     };
   }
  
positive.code:   # On Darwin, always set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG.
    ++ lib.optional stdenv.isDarwin ./darwin-always-set-runtime-c-flag.patch;
  
    outputs = [ "out" ]
      ++ lib.optionals buildDocs [ "man" "info" ];
    setOutputFlags = false;
  
    setupHook = ./setup-hook.sh;
  
    depsBuildBuild = [ buildPackages.stdenv.cc ];
  
    nativeBuildInputs = [ setupHook pkg-config ]
      ++ lib.optionals buildDocs [ texinfo ]
      ++ lib.optionals withQt5 [ wrapQtAppsHook ];
  
    buildInputs = lib.optionals useSharedLibraries [ bzip2 curlMinimal expat libarchive xz zlib libuv rhash ]
      ++ lib.optional useOpenSSL openssl
      ++ lib.optional useNcurses ncurses
      ++ lib.optional withQt5 qtbase
      ++ lib.optional (stdenv.isDarwin && !isBootstrap) SystemConfiguration;
  
    propagatedBuildInputs = lib.optional stdenv.isDarwin ps;
  
  
negative.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-info"
      "--sphinx-man"
    ]
    # 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
  