aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaz <hyphens@pm.me>2022-04-17 12:56:44 +0200
committerdispatch <dispatch@listserv.local>2022-04-17 10:56:59 +0000
commit28a3a1c470f0ec7a9d5f7c415a897b64865f4042 (patch)
treec3851f05abc7d50b717212c817e2b93d419b15a8
parent0d36f4f3e4bf5a5ee512e0a9b56948726682fa34 (diff)
downloadaports-patches/4030.tar.gz
aports-patches/4030.tar.bz2
aports-patches/4030.tar.xz
community/massivethreads: new aportpatches/4030
https://github.com/massivethreads/massivethreads A lightweight threads library required by smlsharp
-rw-r--r--community/massivethreads/0001-musl-fixes.patch77
-rw-r--r--community/massivethreads/APKBUILD48
2 files changed, 125 insertions, 0 deletions
diff --git a/community/massivethreads/0001-musl-fixes.patch b/community/massivethreads/0001-musl-fixes.patch
new file mode 100644
index 0000000000..6053a8f104
--- /dev/null
+++ b/community/massivethreads/0001-musl-fixes.patch
@@ -0,0 +1,77 @@
+diff --git a/src/myth_io.h b/src/myth_io.h
+index e0b61551b8..832629c352 100644
+--- a/src/myth_io.h
++++ b/src/myth_io.h
+@@ -6,6 +6,7 @@
+ #define MYTH_IO_H_
+
+ #include <sys/socket.h>
++#include <sys/select.h>
+ #include <stdint.h>
+ #include <stdarg.h>
+
+
+
+diff --git a/src/Makefile.am b/patchMakefile.am
+index f55b46a5e5..f9a3e631ae 100644
+--- a/src/Makefile.am
++++ b/patchMakefile.am
+@@ -18,7 +18,8 @@ COMMON_SRCS = \
+ myth_context.c \
+ myth_if_native.c \
+ myth_real.c \
+- myth_eco.c
++ myth_eco.c \
++ pthread.c
+
+ # sources for wrapping system functions (used only for -dl and -ld versions)
+ WRAP_SRCS = \
+
+
+diff --git a/src/pthread.h b/src/pthread.h
+new file mode 100644
+index 0000000000..1a81566b46
+--- /dev/null
++++ b/src/pthread.h
+@@ -0,0 +1,15 @@
++#ifndef _MUSL_PTHREAD_H_OVERRIDE
++#define _MUSL_PTHREAD_H_OVERRIDE
++
++#include <errno.h>
++#include_next <pthread.h>
++
++// musl's pthread_equal is a macro
++#undef pthread_equal
++int pthread_equal(pthread_t t1, pthread_t t2);
++
++// musl doesn't define mutexattr functions
++int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict, int *__restrict);
++int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int);
++
++#endif//_MUSL_PTHREAD_H_OVERRIDE
+
+
+diff --git a/src/pthread.c b/src/pthread.c
+new file mode 100644
+index 0000000000..10f57c0fb7
+--- /dev/null
++++ b/src/pthread.c
+@@ -0,0 +1,18 @@
++#include <pthread.h>
++
++int pthread_equal(pthread_t t1, pthread_t t2) {
++ return t1 == t2;
++}
++
++int pthread_mutexattr_getprioceiling( const pthread_mutexattr_t *restrict attr
++ , int *restrict prioceiling )
++{
++ if (prioceiling) *prioceiling = 99;
++ return 0;
++}
++
++int pthread_mutexattr_setprioceiling( pthread_mutexattr_t *attr
++ , int prioceiling )
++{
++ return EPERM;
++}
diff --git a/community/massivethreads/APKBUILD b/community/massivethreads/APKBUILD
new file mode 100644
index 0000000000..46ed95e9e2
--- /dev/null
+++ b/community/massivethreads/APKBUILD
@@ -0,0 +1,48 @@
+# Contributor: Hazem <hazem-alpine@riseup.net>
+# Maintainer: Hazem <hazem-alpine@riseup.net>
+pkgname=massivethreads
+pkgver=1.00
+pkgrel=0
+pkgdesc="Lightweight Thread Library for High Productivity Languages"
+url="https://github.com/massivethreads/massivethreads"
+arch="x86_64"
+license="BSD-2-Clause"
+makedepends="autoconf automake"
+subpackages="$pkgname-dev"
+source="
+ https://github.com/massivethreads/massivethreads/archive/refs/tags/v$pkgver/massivethreads-$pkgver.tar.gz
+ 0001-musl-fixes.patch
+"
+
+build() {
+ aclocal # needed because we patch Makefile.ac
+ automake -a
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ --disable-myth-dl \
+ --disable-myth-ld
+ make
+}
+
+check() {
+ # pvalloc is not implemented in musl and not needed in massivethreads
+ # only referenced for wrapping in myth-dl/ld which we disable anyway
+ echo 'main(){}' > $builddir/tests/myth_pvalloc.c
+ make check
+}
+
+package() {
+ make DESTDIR="$pkgdir" install
+ rm -f $pkgdir/usr/bin/*
+ rm -f $pkgdir/usr/lib/libdr*
+}
+
+sha512sums="
+aaea978bf0d41a9a97ccf0d8c5be318feb1e547e72f7dea267ddc3a18d653831465d531c193f79e8f75d75b12945d3dab882d93596d90dda7f70676fe87ea72e massivethreads-1.00.tar.gz
+6e45f1053580460bf203c4e92e9889a3d7a46adfc4d38b4e75eaab8b73c3992fc928f6ff94960e7cb00bbc02fb61b6ab4646daf7051f69166780b62eb6ba5a5f 0001-musl-fixes.patch
+"