anchor.diff:  
     meta = with lib; {
       homepage = "https://trenchbroom.github.io/";
  +    changelog = "https://github.com/TrenchBroom/TrenchBroom/releases/tag/v${version}";
       description = "Level editor for Quake-engine based games";
       license = licenses.gpl3Only;
       maintainers = with maintainers; [ astro ];
  
positive.code: { lib, stdenv, fetchFromGitHub
  , cmake, ninja, git, pandoc
  , libGL, libGLU, libXxf86vm, freeimage
  , qtbase, wrapQtAppsHook
  , copyDesktopItems, makeDesktopItem
  }:
  
  stdenv.mkDerivation rec {
    pname = "TrenchBroom";
    version = "2021.1";
  
    src = fetchFromGitHub {
      owner = "TrenchBroom";
      repo = "TrenchBroom";
      rev = "v${version}";
      sha256 = "06j68kp7g57hclyp8ilh2wd4vr5w8r718cicdp1cap48fcxlqfxv";
      fetchSubmodules = true;
    };
    postPatch = ''
  
negative.code:       --subst-var-by APP_VERSION_YEAR ${lib.versions.major version} \
        --subst-var-by APP_VERSION_NUMBER ${lib.versions.minor version} \
        --subst-var-by GIT_DESCRIBE v${version}
    '';
  
    nativeBuildInputs = [ cmake git pandoc wrapQtAppsHook copyDesktopItems pkg-config ];
    buildInputs = [
      libGL libGLU libXxf86vm freeimage qtbase catch2 fmt glew miniz tinyxml-2
      xorg.libSM
    ];
    QT_PLUGIN_PATH = "${qtbase}/${qtbase.qtPluginPrefix}";
    QT_QPA_PLATFORM = "offscreen";
  
    cmakeFlags = [
      # https://github.com/TrenchBroom/TrenchBroom/issues/4002#issuecomment-1125390780
      "-DCMAKE_PREFIX_PATH=cmake/packages"
    ];
    ninjaFlags = [
      "TrenchBroom"
    ];
  