Add subproject instructions

Simon Ser 2020-02-15 21:34:35 +01:00
parent 500a78444e
commit d4f6b28f52

@ -1,31 +1,61 @@
This page is intended as a guide for those who wish to build the HEAD of Sway and wlroots for testing or development purposes. If you are an end-user, this page isn't relevant to you.
# Dependencies
You're going to need the following tools to get started:
* git
* gcc
* gcc or clang
* [meson](https://mesonbuild.com/)
* [ninja](https://ninja-build.org/)
You'll also need the dependencies, which you can find in the [README](https://github.com/swaywm/sway/blob/master/README.md). Avoid package bundles on distributions other than Arch Linux, as they are usually outdated.
You'll also need the dependencies, which you can find in the [README](https://github.com/swaywm/sway/blob/master/README.md).
## Arch Linux
### Arch Linux (easiest)
The Arch User Repository (AUR) has the convenient `sway-git` and `wlroots-git` package bundles, which contain everything you'll need to compile their respective projects. Use your preferred AUR helper to install these.
### Fedora
## Fedora
Fedora requires installing all of the dependencies one-by-one. `--releasever=29` is required as dependencies for versions below 29 are outdated.
#### Note
`wayland-protocols-devel` is currently outdated for release 29. You will need to pull and install this for yourself from https://github.com/wayland-project/wayland-protocols.
**Note**: `wayland-protocols-devel` is currently outdated for release 29. You will need to pull and install this for yourself from https://github.com/wayland-project/wayland-protocols.
```
dnf install -y --releasever=29 git gcc meson ninja-build wayland-devel mesa-libEGL-devel mesa-libGLES-devel mesa-dri-drivers xorg-x11-server-Xwayland libdrm-devel libgbm-devel libxkbcommon-devel libudev-devel pixman-devel libinput-devel libevdev-devel systemd-devel cairo-devel libpcap-devel json-c-devel pam-devel pango-devel pcre-devel gdk-pixbuf2-devel
```
### Debian
## Debian
On Debian-based distributions, library packages are commonly suffixed by `-dev`.
# Compiling as a subproject
To run Sway, you don't need to install it. You can build it and start it directly. Using a subproject will allow you to easily work and wlroots and Sway at the same time.
```sh
# Clone repositories
git clone git@github.com:swaywm/sway.git
cd sway
mkdir subprojects
git clone git@github.com:swaywm/wlroots.git subprojects/wlroots
# Build Sway and wlroots
meson build/
ninja -C build/
# Start Sway
build/sway/sway
```
To enable the address sanitizer (ASan) and the undefined behavior sanitizer (UBSan), add `-Db_sanitize=address,undefined` to the `meson` command.
# System-wide installation
This section is relevant if you want to install both wlroots and Sway system-wide (without using a subproject).
# Variables
_If you don't want to add the paths below to your `~/.profile`, you can paste these lines into your terminal to set the variables for the current terminal session only._
Ensure that `/usr/local/bin` is in your `PATH` by executing `echo $PATH`. If it isn't, open `~/.profile` and add: