Skip to content

Commit

Permalink
fix(mangohud): support 32bit apps (pacstall#6342)
Browse files Browse the repository at this point in the history
update script to latest specmangohud support 32bit games via 2 builds +
installs, one for mangohud default (64bit) and one for 32bit

the problem with the current script is, that old games (or other 3d
apps) built for 32bit are not supported by the default mangohud build. I
adapted the script to build 2 mangohud versions, the default one
(resulting in 64bit mangohud install) and a second one for 32bit.
Both work together nicely, I tested it by removing all mangohud from my
install, then running the new script, then testing a modern game
(wreckfest in my case) and an old one (WoW 3.3.5a private server ~2010
(32bit)). both work fine.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Elsie <[email protected]>
  • Loading branch information
3 people authored Sep 13, 2024
1 parent 83b9849 commit f6d8854
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
9 changes: 9 additions & 0 deletions packages/mangohud/.SRCINFO
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pkgbase = mangohud
pkgver = 0.7.2
pkgdesc = A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more
url = https://github.com/flightlessmango/MangoHud
arch = amd64
makedepends = gcc
makedepends = g++
makedepends = gcc-multilib
Expand All @@ -20,6 +21,14 @@ pkgbase = mangohud
makedepends = glslang-tools
makedepends = libwayland-dev
makedepends = libxkbcommon-dev
makedepends = libx11-dev:i386
makedepends = libxnvctrl-dev:i386
makedepends = libdbus-1-dev:i386
makedepends = libwayland-dev:i386
makedepends = libxkbcommon-dev:i386
makedepends = libc6-dev-i386
makedepends = libgcc-12-dev:i386
provides = mangohud:i386
incompatible = debian:bullseye
maintainer = xdavius <[email protected]>
repology = project: mangohud
Expand Down
40 changes: 36 additions & 4 deletions packages/mangohud/mangohud.pacscript
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,51 @@ repology=("project: mangohud")
pkgver="0.7.2"
source=("https://github.com/flightlessmango/MangoHud/archive/refs/tags/v${pkgver}.tar.gz")
url='https://github.com/flightlessmango/MangoHud'
makedepends=("gcc" "g++" "gcc-multilib" "g++-multilib" "meson" "ninja-build" "python3-pip" "python3-setuptools" "python3-wheel" "python3-mako" "pkg-config" "mesa-common-dev" "libx11-dev" "libxnvctrl-dev" "libdbus-1-dev" "glslang-tools" "libwayland-dev" "libxkbcommon-dev")
makedepends=(
"gcc" "g++"
"gcc-multilib" "g++-multilib"
"meson" "ninja-build"
"python3-pip" "python3-setuptools" "python3-wheel" "python3-mako"
"pkg-config" "mesa-common-dev"
"libx11-dev" "libxnvctrl-dev" "libdbus-1-dev" "glslang-tools"
"libwayland-dev" "libxkbcommon-dev"
"libx11-dev:i386" "libxnvctrl-dev:i386" "libdbus-1-dev:i386"
"libwayland-dev:i386" "libxkbcommon-dev:i386" "libc6-dev-i386" "libgcc-12-dev:i386"
)
incompatible=('debian:bullseye')
provides=("mangohud:i386")
arch=("amd64")
pkgdesc="A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more"
sha256sums=("67d2425c0cc634574d8bd8a924e0e1a2e909b47ed9b8c02029b5baffe46657fc")
incompatible=('debian:bullseye')
maintainer=("xdavius <[email protected]>")
external_connection=true

build() {
cd "${_archive}"
meson build --prefix="/usr"

# 32-bit games require 32-bit mangohud build

# Build 64-bit version
meson build64 --prefix="/usr"
ninja -j"${NCPU}" -C build64

# Set the necessary environment variables for 32-bit build
export CC="gcc -m32"
export CXX="g++ -m32"
export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig"
export LIBRARY_PATH="/usr/lib/i386-linux-gnu:/lib/i386-linux-gnu:/usr/lib/gcc/i686-linux-gnu/12"

# Build 32-bit version
meson build32 --libdir="lib/i386-linux-gnu" --prefix="/usr"
ninja -j"${NCPU}" -C build32
}

package() {
cd "${_archive}"
DESTDIR="${pkgdir}" ninja -j"${NCPU}" -C build install

# Install 64-bit version
DESTDIR="${pkgdir}" ninja -j"${NCPU}" -C build64 install

# Install 32-bit version
DESTDIR="${pkgdir}" ninja -j"${NCPU}" -C build32 install
}
9 changes: 9 additions & 0 deletions srclist
Original file line number Diff line number Diff line change
Expand Up @@ -5902,6 +5902,7 @@ pkgbase = mangohud
pkgver = 0.7.2
pkgdesc = A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more
url = https://github.com/flightlessmango/MangoHud
arch = amd64
makedepends = gcc
makedepends = g++
makedepends = gcc-multilib
Expand All @@ -5920,6 +5921,14 @@ pkgbase = mangohud
makedepends = glslang-tools
makedepends = libwayland-dev
makedepends = libxkbcommon-dev
makedepends = libx11-dev:i386
makedepends = libxnvctrl-dev:i386
makedepends = libdbus-1-dev:i386
makedepends = libwayland-dev:i386
makedepends = libxkbcommon-dev:i386
makedepends = libc6-dev-i386
makedepends = libgcc-12-dev:i386
provides = mangohud:i386
incompatible = debian:bullseye
maintainer = xdavius <[email protected]>
repology = project: mangohud
Expand Down

0 comments on commit f6d8854

Please sign in to comment.