1 { lib, stdenv, fetchFromGitHub, fetchsvn
2 , scons, pkg-config, python3
3 , glib, libxml2, gtk2, libGLU, gnome2
4 , runCommand, writeScriptBin, runtimeShell
5 , makeDesktopItem, copyDesktopItems
10 url = "svn://svn.icculus.org/gtkradiant-gamepacks/Q3Pack/trunk";
12 sha256 = "sha256-U1GtMv775JEOAJ1W2kSaRNPDCnW39W+KqVDTTG2yISY=";
15 url = "svn://svn.icculus.org/gtkradiant-gamepacks/UrTPack/trunk";
17 sha256 = "sha256-DQjENyQa1kEieU3ZWyMt2e4oEN0X2K3lxP79sBI91iI=";
20 url = "svn://svn.icculus.org/gtkradiant-gamepacks/ETPack/trunk";
22 sha256 = "sha256-mqaWOYfF/F6ABh7nKA36YvsywZIdwJ9IitFi2Xp5rgk=";
25 url = "svn://svn.icculus.org/gtkradiant-gamepacks/QLPack/trunk";
27 sha256 = "sha256-lrn4nu3JI7j+t9jYd+UFE55GOCbc6+Sh2fZfVlEr1WM=";
30 url = "svn://svn.icculus.org/gtkradiant-gamepacks/Q2Pack/trunk";
32 sha256 = "sha256-ad8dRV+28Zz5yQsJU7hvteSIn9wWpehuqxMspw3yvvU=";
34 quetooPack = fetchsvn {
35 url = "svn://svn.icculus.org/gtkradiant-gamepacks/QuetooPack/trunk";
37 sha256 = "sha256-SOblPJgdVEZrTYtvDlcF7paIm3UitSVFQ9+RahXkO64=";
40 url = "svn://svn.icculus.org/gtkradiant-gamepacks/JAPack/trunk";
42 sha256 = "sha256-P6lI+nNrPwoWJl5ThUHIA3Iw1nWVo2djaaWHAF5HuDo=";
44 stvefPack = fetchsvn {
45 url = "svn://svn.icculus.org/gtkradiant-gamepacks/STVEFPack/trunk";
47 sha256 = "sha256-quNyVC6fg1FIBsLWx0LzRK2JfxKMNJeUEIkWGhGJHhI=";
50 url = "svn://svn.icculus.org/gtkradiant-gamepacks/WolfPack/trunk";
52 sha256 = "sha256-693k6KiIchQddVGBhRJf7ikv6ut5L9rcLt0FTZ7pSvw=";
54 unvanquishedPack = fetchsvn {
55 url = "https://github.com/Unvanquished/unvanquished-mapeditor-support.git/trunk/build/gtkradiant/";
57 sha256 = "sha256-weBlnSBezPppbhsMOT66vubioTxpDC+AcKIOC2Xitdo=";
60 url = "svn://svn.icculus.org/gtkradiant-gamepacks/Q1Pack/trunk";
62 sha256 = "sha256-JfmDIUoDY7dYdMgwwUMgcwNhWxuxsdkv1taw8DXhPY4=";
64 packs = runCommand "gtkradiant-packs" {} ''
66 ln -s ${q3Pack} $out/Q3Pack
67 ln -s ${urtPack} $out/UrTPack
68 ln -s ${etPack} $out/ETPack
69 ln -s ${qlPack} $out/QLPack
70 ln -s ${q2Pack} $out/Q2Pack
71 ln -s ${quetooPack} $out/QuetooPack
72 ln -s ${jaPack} $out/JAPack
73 ln -s ${stvefPack} $out/STVEFPack
74 ln -s ${wolfPack} $out/WolfPack
75 ln -s ${unvanquishedPack} $out/UnvanquishedPack
76 ln -s ${q1Pack} $out/Q1Pack
80 stdenv.mkDerivation rec {
83 version = "unstable-2022-07-31";
85 src = fetchFromGitHub {
88 rev = "5b498bfa01bde6c2c9eb60fb94cf04666e52d22d";
89 sha256 = "sha256-407faeQnhxqbWgOUunQKj2JhHeqIzPPgrhz2K5O4CaM=";
92 # patch paths so that .game settings are put into the user's home instead of the read-only /nix/store
94 substituteInPlace radiant/preferences.cpp \
95 --replace 'gameFilePath += "games/";' 'gameFilePath = g_get_home_dir(); gameFilePath += "/.cache/radiant/games/";printf("gameFilePath: %s\\n", gameFilePath);' \
96 --replace 'radCreateDirectory( gameFilePath );' 'if (g_mkdir_with_parents( gameFilePath, 0777 ) == -1) {radCreateDirectory( gameFilePath );};' \
97 --replace 'strGamesPath = g_strAppPath.GetBuffer();' 'strGamesPath = g_get_home_dir();' \
98 --replace 'strGamesPath += "games";' 'strGamesPath += "/.cache/radiant/games";'
103 python = python3.withPackages (ps: with ps; [
106 svn = writeScriptBin "svn" ''
108 if [ "$1" = checkout ]; then
109 # link predownloaded pack to destination
110 mkdir -p $(dirname $3)
111 ln -s ${packs}/$(basename $3) $3
113 test -e $(readlink $3)
114 elif [ "$1" = update ]; then
116 test -e $(readlink $3)
130 buildInputs = [ glib libxml2 gtk2 libGLU gnome2.gtkglext ];
132 enableParallelBuilding = true;
134 desktopItems = [ (makeDesktopItem {
137 desktopName = "GtkRadiant";
138 comment = meta.description;
139 categories = [ "Development" ];
141 # includes its own splash screen
142 startupNotify = false;
146 mkdir -p $out/{bin,lib}
147 cp -ar install $out/lib/gtkradiant
149 ln -s ../lib/gtkradiant/radiant.bin $out/bin/gtkradiant
150 ln -s ../lib/gtkradiant/{q3map2,q3map2_urt,q3data} $out/bin/
152 mkdir -p $out/share/pixmaps
153 ln -s ../../lib/gtkradiant/bitmaps/icon.png $out/share/pixmaps/gtkradiant.png
157 description = "Level editor for idTech games";
158 homepage = "https://icculus.org/gtkradiant/";
159 license = with licenses; [ gpl2Only bsdOriginal lgpl21Only ];
160 maintainers = with maintainers; [ astro ];
161 platforms = platforms.unix;