From ab0b8f482f1bf3e90892e7f0d15133b489b3a2ee Mon Sep 17 00:00:00 2001
From: Antoni Aloy Torrens <aaloytorrens@gmail.com>
Date: Sat, 26 Dec 2020 22:27:24 +0100
Subject: [PATCH] testing/freealut: new aport

---
 testing/freealut/0000-configure.patch         | 21 ++++++++++
 testing/freealut/0001-freebsd_pthread.patch   | 11 +++++
 .../freealut/0002-am_maintainer_mode.patch    | 10 +++++
 testing/freealut/0003-findutils_syntax.patch  | 11 +++++
 testing/freealut/APKBUILD                     | 41 +++++++++++++++++++
 5 files changed, 94 insertions(+)
 create mode 100644 testing/freealut/0000-configure.patch
 create mode 100644 testing/freealut/0001-freebsd_pthread.patch
 create mode 100644 testing/freealut/0002-am_maintainer_mode.patch
 create mode 100644 testing/freealut/0003-findutils_syntax.patch
 create mode 100644 testing/freealut/APKBUILD

diff --git a/testing/freealut/0000-configure.patch b/testing/freealut/0000-configure.patch
new file mode 100644
index 000000000000..3b26f5ba91bf
--- /dev/null
+++ b/testing/freealut/0000-configure.patch
@@ -0,0 +1,21 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -2,15 +2,15 @@
+ # Process this file with autoconf to produce a configure script.
+ ################################################################################
+ 
+-AC_INIT([freealut library], [1.1.0], [openal-devel@opensource.creative.com], [freealut])
++AC_INIT([freealut library],[1.1.0],[openal-devel@opensource.creative.com],[freealut])
+ AC_CONFIG_AUX_DIR([admin/autotools])
+ AM_INIT_AUTOMAKE
+-AC_PREREQ([2.56])
++AC_PREREQ(2.61)
+ AC_CONFIG_SRCDIR([AUTHORS])
+ AC_CONFIG_HEADERS([config.h])
+ 
+ # Compatibility hack for older autoconf versions
+-m4_ifdef([AS_HELP_STRING], [], [AC_DEFUN([AS_HELP_STRING], [AC_HELP_STRING($][@)])])
++m4_ifdef([AS_HELP_STRING], [], [AC_DEFUN([AS_HELP_STRING], [AS_HELP_STRING([$@])])])
+ 
+ ################################################################################
+ ## libtool shared library version.
diff --git a/testing/freealut/0001-freebsd_pthread.patch b/testing/freealut/0001-freebsd_pthread.patch
new file mode 100644
index 000000000000..83ef7036f66d
--- /dev/null
+++ b/testing/freealut/0001-freebsd_pthread.patch
@@ -0,0 +1,11 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -82,7 +82,7 @@
+ AC_DEFINE([ALUT_BUILD_LIBRARY], [1], [Define to 1 if you want to build the ALUT DLL.])
+ 
+ # Checks for libraries. (not perfect yet)
+-AC_SEARCH_LIBS([pthread_self], [pthread])
++AC_SEARCH_LIBS([pthread_create], [pthread])
+ AC_SEARCH_LIBS([alGetError], [openal32 openal])
+ 
+ ################################################################################
diff --git a/testing/freealut/0002-am_maintainer_mode.patch b/testing/freealut/0002-am_maintainer_mode.patch
new file mode 100644
index 000000000000..f2be3d131c01
--- /dev/null
+++ b/testing/freealut/0002-am_maintainer_mode.patch
@@ -0,0 +1,10 @@
+--- a/configure.ac	2007-02-20 12:55:58.000000000 +0100
++++ b/configure.ac	2007-02-20 12:56:08.000000000 +0100
+@@ -5,6 +5,7 @@
+ AC_INIT([freealut library],[1.1.0],[openal-devel@opensource.creative.com],[freealut])
+ AC_CONFIG_AUX_DIR([admin/autotools])
+ AM_INIT_AUTOMAKE
++AM_MAINTAINER_MODE
+ AC_PREREQ(2.61)
+ AC_CONFIG_SRCDIR([AUTHORS])
+ AC_CONFIG_HEADERS([config.h])
diff --git a/testing/freealut/0003-findutils_syntax.patch b/testing/freealut/0003-findutils_syntax.patch
new file mode 100644
index 000000000000..891fec4493da
--- /dev/null
+++ b/testing/freealut/0003-findutils_syntax.patch
@@ -0,0 +1,11 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -33,7 +33,7 @@ libtool: $(LIBTOOL_DEPS)
+ 
+ # The Creative repository has some broken permissions, let's fix this.
+ permissions:
+-	find . -type f \! -perm +222 \! -name "*.sh" -exec chmod +w {} \;
++	find . -type f \! -perm /222 \! -name "*.sh" -exec chmod +w {} \;
+ 
+ # Automatically reformat all C headers and sources with indent according to
+ # admin/autotools/.indent.pro, but be make-friendly and take some precautions to
diff --git a/testing/freealut/APKBUILD b/testing/freealut/APKBUILD
new file mode 100644
index 000000000000..867f41d4cf83
--- /dev/null
+++ b/testing/freealut/APKBUILD
@@ -0,0 +1,41 @@
+# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
+pkgname=freealut
+pkgver=1.1.0
+pkgrel=0
+pkgdesc="OpenAL Utility Toolkit (ALUT)"
+url="https://github.com/vancegroup/freealut.git"
+arch="all"
+license="GPL-2.0-or-later"
+makedepends="autoconf automake libtool openal-soft-dev"
+subpackages="$pkgname-dev"
+options="!check" # No testsuite
+source="https://github.com/vancegroup/freealut/archive/freealut_${pkgver//./_}.tar.gz
+	0000-configure.patch
+	0001-freebsd_pthread.patch
+	0002-am_maintainer_mode.patch
+	0003-findutils_syntax.patch
+	"
+builddir="$srcdir/$pkgname-${pkgname}_${pkgver//./_}"
+
+prepare() {
+	default_prepare
+	./autogen.sh
+}
+
+build() {
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr
+	make
+}
+
+package() {
+	make DESTDIR="$pkgdir" install
+}
+
+sha512sums="c9dead230434b3916f91e219913c2b2c877c4594d74b63641246a6704e28fe8d415131127cc00b51355f2fdf4e2bbf8aaf2b802fec479b05927e39a8698c251e  freealut_1_1_0.tar.gz
+6a291791660e45bea0000cb6adec5e8ddbdf405da95ab45ef05eda191ea412b57752d9e12afd34741d455bdd3aaa0faaf2c3be8467550e1216677c9b1a82ff66  0000-configure.patch
+ed21300ea329daed93db27bbd14385cbc97057dc810a88508c5dda7e5e383350df4caeed66908be3868d66d64536c3b1d13ef2dc15e4efcda04285544c54a8be  0001-freebsd_pthread.patch
+38b7ed8d66ffe4b3cd38641c821f7b0a055d62d104d04e3f62c4baf0fe5aad27107427365b082222d2be9dbc2d9416de31408c41a35126e8398b56c188bacffc  0002-am_maintainer_mode.patch
+7fe5bba0e23d10319552afd77dfde41633411f1c3d9ad66559f65230c758440a2987b7472fb4a3323a811575a14736f1ab476aa47dff993e6d81a1196274f230  0003-findutils_syntax.patch"
-- 
GitLab