Subject: [PATCH 1/2] testing/0ad-data: new aport

From: VÖRÖSKŐI András <[email-masked]>
Date: Tue, 24 Dec 2019 19:04:58 +0100

---
 testing/0ad-data/APKBUILD | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 testing/0ad-data/APKBUILD

diff --git a/testing/0ad-data/APKBUILD b/testing/0ad-data/APKBUILD
new file mode 100644
index 0000000000..4e2a724fc1
--- /dev/null
+++ b/testing/0ad-data/APKBUILD
@@ -0,0 +1,20 @@
+# Contributor: VÖRÖSKŐI András <[email-masked]>
+# Maintainer:
+pkgname="0ad-data"
+pkgver="0.0.23b"
+pkgrel=0
+pkgdesc="0ad data files"
+url="https://play0ad.com/"
+arch="noarch"
+license="CC-BY-SA-3.0"
+options="!check" # just data files
+source="http://releases.wildfiregames.com/0ad-$pkgver-alpha-unix-data.tar.xz"
+
+package() {
+	install -d $pkgdir/usr/share/0ad/
+	cd $startdir/src
+	mv 0ad-$pkgver-alpha $pkgname-$pkgver
+	mv $builddir/binaries/data $pkgdir/usr/share/0ad/
+}
+
+sha512sums="d0515e44f575737a06f27c75c0a58a5229ead474ae6d48531142015548e5986145f895f95e0fa9209cf9085c7c431f4179ff2e70c1a532f61d1cb62c0a91bcfc  0ad-0.0.23b-alpha-unix-data.tar.xz"
-- 
2.24.1

---

From: VÖRÖSKŐI András <[email-masked]>
Date: Tue, 24 Dec 2019 19:04:59 +0100

https://play0ad.com/
A free, open-source game of ancient warfare.
---
 testing/0ad/APKBUILD                 | 54 ++++++++++++++++++++++++++++
 testing/0ad/musl-compile-fixes.patch | 25 +++++++++++++
 2 files changed, 79 insertions(+)
 create mode 100644 testing/0ad/APKBUILD
 create mode 100644 testing/0ad/musl-compile-fixes.patch

diff --git a/testing/0ad/APKBUILD b/testing/0ad/APKBUILD
new file mode 100644
index 0000000000..02b4a9b161
--- /dev/null
+++ b/testing/0ad/APKBUILD
@@ -0,0 +1,54 @@
+# Contributor: VÖRÖSKŐI András <[email-masked]>
+# Maintainer:
+pkgname="0ad"
+pkgver="0.0.23b"
+pkgrel=0
+pkgdesc="A free, open-source game of ancient warfare."
+url="https://play0ad.com/"
+arch="all"
+license="GPL-2.0-or-later"
+# nspr-dev, python2: spidermonkey build
+# cmake: nvtt build
+# wxgtk-dev: atlas
+makedepends="libxml2-dev nspr-dev python2 cmake sdl2-dev>=2.0.2 boost-dev enet>=1.3 miniupnpc-dev>=1.6 libsodium-dev>=1.0.14 \
+curl-dev>=7.32 openal-soft-dev libvorbis-dev libexecinfo-dev gloox bash perl icu-dev mesa-dev libxcursor-dev libpng-dev"
+rodepends="0ad-data"
+langdir="usr/share/0ad/data/l10n"
+subpackages="$pkgname-lang"
+options="!check" # does not work
+source="http://releases.wildfiregames.com/0ad-$pkgver-alpha-unix-build.tar.xz musl-compile-fixes.patch"
+
+prepare() {
+	cd $startdir/src
+	mv $pkgname-$pkgver-alpha $pkgname-$pkgver
+	default_prepare
+}
+
+build() {
+	cd $builddir/build/workspaces
+	./update-workspaces.sh -j9 --disable-atlas \
+		--bindir=/usr/bin \
+		--libdir=/usr/lib/0ad \
+		--datadir=/usr/share/0ad/data
+	cd gcc
+	# link with libexecinfo
+	sed -i "s/LIBS\(.*\)/LIBS\1 -lexecinfo/" pyrogenesis.make test.make
+	make
+}
+
+package() {
+	install -d "${pkgdir}"/usr/bin
+	install -d $pkgdir/usr/lib/0ad
+	install -d $pkgdir/usr/share/0ad/data/l10n
+	
+	cd "$builddir"
+	install -Dm755 binaries/system/pyrogenesis "${pkgdir}/usr/bin"
+	install -Dm755 binaries/system/*.so "${pkgdir}/usr/lib/0ad"
+	install -Dm755 build/resources/0ad.sh "${pkgdir}/usr/bin/$pkgname"
+	install -Dm644 build/resources/0ad.desktop "${pkgdir}/usr/share/applications/$pkgname.desktop"
+	install -Dm644 build/resources/0ad.png "${pkgdir}/usr/share/pixmaps/$pkgname.png"
+	install -Dm644 binaries/data/l10n/*.po "$pkgdir/usr/share/0ad/data/l10n/"
+}
+
+sha512sums="82934313c46c4fd89e3841d5bbf901904abbd2108e9749529d7282bd24ac53b9e6878681c06e6019f4d8ec0e425c28300b0aafc9610a66a331777ffb58ed6135  0ad-0.0.23b-alpha-unix-build.tar.xz
+da4571ca7878302289943669856e93fd7eb8daad1b8148de8f8f7ca3cf50478599c76741e5a4cc89e33860e10072a6ec68a1a1c941e3c28eeaddc9cdddf0adbc  musl-compile-fixes.patch"
diff --git a/testing/0ad/musl-compile-fixes.patch b/testing/0ad/musl-compile-fixes.patch
new file mode 100644
index 0000000000..e3867b2eb2
--- /dev/null
+++ b/testing/0ad/musl-compile-fixes.patch
@@ -0,0 +1,25 @@
+--- 0ad-0.0.23b-alpha.orig/libraries/source/nvtt/src/src/nvmath/nvmath.h
++++ 0ad-0.0.23b-alpha/libraries/source/nvtt/src/src/nvmath/nvmath.h
+@@ -130,10 +130,8 @@
+ {
+ #if NV_OS_WIN32
+ 	return _isnan(f) != 0;
+-#elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD
++#elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD || NV_OS_LINUX
+ 	return isnan(f);
+-#elif NV_OS_LINUX
+-	return isnanf(f);
+ #else
+ #	error "isNan not supported"
+ #endif
+--- 0ad-0.0.23b-alpha.orig/source/third_party/cppformat/format.cpp
++++ 0ad-0.0.23b-alpha/source/third_party/cppformat/format.cpp
+@@ -432,7 +432,7 @@
+     int error_code, char *&buffer, std::size_t buffer_size) FMT_NOEXCEPT(true) {
+   assert(buffer != 0 && buffer_size != 0);
+   int result = 0;
+-#if defined(_GNU_SOURCE) && !defined(__BIONIC__)
++#if defined(_GNU_SOURCE) && defined(__GLIBC__)
+   char *message = strerror_r(error_code, buffer, buffer_size);
+   // If the buffer is full then the message is probably truncated.
+   if (message == buffer && strlen(buffer) == buffer_size - 1)
-- 
2.24.1