Skip to content

Commit

Permalink
updpatch: 0ad a26-16
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryolitia committed Sep 7, 2024
1 parent bf14f89 commit d35ef3a
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 12 deletions.
102 changes: 102 additions & 0 deletions 0ad/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: t3ddy <t3ddy1988 "at" gmail {dot} com>
# Contributor: Adrián Chaves Fernández (Gallaecio) <adriyetichaves@gmail.com>
pkgname=0ad
pkgver=a26
_pkgver=0.0.26-alpha
pkgrel=16
pkgdesc="Cross-platform, 3D and historically-based real-time strategy game"
arch=('x86_64')
url="http://play0ad.com/"
license=('GPL-2.0-or-later' 'CCPL')
depends=('0ad-data' 'binutils' 'boost-libs' 'curl' 'enet' 'libogg' 'libpng' 'libvorbis'
'libxml2' 'openal' 'sdl2' 'wxwidgets-gtk3' 'zlib' 'libgl' 'glu' 'fmt'
'gloox' 'miniupnpc' 'libminiupnpc.so' 'icu' 'nspr' 'libsodium' 'which')
makedepends=('boost' 'cmake' 'mesa' 'zip' 'libsm' 'rust' 'git')
options=('!lto') # breaks spidermonkey linking (https://bugs.gentoo.org/746947)
source=("https://releases.wildfiregames.com/$pkgname-$_pkgver-unix-build.tar.xz"
https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tar.xz{,.asc}
mozjs_virtualenv.patch
fix_python_3.11_ftbfs.patch
https://github.com/0ad/0ad/commit/839edc3a.patch
https://github.com/0ad/0ad/commit/093e1eb2.patch
https://github.com/0ad/0ad/commit/d2426312.patch
fix_gcc_14_ftbfs.patch
miniupnpc-2.2.8.patch
af348d84.patch
https://github.com/0ad/0ad/commit/d2426312.patch
add-riscv64-support.patch
"$pkgname-fix-riscv64-build.patch::https://code.wildfiregames.com/D5127?download=true")
validpgpkeys=('A035C8C19219BA821ECEA86B64E628F8D684696D') # Pablo Galindo Salgado <pablogsal@gmail.com>
sha512sums=('aaf647d5d8454c244015d2a198beeaaebc571a5bc96446f3acff8dbd05f9843029c500bf4162651a5e1fcdb42bd5fb5b4f5c512c78372479fbd8565dd093f272'
'2b0a1d936b4ef8376f9655797aece8ffdff75031ad7bfa840f330cac2aed189aecc80c163edc12ea772851d7a011f3fc1960470a73d9d4290cf3ab8ad6ed7e6a'
'SKIP'
'3a0f935ab05e1c0d6a926ba02a5ed72afbb94b6910acaad77661b927680f192a06c7614287fad2ff8a54e3e1ee814614c9abfc9497a27e86b9e58ae1f6eebbfb'
'748a75420541947e2a215b3a8789a0e137179e4981d0977e1c4b20cd7b86af2d96b9976e04d60ace8d5ee465d542cadc42ee9bceedaaa97d2b320f533e3e3892'
'1dfc8a0c6ac29040f72d9bbf6b631a74cbdec444b9078a015345139228666354d9b5059f85b640ce3afc0f590bcbe8afd5e158509a0c95751e1cd69fece46876'
'a7fd1454385f56b7c8cb0fc6ac001761d4419df4aeec570ba846c7df4eb327d25b9ff1a7946cb334315109fa90ca2c1820583619f4e1ec5d53805afa08e10093'
'5f32d47f01d845e07b2f919c9b04ac5e50dc9977fa97f981eba4a53677a29d797d0d76bc385ac047dd7c7d24af7d95cd8256d433bd43ce1a6606763c0ea736cb'
'b991b27168b0bfb13fe27aea1dd1f2759b6f243dba62a169612ebc28d601a84d06d3f3a44f3af6dd79ccf8b71f9eacd3fcdb9cb5de9fce7684614afb4ad91851'
'cb858c31d7748e99b3332f28dddb00ac264b7352f59a4e9eddca21b92d1cf4c5a8b47d2be29aa4c1960a73fe47ef9772a2e7abae45fe297ef55c2eee1cc498ed'
'42351c34b6a871c9efd463db18b8dd3ea4e143657d9bafd3cce604e724556b63a7d7b670c8c512f7509fb474778108b4a51635a1e4965a7532f7af35773983ac'
'5f32d47f01d845e07b2f919c9b04ac5e50dc9977fa97f981eba4a53677a29d797d0d76bc385ac047dd7c7d24af7d95cd8256d433bd43ce1a6606763c0ea736cb'
'3b8456690dd1674e216734c7b61abd1f5e60576d7b0108a8557f48a67fb2f844a0d73dc468240afe1a9b7e74dcb5bd247cd3675fd392cb4e19d48e837327757a'
'9dba3d00ceb61bd0b08fc3dea4d975e14428b93383fb24c4de69e594d3a9c5ed95f37aade3681aac42a80af53c0c1286e54fb7e2d7f3ff8a4dbe27ad7718074f')

