From 0e680f8f7da4a4d4f3a9f97684de77892386f9ef Mon Sep 17 00:00:00 2001 From: FlightlessMango Date: Tue, 15 Mar 2022 22:30:10 +0100 Subject: [PATCH] Add PKGBUILD --- pkgbuild/PKGBUILD | 72 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 pkgbuild/PKGBUILD diff --git a/pkgbuild/PKGBUILD b/pkgbuild/PKGBUILD new file mode 100644 index 00000000..2442adef --- /dev/null +++ b/pkgbuild/PKGBUILD @@ -0,0 +1,72 @@ +# Maintainer: Simon Hallsten + +pkgname=('mangohud' 'lib32-mangohud') +pkgver=0.6.6.1.r175.g11142b5 +pkgrel=1 +pkgdesc="Vulkan and OpenGL overlay to display performance information" +arch=('x86_64') +makedepends=('dbus' 'gcc' 'meson' 'python-mako' 'libx11' 'lib32-libx11' 'git' 'pkgconf' 'vulkan-headers') +depends=('glslang' 'libglvnd' 'lib32-libglvnd' 'glew' 'glfw-x11') +replaces=('vulkan-mesa-layer-mango') +license=('MIT') +source=("mangohud"::"git+https://github.com/flightlessmango/MangoHud.git#branch=master" + "mangohud-minhook"::"git+https://github.com/flightlessmango/minhook.git" + "imgui-v1.81.tar.gz::https://github.com/ocornut/imgui/archive/v1.81.tar.gz" + "imgui-1.81-1-wrap.zip::https://wrapdb.mesonbuild.com/v1/projects/imgui/1.81/1/get_zip" + "spdlog-1.8.5.tar.gz::https://github.com/gabime/spdlog/archive/v1.8.5.tar.gz" + "spdlog-1.8.5-1-wrap.zip::https://wrapdb.mesonbuild.com/v1/projects/spdlog/1.8.5/1/get_zip") + +sha256sums=('SKIP' + 'SKIP' + 'f7c619e03a06c0f25e8f47262dbc32d61fd033d2c91796812bf0f8c94fca78fb' + '6d00b442690b6a5c5d8f898311daafbce16d370cf64f53294c3b8c5c661e435f' + '944d0bd7c763ac721398dca2bb0f3b5ed16f67cef36810ede5061f35a543b4b8' + '3c38f275d5792b1286391102594329e98b17737924b344f98312ab09929b74be') + +_build_args="-Dappend_libdir_mangohud=false -Dwith_xnvctrl=disabled -Duse_system_vulkan=enabled -Dmangoapp_layer=true" + +pkgver() { + cd "$srcdir/mangohud" + git describe --tags | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g' +} + +prepare() { + cd "${srcdir}/mangohud" + git submodule init + git config submodule.modules/minhook.url "$srcdir/mangohud-minhook" + git submodule update + + # meson subprojects + ln -sv "$srcdir/imgui-1.81" subprojects + ln -sv "$srcdir/spdlog-1.8.5" subprojects +} + +build() { + arch-meson mangohud build64 \ + ${_build_args} -Dmangoapp=true -Dmangohudctl=true + + ninja -C build64 + export CC="gcc -m32" + export CXX="g++ -m32" + export PKG_CONFIG_PATH="/usr/lib32/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig:${PKG_CONFIG_PATH_32}" + export LLVM_CONFIG="/usr/bin/llvm-config32" + + arch-meson mangohud build32 \ + --libdir=lib32 \ + ${_build_args} + + ninja -C build32 +} + +package_mangohud() { + provides=("mangohud") + conflicts=('mangohud-common') + DESTDIR="${pkgdir}" ninja -C build64 install +} + +package_lib32-mangohud() { + provides=("lib32-mangohud") + DESTDIR="${pkgdir}" ninja -C build32 install + rm -rf "$pkgdir/usr/bin" + rm -rf "$pkgdir/usr/share" +}