Update build steps in README.md (#517)

pull/532/head
jackun 3 years ago committed by GitHub
parent ac11beef9b
commit 18d401d626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,20 +16,67 @@ git clone --recurse-submodules https://github.com/flightlessmango/MangoHud.git
cd MangoHud
```
To build it, execute:
Using `meson` to install "manually":
```
./build.sh build
./build.sh package
meson build
ninja -C build install
```
**NOTE: If you are running an Ubuntu-based, Arch-based, Fedora-based, or openSUSE-based distro, the build script will automatically detect and prompt you to install missing build dependencies. If you run into any issues with this please report them!**
By default, meson should install MangoHud to `/usr/local`. Specify install prefix with `--prefix=/usr` if desired.
Add `-Dappend_libdir_mangohud=false` option to meson to not append `mangohud` to libdir if desired (e.g. /usr/local/lib/mangohud).
To install 32-bit build on 64-bit distro, specify proper `libdir`: `lib32` for Arch, `lib/i386-linux-gnu` on Debian. RPM-based distros usually install 32-bit libraries to `/usr/lib` and 64-bit to `/usr/lib64`.
You may have to change `PKG_CONFIG_PATH` to point to correct folders for your distro.
```
CC="gcc -m32" \
CXX="g++ -m32" \
PKG_CONFIG_PATH="/usr/lib32/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig" \
meson build32 --libdir lib32
ninja -C build32 install
```
### Dependencies
Install necessary development packages.
- gcc, g++
- or gcc-multilib, g++-multilib for 32-bit support
- meson >=0.54
- ninja (ninja-build)
- glslang
- vulkan headers if using `-Duse_system_vulkan=enabled` option with `meson`
- libGL/libEGL (libglvnd, mesa-common-dev, mesa-libGL-devel etc)
- X11 (libx11-dev)
- libdrm (libdrm-dev)
- XNVCtrl (libxnvctrl-dev), optional, use `-Dwith_xnvctrl=disabled` option with `meson` to disable
- D-Bus (libdbus-1-dev), optional, use `-Dwith_dbus=disabled` option with `meson` to disable
Python 3 libraries:
- Mako (python3-mako or install with `pip`)
If distro's packaged `meson` is too old and gives build errors, install newer version with `pip` (`python3-pip`).
### Building with build script
You can also use `build.sh` script to do some things automatically like install dependencies, if distro is supported but it usually assumes you are running on x86_64 architecture.
To just build it, execute:
```
./build.sh build
```
Once done, proceed to the [installation](#source).
You can also pass arguments to meson:
## Install
```
./build.sh build -Dwith_xnvctrl=disabled
```
### Source
Resulting files will be install to `./build/release` folder.
If you have compiled MangoHud from source, to install it, execute:
@ -43,6 +90,29 @@ You can then subsequently uninstall MangoHud via the following command
./build.sh uninstall
```
To tar up the resulting binaries into a package and create a release tar with installer script, execute:
```
./build.sh package release
```
or combine the commands, although `package` should also call `build` if it doesn't find the built libs:
```
./build.sh build package release
```
If you have built MangoHud before and suddenly it fails, you can try cleaning the `build` folder, execute:
```
./build.sh clean
```
Currently it just does `rm -fr build` and clears subprojects.
**NOTE: If you are running an Ubuntu-based, Arch-based, Fedora-based, or openSUSE-based distro, the build script will automatically detect and prompt you to install missing build dependencies. If you run into any issues with this please report them!**
### Pre-packaged binaries
#### GitHub releases

Loading…
Cancel
Save