aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian <sebastian@sebsite.pw>2022-02-12 23:49:03 -0500
committerdispatch <dispatch@listserv.local>2022-02-13 04:50:47 +0000
commit269e1e1dc5ecf4f31d1943f222a23838e65ed503 (patch)
tree84ccd7c623c6b2ee0401b5b5ef4ac63361ef9d58
parent0ef31ff69972043b3cf676253c76ce0117707293 (diff)
downloadaports-patches/3937.tar.gz
aports-patches/3937.tar.bz2
aports-patches/3937.tar.xz
testing/cosmopolitan: new aportpatches/3937
https://justine.lol/cosmopolitan/ Build-once run-anywhere C library Signed-off-by: Sebastian <sebastian@sebsite.pw>
-rw-r--r--testing/cosmopolitan/APKBUILD45
-rw-r--r--testing/cosmopolitan/no-clang-test.patch12
2 files changed, 57 insertions, 0 deletions
diff --git a/testing/cosmopolitan/APKBUILD b/testing/cosmopolitan/APKBUILD
new file mode 100644
index 0000000000..ed4af623a0
--- /dev/null
+++ b/testing/cosmopolitan/APKBUILD
@@ -0,0 +1,45 @@
+# Contributor: Sebastian Hudak <sebastian@sebsite.pw>
+# Maintainer: Sebastian Hudak <sebastian@sebsite.pw>
+pkgname=cosmopolitan
+pkgver=1.0
+pkgrel=0
+pkgdesc="Build-once run-anywhere C library"
+url="https://justine.lol/cosmopolitan/"
+arch="x86_64"
+license="ISC"
+subpackages="$pkgname-doc"
+source="https://justine.lol/cosmopolitan/cosmopolitan-$pkgver.tar.gz
+ no-clang-test.patch"
+builddir="$srcdir/cosmopolitan"
+_mode=rel
+
+build() {
+ # Build doesn't work with custom *FLAGS.
+ # This is due to the nature of Cosmpolitan and APE binaries and
+ # probably can't be worked around.
+ make CFLAGS= CXXFLAGS= CPPFLAGS= LDFLAGS= MODE="$_mode" \
+ o/cosmopolitan.h \
+ o/cosmopolitan.html \
+ o/"$_mode"/ape \
+ o/"$_mode"/cosmopolitan.a \
+ o/"$_mode"/libc
+}
+
+check() {
+ make CFLAGS= CXXFLAGS= CPPFLAGS= LDFLAGS= MODE="$_mode" \
+ o/"$_mode"/test/libc
+}
+
+package() {
+ install -Dm644 o/cosmopolitan.h "$pkgdir"/usr/include/cosmopolitan.h
+ install -Dm644 o/cosmopolitan.html \
+ "$pkgdir"/usr/share/doc/cosmopolitan.html
+ install -Dm644 o/"$_mode"/ape/* -t "$pkgdir"/usr/lib/
+ install -m644 o/"$_mode"/cosmopolitan.a "$pkgdir"/usr/lib/cosmopolitan.a
+ install -m644 o/"$_mode"/libc/crt/crt.o "$pkgdir"/usr/lib/crt.o
+}
+
+sha512sums="
+1fb01ad95d5d0908e608febd191545ca2ed06d37ff64715c3241528be2f36f656b68103178c925a8d0a985a9fd40f8f62e034a05ed719d682c5b1c336ff25c8d cosmopolitan-1.0.tar.gz
+b6d892a8ecc0a50a8cae49a0ba4ef9940316ee4ff9c36f247bda521c2ffb853062c56716bd8226144348760b581bc2cf5c65a06775162c362b4e966ac413409a no-clang-test.patch
+"
diff --git a/testing/cosmopolitan/no-clang-test.patch b/testing/cosmopolitan/no-clang-test.patch
new file mode 100644
index 0000000000..1f6623bb9d
--- /dev/null
+++ b/testing/cosmopolitan/no-clang-test.patch
@@ -0,0 +1,12 @@
+Clang test segfaults.
+See https://groups.google.com/g/cosmopolitan-libc/c/COPYVF7sE-Y
+
+--- cosmopolitan/test/libc/release/test.mk 2021-05-17 03:35:10.000000000 +0000
++++ cosmopolitan-alpine/test/libc/release/test.mk 2022-01-07 02:47:16.666693677 +0000
+@@ -147,6 +137,5 @@
+ o/$(MODE)/test/libc/release/smokecxx.com.runs \
+ o/$(MODE)/test/libc/release/smokeansi.com \
+ o/$(MODE)/test/libc/release/smokeansi.com.runs \
+- o/$(MODE)/test/libc/release/clang.ok \
+ o/$(MODE)/test/libc/release/emulate.ok \
+ o/$(MODE)/test/libc/release/metal.ok