]> git.xonotic.org Git - xonotic/netradiant.git/blob - README.md
Merge branch 'kingpin' into 'master'
[xonotic/netradiant.git] / README.md
1 NetRadiant
2 ==========
3
4 ![NetRadiant logo](setup/data/tools/bitmaps/splash.png)
5
6 The open source, cross platform level editor for id Tech-derivated games (Radiant fork).
7
8 # Getting the sources
9
10 The latest source is available from the git repository:
11
12 https://gitlab.com/xonotic/netradiant.git
13
14 The git client can be obtained from the Git website:
15
16 http://git-scm.org
17
18 To get a copy of the source using the command line git client:
19
20 ```
21 git clone --recursive https://gitlab.com/xonotic/netradiant.git
22 cd netradiant
23 ```
24
25 See also https://gitlab.com/xonotic/netradiant/ for a source browser, issues and more.
26
27 # Dependencies
28
29 * OpenGL
30 * LibXml2
31 * GTK2
32 * GtkGLExt
33 * LibJpeg
34 * LibPng
35 * LibWebp
36 * Minizip
37 * ZLib
38
39 To fetch default game packages you'll need Git and to fetch some optional ones you'll need Subversion.
40
41 ## MSYS2
42
43 Under MSYS2, the mingw shell must be used.
44
45 If you use MSYS2 over SSH, add `mingw64` to the path this way (given you compile for 64 bit Windows): 
46
47 ```
48 export PATH="/mingw64/bin:${PATH}"`
49 ```
50
51 Install the dependencies this way:
52
53
54 ```
55 pacman -S --needed base-devel mingw-w64-$(uname -m)-{ntldd-git,toolchain,cmake,make,gtk2,gtkglext,libwebp,minizip-git} git
56 ```
57
58 Explicitely use `mingw-w64-x86_64-` or `mingw-w64-i686-` prefix if you need to target a non-default architecture.
59
60 You may have to install `subversion` and `unzip` to fetch or extract some non-default game packages.
61
62
63 ## macOS:
64
65 ```
66 brew install gcc cmake gtkglext pkgconfig minizip webp coreutils gnu-sed
67 brew link --force gettext
68 ```
69
70 # Submodules
71
72  * Crunch (optional, disabled by default, only supported with CMake build)
73
74 If you have not used `--recursive` option at `git clone` time, you can fetch Crunch this way (run it within the `netradiant` repository):
75
76
77 ```
78 git submodule update --init --recursive
79 ```
80
81 # Compiling
82
83 ## Initial build
84
85 This project uses the usual CMake workflow:
86
87 ### Debug
88
89 ```
90 cmake -G "Unix Makefiles" -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug && cmake --build build -- -j$(nproc)
91 ```
92
93 ### Release
94
95 ```
96 cmake -G "Unix Makefiles" -H. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build -- -j$(nproc)
97 ```
98
99 On macOS you have to add this to the first cmake call:
100
101 ```
102 -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9
103 ```
104
105 On FreeBSD you have to add this to the first cmake call:
106
107 ```
108 -DCMAKE_C_COMPILER=/usr/local/bin/gcc8 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++8
109 ```
110
111 ## Subsequent builds
112
113 The initial build will download the gamepacks and build NetRadiant and tools. If you frequently recompile you can skip downloading the gamepacks:
114
115 ```
116 cmake --build build --target binaries -- -j$(nproc)
117 ```
118
119 You should still periodically update gamepacks:
120
121 ```
122 cmake --build build --target gamepacks
123 ```
124
125 ## Build and installation details
126
127 ### Compilation details
128
129 options:
130
131 * `BUNDLE_LIBRARIES=ON`
132    Bundle libraries (only MSYS2 is supported at this time)
133 * `BUILD_RADIANT=OFF`  
134    Do not build NetRadiant (default: `ON`, build netradiant graphical editor)
135 * `BUILD_TOOLS=OFF`  
136    Do not build q3map2 and other tools (default: `ON`, build command line tools)
137 * `BUILD_CRUNCH=ON`  
138    Enable crunch support (default: `OFF`, disable crunch support)
139 * `RADIANT_ABOUTMSG="Custom build"`  
140    A message shown in the about dialog
141
142 targets:
143
144 * `binaries`          Compiles all binaries
145   - `netradiant`      Compiles the netradiant editor
146   - `modules`         Compiles all modules (each module has its own target as well)
147   - `plugins`         Compiles all plugins (each plugin has its own target as well)
148   - `tools`           Compiles all tools (each tool has its own target as well)
149      * `quake2`       Compiles all the Quake2 tools: `q2map`, `qdata3`
150      * `heretic2`     Compiles all the Heretic2 tools: `q2map`, `h2data`
151      * `quake3`       Compiles all the Quake3 tools:
152          - `q3map2`   Compiles the quake3 map compiler
153          - `q3data`   Compiles the q3data tool
154
155 Type `make help` to get an exhaustive list of targets.
156
157 ### Download details
158
159 options:
160
161 * `DOWNLOAD_GAMEPACKS=OFF`  
162    Do not automatically download the gamepack data on each compilation and do not install game packs already downloaded (default: `ON`)
163 * `GAMEPACKS_LICENSE_LIST=all`  
164    Download all gamepacks whatever the license (default: `free`, download free gamepacks, can be set to `none` to only filter by name)
165 * `GAMEPACKS_NAME_LIST="Xonotic Unvanquished"`  
166    Download gamepacks for the given games (default: `none`, do not select more gamepacks to download)
167
168 target:
169
170 * `gamepacks` Downloads the game pack data
171
172 Run `./gamepacks-manager -h` to know about available licenses and other available games. Both lists are merged, for example setting `GAMEPACKS_LICENSE_LIST=GPL` and `GAMEPACKS_NAME_LIST=Q3` will install both GPL gamepacks and proprietary Quake 3 one.
173
174 ### Installation details
175
176 options:
177
178 * `FHS_INSTALL=ON`  
179   Available for POSIX systems: install files following the Filesystem Hierarchy Standard (bin, lib, share, etc.), also setup XDG mime and application support on Linux-like systems (default: `OFF`, install like in 1999)
180 * `CMAKE_INSTALL_PREFIX=/usr`  
181   Install system-wide on Posix systems, always set `FHS_INSTALL` to `ON` when doing this (default: install in `install/` directory within source tree)
182
183 target:
184
185 * `install`  
186   Install files
187
188 ## Note about Crunch
189
190 The crnlib used to decode `.crn` files is the one from [Dæmon](http://github.com/DaemonEngine/Daemon) which is the one by [Unity](https://github.com/Unity-Technologies/crunch/tree/unity) made cross-platform and slightly improved. Since Unity brokes compatibility with [BinomialLLC's legacy tree](https://github.com/BinomialLLC/crunch) it's required to use either the `crunch` tool from Dæmon or the one from Unity to compress textures that have to be read by radiant or q3map2.