prepare() {
cd "$pkgname-$_pkgver"

patch -Np1 -i "$srcdir"/add-riscv64-support.patch
patch -Np0 -i "$srcdir"/$pkgname-fix-riscv64-build.patch

# Thanks Debian!
patch -Np1 -i "$srcdir"/fix_python_3.11_ftbfs.patch
cp "$srcdir"/mozjs_virtualenv.patch libraries/source/spidermonkey
patch -p1 -i ../839edc3a.patch # Fix build with fmt 10
patch -p1 -i ../093e1eb2.patch # Fix build with GCC 13
patch -p1 -i ../d2426312.patch # Fix build with libxml2 2.12
patch -p1 -i ../fix_gcc_14_ftbfs.patch # Fix build with GCC 14
patch -p1 -i ../miniupnpc-2.2.8.patch # Fix build with miniupnpc 2.2.8
patch -p1 -i ../af348d84.patch # Fix build with boost 1.85
}

build() {
# Build Python 3.11 to build bundled spidermonkey
# https://trac.wildfiregames.com/ticket/6895
# https://gitlab.archlinux.org/archlinux/packaging/packages/0ad/-/issues/1
cd Python-3.11.9
./configure
make
make DESTDIR="$srcdir/pythoninstall" install
cd ..
PATH="$PWD/pythoninstall/usr/local/bin:$PATH"

cd "$pkgname-$_pkgver/build/workspaces"

# this uses malloc_usable_size, which is incompatible with fortification level 3
export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"

./update-workspaces.sh -j$(nproc) \
--without-pch \
--bindir=/usr/bin \
--libdir=/usr/lib/0ad \
--datadir=/usr/share/0ad/data

cd gcc

VERBOSE=1 make
}

