community/simde: new aport as new dependency of obs-studio

This commit is contained in:
Francesco Colista 2025-12-09 12:41:55 +00:00
parent 523d9dac57
commit 8bc6ebd3a6
3 changed files with 89 additions and 0 deletions

35
community/simde/APKBUILD Normal file
View File

@ -0,0 +1,35 @@
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=simde
pkgver=0.8.2
pkgrel=0
pkgdesc="Implementations of SIMD instruction sets"
url="https://github.com/simd-everywhere/simde"
arch="noarch"
license="MIT"
makedepends="meson"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/simd-everywhere/simde/archive/refs/tags/v$pkgver.tar.gz
musl-compatibility.patch
disable-tests.patch"
build() {
abuild-meson -Db_lto=true . output
meson compile -C output
}
check() {
meson test --print-errorlogs -C output
}
package() {
DESTDIR="$pkgdir" meson install --no-rebuild -C output
mkdir -p "$pkgdir"/usr/include/simde/
cp simde/musl-roundeven-compat.h "$pkgdir"/usr/include/simde/
}
sha512sums="
4e42d7140c0afae507773527c6c0c07e6f0cdad59a1d42ebcf4bd223fc9f71e91a2e3db7746aca3c0c5ad2a13333c2322ce1e384c7d699ddfe33bed6f107aec5 simde-0.8.2.tar.gz
d4560988a1f0bd5978ee1c88f2baa72fa1182c7a75609bc7d7a841d75d98f24db0c2d5b068aab60f264b9a661841346e975b0d436ab7c09a7b70f7fd8507d1aa musl-compatibility.patch
7eb661416f51a0a0ee2e4b26064cf6b81256a4f54c24d07f055358b82468ccd0d59a9a69e3a51ab3522e552c2b3d70a350e5696dc2a5d232f97c954d7ec5a33f disable-tests.patch
"

View File

@ -0,0 +1,12 @@
diff --git a/meson_options.txt b/meson_options.txt
index 091ddbe..380fffd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,6 +1,6 @@
option('tests',
type : 'boolean',
- value : true,
+ value : false,
description : 'Enable dependencies required for testing')
option('sleef',

View File

@ -0,0 +1,42 @@
commit 2c1fb491120a150743c7a1d4a5e08301361f0ec9
Author: Francesco Colista <fcolista@alpinelinux.org>
Date: Fri Nov 21 14:26:09 2025 +0000
Added musl compatibility layer
diff --git a/simde/musl-roundeven-compat.h b/simde/musl-roundeven-compat.h
new file mode 100644
index 0000000..d3b31f6
--- /dev/null
+++ b/simde/musl-roundeven-compat.h
@@ -0,0 +1,19 @@
+#if defined(__musl__)
+/* musl does not provide roundeven()/roundevenf(), and GCC may generate calls
+ to them during LTO even when SIMDe tries to avoid it.
+ Provide lightweight wrappers to ensure linking succeeds. */
+
+#include <math.h>
+
+static inline float simde_musl_roundevenf(float x) {
+ return nearbyintf(x); /* nearbyintf implements ties-to-even */
+}
+
+static inline double simde_musl_roundeven(double x) {
+ return nearbyint(x);
+}
+
+#define roundevenf simde_musl_roundevenf
+#define roundeven simde_musl_roundeven
+#endif
+
diff --git a/simde/simde-common.h b/simde/simde-common.h
index 5a755cc..2719642 100644
--- a/simde/simde-common.h
+++ b/simde/simde-common.h
@@ -1,3 +1,6 @@
+/* musl compatibility shim: ensure roundevenf()/roundeven() exist */
+#include "musl-roundeven-compat.h"
+
/* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person