trenchbroom: init at 2021.1

Astro 24ce53d7 5fe7b306

+69
+65
pkgs/applications/misc/trenchbroom/default.nix
···
··· 1 + { lib, stdenv, fetchFromGitHub 2 + , cmake, ninja, git, pandoc 3 + , libGL, libGLU, libXxf86vm, freeimage 4 + , qtbase, wrapQtAppsHook 5 + , copyDesktopItems, makeDesktopItem 6 + }: 7 + 8 + stdenv.mkDerivation rec { 9 + pname = "TrenchBroom"; 10 + version = "2021.1"; 11 + 12 + src = fetchFromGitHub { 13 + owner = "TrenchBroom"; 14 + repo = "TrenchBroom"; 15 + rev = "v${version}"; 16 + sha256 = "06j68kp7g57hclyp8ilh2wd4vr5w8r718cicdp1cap48fcxlqfxv"; 17 + fetchSubmodules = true; 18 + }; 19 + postPatch = '' 20 + substituteInPlace common/src/Version.h.in \ 21 + --subst-var-by APP_VERSION_YEAR ${lib.versions.major version} \ 22 + --subst-var-by APP_VERSION_NUMBER ${lib.versions.minor version} \ 23 + --subst-var-by GIT_DESCRIBE v${version} 24 + ''; 25 + 26 + nativeBuildInputs = [ cmake git pandoc wrapQtAppsHook copyDesktopItems ]; 27 + buildInputs = [ libGL libGLU libXxf86vm freeimage qtbase ]; 28 + QT_PLUGIN_PATH = "${qtbase}/${qtbase.qtPluginPrefix}"; 29 + QT_QPA_PLATFORM = "offscreen"; 30 + ninjaFlags = [ 31 + "TrenchBroom" 32 + ]; 33 + preBuild = "export HOME=$(mktemp -d)"; 34 + 35 + postInstall = '' 36 + pushd $out/share/TrenchBroom/icons 37 + 38 + for F in icon_*.png; do 39 + SIZE=$(echo $F|sed -e s/icon_// -e s/.png//) 40 + DIR=$out/share/icons/hicolor/$SIZE"x"$SIZE/apps 41 + mkdir -p $DIR 42 + ln -s ../../../../TrenchBroom/icons/$F $DIR/trenchbroom.png 43 + done 44 + 45 + popd 46 + ''; 47 + 48 + desktopItems = [ 49 + (makeDesktopItem { 50 + name = "TrenchBroom"; 51 + desktopName = "TrenchBroom level editor"; 52 + icon = "trenchbroom"; 53 + comment = meta.description; 54 + categories = "Development"; 55 + exec = "trenchbroom"; 56 + }) 57 + ]; 58 + 59 + meta = with lib; { 60 + homepage = "https://trenchbroom.github.io/"; 61 + description = "Level editor for Quake-engine based games"; 62 + license = licenses.gpl3Only; 63 + maintainers = with maintainers; [ astro ]; 64 + }; 65 + }
+4
pkgs/top-level/all-packages.nix
··· 9710 9711 trebleshot = libsForQt5.callPackage ../applications/networking/trebleshot { }; 9712 9713 trickle = callPackage ../tools/networking/trickle {}; 9714 9715 inherit (nodePackages) triton;
··· 9710 9711 trebleshot = libsForQt5.callPackage ../applications/networking/trebleshot { }; 9712 9713 + trenchbroom = libsForQt5.callPackage ../applications/misc/trenchbroom { 9714 + inherit (xorg) libXxf86vm; 9715 + }; 9716 + 9717 trickle = callPackage ../tools/networking/trickle {}; 9718 9719 inherit (nodePackages) triton;