package() {
cd "$pkgname-$_pkgver"
install -d "${pkgdir}"/usr/{bin,lib/0ad,share/"${pkgname}"/data}
install -Dm755 binaries/system/pyrogenesis "${pkgdir}/usr/bin"
install -Dm755 binaries/system/*.so "${pkgdir}/usr/lib/0ad"

cp -r binaries/data/l10n/ "${pkgdir}/usr/share/${pkgname}/data/"

install -Dm755 build/resources/${pkgname}.sh "${pkgdir}/usr/bin/${pkgname}"
install -Dm644 build/resources/${pkgname}.desktop "${pkgdir}/usr/share/applications/${pkgname}.desktop"
install -Dm644 build/resources/${pkgname}.png "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
}
32 changes: 20 additions & 12 deletions 0ad/riscv64.patch
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
--- PKGBUILD
+++ PKGBUILD
@@ -22,7 +22,10 @@ source=("https://releases.wildfiregames.com/$pkgname-$_pkgver-unix-build.tar.xz"
https://github.com/0ad/0ad/commit/093e1eb2.patch
@@ -6,7 +6,7 @@ pkgver=a26
_pkgver=0.0.26-alpha
pkgrel=16
pkgdesc="Cross-platform, 3D and historically-based real-time strategy game"
-arch=('x86_64')
+arch=('x86_64' 'riscv64')
url="http://play0ad.com/"
license=('GPL-2.0-or-later' 'CCPL')
depends=('0ad-data' 'binutils' 'boost-libs' 'curl' 'enet' 'libogg' 'libpng' 'libvorbis'
@@ -23,7 +23,10 @@ source=("https://releases.wildfiregames.com/$pkgname-$_pkgver-unix-build.tar.xz"
https://github.com/0ad/0ad/commit/d2426312.patch
fix_gcc_14_ftbfs.patch
- miniupnpc-2.2.8.patch)
+ miniupnpc-2.2.8.patch
miniupnpc-2.2.8.patch
- af348d84.patch)
+ af348d84.patch
+ https://github.com/0ad/0ad/commit/d2426312.patch
+ add-riscv64-support.patch
+ "$pkgname-fix-riscv64-build.patch::https://code.wildfiregames.com/D5127?download=true")
validpgpkeys=('A035C8C19219BA821ECEA86B64E628F8D684696D') # Pablo Galindo Salgado <pablogsal@gmail.com>
sha512sums=('aaf647d5d8454c244015d2a198beeaaebc571a5bc96446f3acff8dbd05f9843029c500bf4162651a5e1fcdb42bd5fb5b4f5c512c78372479fbd8565dd093f272'
'2b0a1d936b4ef8376f9655797aece8ffdff75031ad7bfa840f330cac2aed189aecc80c163edc12ea772851d7a011f3fc1960470a73d9d4290cf3ab8ad6ed7e6a'
@@ -33,13 +36,18 @@ sha512sums=('aaf647d5d8454c244015d2a198beeaaebc571a5bc96446f3acff8dbd05f9843029c
'a7fd1454385f56b7c8cb0fc6ac001761d4419df4aeec570ba846c7df4eb327d25b9ff1a7946cb334315109fa90ca2c1820583619f4e1ec5d53805afa08e10093'
@@ -35,11 +38,17 @@ sha512sums=('aaf647d5d8454c244015d2a198beeaaebc571a5bc96446f3acff8dbd05f9843029c
'5f32d47f01d845e07b2f919c9b04ac5e50dc9977fa97f981eba4a53677a29d797d0d76bc385ac047dd7c7d24af7d95cd8256d433bd43ce1a6606763c0ea736cb'
'b991b27168b0bfb13fe27aea1dd1f2759b6f243dba62a169612ebc28d601a84d06d3f3a44f3af6dd79ccf8b71f9eacd3fcdb9cb5de9fce7684614afb4ad91851'
- 'cb858c31d7748e99b3332f28dddb00ac264b7352f59a4e9eddca21b92d1cf4c5a8b47d2be29aa4c1960a73fe47ef9772a2e7abae45fe297ef55c2eee1cc498ed')
+ 'cb858c31d7748e99b3332f28dddb00ac264b7352f59a4e9eddca21b92d1cf4c5a8b47d2be29aa4c1960a73fe47ef9772a2e7abae45fe297ef55c2eee1cc498ed'
'cb858c31d7748e99b3332f28dddb00ac264b7352f59a4e9eddca21b92d1cf4c5a8b47d2be29aa4c1960a73fe47ef9772a2e7abae45fe297ef55c2eee1cc498ed'
- '42351c34b6a871c9efd463db18b8dd3ea4e143657d9bafd3cce604e724556b63a7d7b670c8c512f7509fb474778108b4a51635a1e4965a7532f7af35773983ac')
+ '42351c34b6a871c9efd463db18b8dd3ea4e143657d9bafd3cce604e724556b63a7d7b670c8c512f7509fb474778108b4a51635a1e4965a7532f7af35773983ac'
+ '5f32d47f01d845e07b2f919c9b04ac5e50dc9977fa97f981eba4a53677a29d797d0d76bc385ac047dd7c7d24af7d95cd8256d433bd43ce1a6606763c0ea736cb'
+ '3b8456690dd1674e216734c7b61abd1f5e60576d7b0108a8557f48a67fb2f844a0d73dc468240afe1a9b7e74dcb5bd247cd3675fd392cb4e19d48e837327757a'
+ '9dba3d00ceb61bd0b08fc3dea4d975e14428b93383fb24c4de69e594d3a9c5ed95f37aade3681aac42a80af53c0c1286e54fb7e2d7f3ff8a4dbe27ad7718074f')

prepare() {
cd "$pkgname-$_pkgver"

# Thanks Debian!
patch -Np1 -i "$srcdir"/fix_python_3.11_ftbfs.patch
+ patch -Np1 -i "$srcdir"/add-riscv64-support.patch
+ patch -Np0 -i "$srcdir"/$pkgname-fix-riscv64-build.patch
+
# Thanks Debian!
patch -Np1 -i "$srcdir"/fix_python_3.11_ftbfs.patch
cp "$srcdir"/mozjs_virtualenv.patch libraries/source/spidermonkey
patch -p1 -i ../839edc3a.patch # Fix build with fmt 10
patch -p1 -i ../093e1eb2.patch # Fix build with GCC 13

0 comments on commit d35ef3a

Please sign in to comment.