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