From 5fa0ff77cd0bbfd57a89f233841b5b7fccd2ddc0 Mon Sep 17 00:00:00 2001 From: Kenneth Dodrill Date: Fri, 29 Oct 2021 17:30:02 -0500 Subject: [PATCH] New package: TrenchBroom-2021.1 --- srcpkgs/TrenchBroom/files/README.voidlinux | 8 ++++ srcpkgs/TrenchBroom/patches/musl.patch | 51 ++++++++++++++++++++ srcpkgs/TrenchBroom/template | 54 ++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 srcpkgs/TrenchBroom/files/README.voidlinux create mode 100644 srcpkgs/TrenchBroom/patches/musl.patch create mode 100644 srcpkgs/TrenchBroom/template diff --git a/srcpkgs/TrenchBroom/files/README.voidlinux b/srcpkgs/TrenchBroom/files/README.voidlinux new file mode 100644 index 000000000000..5f64c5654337 --- /dev/null +++ b/srcpkgs/TrenchBroom/files/README.voidlinux @@ -0,0 +1,8 @@ +TrenchBroom currently does not support wayland. +If you normally run QT applications using + + QT_QPA_PLATFORM=wayland + +you will need to run TrenchBroom like so: + + QT_QPA_PLATFORM=xcb trenchbroom diff --git a/srcpkgs/TrenchBroom/patches/musl.patch b/srcpkgs/TrenchBroom/patches/musl.patch new file mode 100644 index 000000000000..3c4b53d7e27e --- /dev/null +++ b/srcpkgs/TrenchBroom/patches/musl.patch @@ -0,0 +1,51 @@ +--- a/lib/vecmath/include/vecmath/scalar.h 2021-10-27 17:02:35.220565752 -0500 ++++ - 2021-10-27 17:02:50.567780673 -0500 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + namespace vm { + /** +@@ -377,7 +378,7 @@ + */ + template + constexpr T trunc(const T v) { +- return static_cast(static_cast(v)); ++ return static_cast(static_cast(v)); + } + + /** +--- a/common/src/TrenchBroomStackWalker.cpp 2021-03-15 12:54:02.000000000 -0500 ++++ - 2021-10-29 17:05:18.439743183 -0500 +@@ -23,8 +23,10 @@ + #include + #endif + #else ++#if defined(__GLIBC__) + #include + #endif ++#endif + + #include "TrenchBroomStackWalker.h" + +@@ -91,6 +93,7 @@ + } + #endif + #else ++#if defined(__GLIBC__) + std::string TrenchBroomStackWalker::getStackTrace() { + const int MaxDepth = 256; + void *callstack[MaxDepth]; +@@ -109,5 +112,10 @@ + free(strs); + return ss.str(); + } ++#else ++ std::string TrenchBroomStackWalker::getStackTrace() { ++ return ""; ++ } ++#endif + #endif + } diff --git a/srcpkgs/TrenchBroom/template b/srcpkgs/TrenchBroom/template new file mode 100644 index 000000000000..4d193ab959aa --- /dev/null +++ b/srcpkgs/TrenchBroom/template @@ -0,0 +1,54 @@ +# Template file for 'TrenchBroom' +pkgname=TrenchBroom +version=2021.1 +revision=1 +archs="x86_64* i686*" +wrksrc="${pkgname}-${version}" +build_style=cmake +hostmakedepends="git pandoc" +makedepends="qt5-devel qt5-svg-devel glew-devel MesaLib-devel libfreeglut-devel + glm libXxf86vm-devel freeimage-devel freetype-devel libxcb-devel" +short_desc="Cross-Platform Level Editor" +maintainer="Kenneth Dodrill " +license="GPL-3.0-or-later" +homepage="https://trenchbroom.github.io/" +_vecmath_rev=15a858e9fff8030e895d2974244053ada67d30bb +_Catch2_rev=7f21cc6c5599f59835f769debf13b4c3e6148a28 +_BinaryLibs_rev=bacae0b1b323bf99ea54055744e294d0fa085e53 +_fmt_rev=cc09f1a6798c085c325569ef466bcdcffdc266d4 +distfiles="https://github.com/TrenchBroom/TrenchBroom/archive/refs/tags/v${version}.tar.gz + https://github.com/TrenchBroom/vecmath/archive/${_vecmath_rev}.tar.gz + https://github.com/catchorg/Catch2/archive/${_Catch2_rev}.tar.gz + https://github.com/TrenchBroom/BinaryLibs/archive/${_BinaryLibs_rev}.tar.gz + https://github.com/fmtlib/fmt/archive/${_fmt_rev}.tar.gz" +checksum="6b7fe4b906ecdb67ff52a70aeafaaf39c1fb6f64891f863483ee3fa5316ea7e6 + f4b7475b8c1ad3b9bde90ad7b2629b3c893ee193f6dfaab1f156d3f290f0e419 + 3c5a0147726e891d740a3f9de805e1d2f4fae57fbec4fbfb4d26fd9560e2604d + 20e5f96c7b8d4295c81b0641f2c2b0a66801d1c09ac708177cf74ab30a94fceb + f0da66d8f5949d78a6972f7f884310797b2dc422835a12fd3634697ec8c25acf" + +# Allows headless builds, otherwise receive an xcb error. +export QT_QPA_PLATFORM=offscreen + +pre_patch() { + rmdir lib/vecmath + rmdir lib/Catch2 + rmdir lib/BinaryLibs + rmdir lib/fmt + + mv ../vecmath-${_vecmath_rev} lib/vecmath + mv ../Catch2-${_Catch2_rev} lib/Catch2 + mv ../BinaryLibs-${_BinaryLibs_rev} lib/BinaryLibs + mv ../fmt-${_fmt_rev} lib/fmt +} + +post_install() { + vinstall app/resources/linux/trenchbroom.desktop 644 usr/share/applications + + for size in 8 16 22 24 32 36 42 48 64 72 96 128 192 256 512; do + vinstall app/resources/linux/icons/icon_${size}.png 644 \ + usr/share/icons/hicolor/${size}x${size}/apps/ trenchbroom.png + done + + vdoc "${FILESDIR}/README.voidlinux" +}