From 6c515ce0fa13576df734d66a5f614f54f709f17e Mon Sep 17 00:00:00 2001 From: biopsin Date: Sun, 8 Aug 2021 10:16:06 +0000 Subject: [PATCH] New package: etlegacy-2.77.1 --- srcpkgs/etlegacy/INSTALL.msg | 2 ++ srcpkgs/etlegacy/REMOVE | 8 +++++ srcpkgs/etlegacy/files/README.voidlinux | 14 +++++++++ srcpkgs/etlegacy/files/get-pak.sh | 16 ++++++++++ .../etlegacy/patches/expand_arch_branch.patch | 29 +++++++++++++++++ srcpkgs/etlegacy/patches/fix_musl.patch | 11 +++++++ srcpkgs/etlegacy/template | 31 +++++++++++++++++++ 7 files changed, 111 insertions(+) create mode 100644 srcpkgs/etlegacy/INSTALL.msg create mode 100644 srcpkgs/etlegacy/REMOVE create mode 100644 srcpkgs/etlegacy/files/README.voidlinux create mode 100755 srcpkgs/etlegacy/files/get-pak.sh create mode 100644 srcpkgs/etlegacy/patches/expand_arch_branch.patch create mode 100644 srcpkgs/etlegacy/patches/fix_musl.patch create mode 100644 srcpkgs/etlegacy/template diff --git a/srcpkgs/etlegacy/INSTALL.msg b/srcpkgs/etlegacy/INSTALL.msg new file mode 100644 index 000000000000..bf134e9dd5ea --- /dev/null +++ b/srcpkgs/etlegacy/INSTALL.msg @@ -0,0 +1,2 @@ +See /usr/share/doc/etlegacy/README.voidlinux for further +installation instructions and troubleshooting information. diff --git a/srcpkgs/etlegacy/REMOVE b/srcpkgs/etlegacy/REMOVE new file mode 100644 index 000000000000..5241941773ad --- /dev/null +++ b/srcpkgs/etlegacy/REMOVE @@ -0,0 +1,8 @@ +# REMOVE +case "${ACTION}" in + pre) + if [ "${UPDATE}" = "no" ]; then + rm /usr/lib/etlegacy/etmain/pak*.pk3 + fi + ;; +esac diff --git a/srcpkgs/etlegacy/files/README.voidlinux b/srcpkgs/etlegacy/files/README.voidlinux new file mode 100644 index 000000000000..97c15ba29cec --- /dev/null +++ b/srcpkgs/etlegacy/files/README.voidlinux @@ -0,0 +1,14 @@ +Game depends on original package assets to run and must be +downloaded manually after the install by executing the +provided script in /usr/lib/etlegacy/get-pak.sh as root + + # /usr/lib/etlegacy/get-pak.sh + +If download fails, check if host server is reachable + + $ ping -c3 mirror.etlegacy.com + +please reach out on https://teammuppet.com/home/forums/ +for any game issues or just for a general chat. + +Have a nice game! diff --git a/srcpkgs/etlegacy/files/get-pak.sh b/srcpkgs/etlegacy/files/get-pak.sh new file mode 100755 index 000000000000..c85daa96a91e --- /dev/null +++ b/srcpkgs/etlegacy/files/get-pak.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +[ "$(id -u)" -ne 0 ] && echo "Run as root" && exit 1 + +echo "Downloading 219MB package asset files to run" +for i in 0 1 2; do + xbps-fetch -o /usr/lib/etlegacy/etmain/pak$i.pk3 https://mirror.etlegacy.com/etmain/pak$i.pk3 +done + +if [ "$?" -ne 0 ]; then + echo "" + echo "See /usr/share/doc/etlegacy/README.voidlinux" +else + echo "" + echo "Start game with 'etl'" +fi diff --git a/srcpkgs/etlegacy/patches/expand_arch_branch.patch b/srcpkgs/etlegacy/patches/expand_arch_branch.patch new file mode 100644 index 000000000000..352355a09f1b --- /dev/null +++ b/srcpkgs/etlegacy/patches/expand_arch_branch.patch @@ -0,0 +1,29 @@ +--- a/cmake/ETLPlatform.cmake.ori 2021-03-17 09:51:48.000000000 +0100 ++++ b/cmake/ETLPlatform.cmake 2021-09-13 21:57:30.274791781 +0200 +@@ -259,6 +259,14 @@ + message(STATUS "Detected ARMV7 target processor") + set(ARCH "arm") + #add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV7=1) ++ elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7-a") ++ set(ARCH "armeabi-v7a") ++ elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") ++ set(ARCH "arm64-v8a") ++ elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "ppc64*") ++ set(ARCH "ppc64") ++ elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "ppc*") ++ set(ARCH "ppc") + else() + set(ARCH "${CMAKE_SYSTEM_PROCESSOR}") + message(STATUS "Warning: processor architecture not recognised (${CMAKE_SYSTEM_PROCESSOR})") + +--- a/src/qcommon/q_platform.h.ori 2021-03-17 09:51:48.000000000 +0100 ++++ b/src/qcommon/q_platform.h 2021-09-13 22:17:09.146901486 +0200 +@@ -218,6 +218,8 @@ + #define ARCH_STRING "sparc" + #elif defined __arm__ + #define ARCH_STRING "arm" // __ARM_ARCH_'V'__ FIXME: add ARM version to the ARCH_STRING ++#elif defined __aarch64__ ++#define ARCH_STRING "arm64-v8a" + #elif defined __cris__ + #define ARCH_STRING "cris" + #elif defined __hppa__ diff --git a/srcpkgs/etlegacy/patches/fix_musl.patch b/srcpkgs/etlegacy/patches/fix_musl.patch new file mode 100644 index 000000000000..9ac2c2f6a6a1 --- /dev/null +++ b/srcpkgs/etlegacy/patches/fix_musl.patch @@ -0,0 +1,11 @@ +--- a/src/qcommon/q_platform.h.ori 2021-03-17 09:51:48.000000000 +0100 ++++ b/src/qcommon/q_platform.h 2021-09-13 22:14:56.029889098 +0200 +@@ -228,7 +228,7 @@ + #define ARCH_STRING "sh" + #endif + +-#if __FLOAT_WORD_ORDER == __BIG_ENDIAN ++#if __BYTE_ORDER == __BIG_ENDIAN + #define Q3_BIG_ENDIAN + #else + #define Q3_LITTLE_ENDIAN diff --git a/srcpkgs/etlegacy/template b/srcpkgs/etlegacy/template new file mode 100644 index 000000000000..237b5748b308 --- /dev/null +++ b/srcpkgs/etlegacy/template @@ -0,0 +1,31 @@ +# Template file for 'etlegacy' +pkgname=etlegacy +version=2.77.1 +revision=1 +build_style=cmake +configure_args="-DCMAKE_BUILD_TYPE=Release -DCMAKE_LIBRARY_PATH=/usr \ + -DCMAKE_INSTALL_PREFIX=/usr -DINSTALL_DEFAULT_BASEDIR=/usr/lib/etlegacy \ + -DCLIENT_GLVND=1 -DBUNDLED_LIBS=0 -DFEATURE_AUTOUPDATE=0 \ + -DINSTALL_OMNIBOT=0 -DCROSS_COMPILE32=0" +hostmakedepends="libtool pkg-config" +makedepends="libglvnd-devel glew-devel SDL2-devel zlib-devel minizip-devel + libjpeg-turbo-devel libcurl-devel lua54-devel libvorbis-devel libtheora-devel freetype-devel + libpng-devel sqlite-devel libopenal-devel" +short_desc="Project based on Wolfenstein: Enemy Territory" +maintainer="biopsin " +license="GPL-3.0-or-later" +homepage="https://www.etlegacy.com" +changelog="https://github.com/etlegacy/etlegacy/wiki/Changelog.md" +distfiles="https://github.com/etlegacy/etlegacy/archive/refs/tags/v${version}.tar.gz" +checksum=730a8a52435884b922d8c280fcdeace648902399798c7a973da72fbc4163ebe2 +lib32disabled=yes + +post_install() { + vmkdir usr/share + vcopy ${DESTDIR}/usr/lib/${pkgname}/share usr/share/${pkgname} + rm -rf ${DESTDIR}/usr/lib/${pkgname}/share + + # Readme and vendor script to fetch original pkg assets + vdoc $FILESDIR/README.voidlinux + vcopy $FILESDIR/get-pak.sh usr/lib/${pkgname} +}