]> de.git.xonotic.org Git - xonotic/xonotic.wiki.git/blob - Repository_Access.md
Update Channels
[xonotic/xonotic.wiki.git] / Repository_Access.md
1 Repository Access and Compiling
2 ===============================
3
4 Xonotic uses several Git repositories. There’s a helper script in the main repository to aid in checking out all relevant repositories and help you with building and running Xonotic.
5 The repository also contains several branches next to the stable “master” branch. So if you’re interested in the progress of a certain feature, or want to help or create a new one, you can checkout the appropriate branch.
6 For information on how to obtain write access, skip down to the “[Getting write access](Repository_Access#contributing-and-getting-write-access)” section.
7
8 For more information about the project's structure, see [git](Git).
9
10 ***
11
12 Setting up the development environment
13 --------------------------------------
14
15 The first thing you must do in order to begin with development is to set up your system to be able to download and compile the Xonotic game data. Make sure you have enough memory to compile. 1GB is likely to fail. Consider setup the environment to have at least 2G free memory for the job.
16
17 ### Linux
18
19 Linux already has an adequate base for development, all we really need to do here is to install the **dependencies** for the download/compilation process and then we can move right along to cloning the data.
20
21 **Ubuntu Dependencies** (independent package `x11-proto-devel` dependencies fill the rest of the Debian package dependencies):
22
23     sudo apt-get install build-essential xserver-xorg-dev x11proto-xf86dri-dev x11proto-xf86dga-dev x11proto-xf86vidmode-dev libxxf86dga-dev libxcb-xf86dri0-dev libxpm-dev libxxf86vm-dev libsdl1.2-dev libsdl2-dev libsdl2-image-dev libclalsadrv-dev libasound2-dev libxext-dev libjpeg-turbo8-dev git-core unzip wget zlib1g-dev
24
25 Note: If using **i386** architecture, you can replace `libdsl1.2debian` with `libsdl1.2debian:i386` in the list above. On Debian, use `libjpeg8-dev` if `libjpeg-turbo8-dev` isn’t available in the package repositories. To be able to download maps from game servers when using Xonotic for online gaming, you will also need `curl` installed on your system.
26
27 For **Fedora** and other **RPM based** distro’s, compiling dependencies are as follows:
28
29     x11-proto-devel libalsa2-static-devel libjpeg62-devel libjpeg62-static-devel libSDL2-devel
30
31 For **Archlinux** the dependencies can be installed via the following command:
32
33     sudo pacman -S alsa-lib curl libjpeg-turbo libmodplug libpng libvorbis libxpm libxxf86dga libxxf86vm sdl2 unzip
34
35 ### Windows
36
37 By default, Windows has no real environment to handle the necessary scripting and compiling tools for building Xonotic. So, what we have to do is install something called [MSYS2](http://www.msys2.org) to allow us to have a similar environment as on Linux. Download 64 bit version of MSYS2 (msys2-x86_64-xxxxxx.exe) and follow installation instructions.
38
39 Once you have completed the installation, launch the MSYS2 shell by running `mingw64.exe` (instead of the default msys2.exe) by default located at `C:\msys64` and install the needed **dependencies** with this command:
40
41     pacman --needed -S git curl zip unzip p7zip make automake autoconf libtool gcc gmp-devel mingw-w64-x86_64-{toolchain,gmp,SDL2,libjpeg-turbo,libpng,libogg}
42
43 It is recommended that you make a shortcut to MSYS2 MINGW64 shell (simply right click mingw64.exe and hit “Create Shortcut”) for easier access on your desktop or in your start menu.
44
45 You can now use this shell to continue on with the guide and clone the Xonotic repositories.
46
47 ### Mac OSX
48
49 You must first install **XCode** which comes on your installation DVD or can be downloaded from the Apple website. This package provides tools like **Git and GCC**, which are needed for successful checkout and compilation of Xonotic. Some versions of XCode come with Git and others don’t - if you don’t have Git after installing XCode get it here: [XCode installer](http://sourceforge.net/projects/git-osx-installer/files/)
50
51 After your development environment is all set up, you can continue on to cloning the git repository and compiling Xonotic.
52
53 ***
54
55 Cloning the repository and compiling
56 ------------------------------------
57
58 Making sure that your environment is set up properly, you can do the following to begin downloading and compilation (execute the first line only to download):
59
60     git clone git://git.xonotic.org/xonotic/xonotic.git
61     cd xonotic
62     ./all update -l best
63
64 Take care to do these steps as a **normal user** on Linux (not as superuser(aka root)), otherwise you’ll have to take care about the file permissions later on.
65
66 For Windows users: once finished cloning move to the root repository (`cd xonotic`) and checkout the branch Mario/Win64 with the command:
67
68     git checkout -b Mario/win64 origin/Mario/win64
69
70 The **git://** protocol uses port **9418**, which may be a problem if you’re behind a **strict firewall**. You may instead use the clone url http://git.xonotic.org/xonotic/xonotic.git (however, using the git protocol directly is preferred for performance reasons).
71
72 After that, you have a working checkout of the repository. The game can be compiled and run with the following commands:
73
74     ./all compile -r
75     ./all run
76
77 **Note:** if you encounter en error similar to darkplaces#111, try `./all clean && ./all compile -r -0`.
78
79 You can use just `./all compile` to create a slower build with debug symbols but usually you want `-r`.
80
81 The `./all run` line can be followed by one of `glx` (Linux native), `sdl` (input/sound managed by SDL), `agl` (OSX native), `wgl` (Windows native), or `dedicated` (for server hosting) to choose which executable to run or compile. Seen as follows:
82
83     ./all compile -r dedicated
84     ./all run wgl
85     ./all run sdl
86
87 The `run` command can also be followed by standard DarkPlaces commandline arguments:
88
89     ./all run +vid_fullscreen 0
90
91 To update your Git clone, you can repeat the commands above without the first “git clone” line- And don’t forget to compile after you update- Like this:
92
93     cd xonotic
94     ./all checkout
95     ./all update
96     ./all compile -r
97
98 **Note:** The compiled binary will have a faint watermark with the git revision. To remove it completely put `set menu_watermark ""` into your `autoexec.cfg`.
99
100 **Note:** If you intend to play on public servers, you should probably also enable the nexcompat repo to download additional textures that are used on some older unofficial maps. Use `touch data/xonotic-nexcompat.pk3dir.yes` and `./all update`. For mappers: these textures should NOT be used on new maps.
101
102 ***
103
104 If you run into issues with the latest version you can easily revert to an older one. Since most bugs are caused by the game code rather that the engine, you just need to downgrade that repository. Inside the main xonotic repository, use `cd data/xonotic-data` and then `git checkout <some older commit>`. After that go back `cd -` and `./all compile` (with the optional `-r` flag).
105
106 ***
107
108 Contributing and getting write access
109 -------------------------------------
110
111 A condition for write (push) access is that you agree that any code or data you push will be licensed under the General Public License, version 2, with or without the “or any later version” clause. In case the directory the changes apply to contains a LICENSE or COPYING file indicating another license, then your pushed code has to be dual licensed appropriately. Subdirectories currently having a dual license:
112 \* data/qcsrc/warpzonelib - dual licensed as “GPLv2 or later” or MIT license.
113 In case the code you pushed was not written by you, it is your responsibility to ensure proper licensing.
114
115 To apply for write access, make an issue of type “Support” in the category “Repository” and attach your public SSH key to it. (Windows users: see the Windows section below for more on SSH keys)
116
117 ### Windows/Linux/OS X
118
119 Get a checkout (see above), and do:
120
121     ./all keygen
122
123 and follow the instructions that are shown. Be sure that you've done:
124
125     ./all update -p
126
127 After that, you can write to the repository using the usual git commands (commit, push).
128
129 Alternatively, you can use the helper script `all`.
130 It supports the following commands:
131
132     ./all update
133
134 This command updates all the Xonotic repositories.
135
136     ./all branch
137
138 Lists the branches you are currently on, in the respective repositories.
139
140     ./all branches
141
142 Lists all the branches known for all the respective repositories.
143
144     ./all compile
145
146 Compiles the game, assuming that you have the required libs installed. Don't forget `-r` if you wanna actually play the game with decent fps.
147
148     ./all checkout BRANCH
149
150 Switch to that branch in all repositories where its available.
151
152     ./all commit
153
154 This command commits and pushes your local changes.
155
156     ./all run xonotic
157
158 Starts the Xonotic client
159
160     ./all run dedicated xonotic
161
162 Starts a Xonotic dedicated server
163
164 General contributor guidelines
165 ------------------------------
166
167 1.  Before creating your local branch and committing to it, make sure you’ve configured your user settings such as your name which will display in the logs (in TortoiseGit: Settings > Git > Config).
168 2.  Try naming your branch myname/mychange for each patch. For instance, if your name is Alex and the change you are committing is a menu fix, use something like alex/menufix.
169
170 Further git information
171 -----------------------
172
173 About tracking remote branches:
174 http://git-scm.com/book/en/v2/Git-Branching-Remote-Branches
175
176 This wiki’s [Git](Git) page.
177
178 A tutorial to Git for SVN users:
179 http://git-scm.org/course/svn.html