aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2021-02-28 19:37:09 +0100
committerSören Tempel <soeren+alpine@soeren-tempel.net>2021-04-09 18:28:26 +0000
commit779a93d44c0ded4891e2096e5ef5300416abfb21 (patch)
tree9731c0845d712bb83a5ad57b913a75ce9faef1f6
parent4baf7f3101fd513cd4e54f03cf1874684727a578 (diff)
downloadaports-779a93d44c0ded4891e2096e5ef5300416abfb21.tar.gz
aports-779a93d44c0ded4891e2096e5ef5300416abfb21.tar.bz2
aports-779a93d44c0ded4891e2096e5ef5300416abfb21.tar.xz
testing/idris2: new aport
-rw-r--r--testing/idris2/0001-Flush-standard-out-after-writing-prompt-to-it.patch31
-rw-r--r--testing/idris2/0002-Better-default-permissions-for-created-directories.patch33
-rw-r--r--testing/idris2/0003-Makefile-Don-t-run-bootstrap-test-on-bootstrap-by-de.patch25
-rw-r--r--testing/idris2/APKBUILD55
4 files changed, 144 insertions, 0 deletions
diff --git a/testing/idris2/0001-Flush-standard-out-after-writing-prompt-to-it.patch b/testing/idris2/0001-Flush-standard-out-after-writing-prompt-to-it.patch
new file mode 100644
index 0000000000..1c53789e82
--- /dev/null
+++ b/testing/idris2/0001-Flush-standard-out-after-writing-prompt-to-it.patch
@@ -0,0 +1,31 @@
+From bd1d67f89bbbf28d8d8d56214b05568195be27b3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
+Date: Sun, 28 Feb 2021 10:00:20 +0100
+Subject: [PATCH] Flush standard out after writing prompt to it
+
+On Unix-like operating systems stdio.h is usually line-buffered. As
+putStr uses fputs(3) from stdio.h internally, output will be written to
+standard out after a newline character is written to the buffer. Since
+the prompt does not contain a newline, it will only be written to
+standard output after the user presses return. I encountered this issue
+on Alpine Linux which uses musl libc (instead of glibc). However, I
+believe this issue is likely also reproducible with glibc. This commit
+fixes this issue by flushing standard output after writing the prompt to
+it. Surprisingly, `src/Idris/IDEMode/REPL.idr` already does this
+correctly, `src/Idris/REPL.idr` does not though.
+---
+ src/Idris/REPL.idr | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/Idris/REPL.idr b/src/Idris/REPL.idr
+index d1aede40..53f3eca6 100644
+--- a/src/Idris/REPL.idr
++++ b/src/Idris/REPL.idr
+@@ -897,6 +897,7 @@ mutual
+ = do ns <- getNS
+ opts <- get ROpts
+ coreLift (putStr (prompt (evalMode opts) ++ show ns ++ "> "))
++ coreLift (fflush stdout)
+ inp <- coreLift getLine
+ end <- coreLift $ fEOF stdin
+ if end
diff --git a/testing/idris2/0002-Better-default-permissions-for-created-directories.patch b/testing/idris2/0002-Better-default-permissions-for-created-directories.patch
new file mode 100644
index 0000000000..af4c5f6a04
--- /dev/null
+++ b/testing/idris2/0002-Better-default-permissions-for-created-directories.patch
@@ -0,0 +1,33 @@
+From 2c7f7bc4fb871e32e0e44b3b625464598130fc5c Mon Sep 17 00:00:00 2001
+From: Johann Rudloff <johann@sinyax.net>
+Date: Sun, 10 Jan 2021 12:54:15 +0100
+Subject: [PATCH] Better default permissions for created directories
+
+Change the support code for directory creation so that it sets all
+permission bits (ugo=rwx). The process's currently active umask will be
+subtracted from these permissions, which leads to the result that (for a
+standard umask of "022") directories are created with a mode of "0755".
+
+So by default, directories created with `prim__createDir` are now also
+group-executable and other-executable by default.
+
+Previous behaviour was to create the directories readable for group and
+other, but not executable (mode "744"), and thus inaccessible to anyone
+except the owner.
+---
+ support/c/idris_directory.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/support/c/idris_directory.c b/support/c/idris_directory.c
+index 2f7d735a..0c9dbfe2 100644
+--- a/support/c/idris_directory.c
++++ b/support/c/idris_directory.c
+@@ -19,7 +19,7 @@ int idris2_createDir(char* dir) {
+ #ifdef _WIN32
+ return mkdir(dir);
+ #else
+- return mkdir(dir, S_IRWXU | S_IRGRP | S_IROTH);
++ return mkdir(dir, S_IRWXU | S_IRWXG | S_IRWXO);
+ #endif
+ }
+
diff --git a/testing/idris2/0003-Makefile-Don-t-run-bootstrap-test-on-bootstrap-by-de.patch b/testing/idris2/0003-Makefile-Don-t-run-bootstrap-test-on-bootstrap-by-de.patch
new file mode 100644
index 0000000000..78d67be037
--- /dev/null
+++ b/testing/idris2/0003-Makefile-Don-t-run-bootstrap-test-on-bootstrap-by-de.patch
@@ -0,0 +1,25 @@
+From 723a0425a399ca5afc04331886a15a5257f69b2f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
+Date: Sun, 28 Feb 2021 04:31:02 +0100
+Subject: [PATCH] Makefile: Don't run bootstrap-test on bootstrap by default
+
+By default tests are run automatically after bootstrap. Normally, Alpine
+tests are invoked separately in a check stage. To allow doing that this
+patch disable the automatic test invocations during bootstraping.
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 212c3bd3..d3c008a0 100644
+--- a/Makefile
++++ b/Makefile
+@@ -143,7 +143,7 @@ install-libs:
+ .PHONY: bootstrap bootstrap-build bootstrap-racket bootstrap-racket-build bootstrap-test bootstrap-clean
+
+ # Bootstrapping using SCHEME
+-bootstrap: bootstrap-build bootstrap-test
++bootstrap: bootstrap-build
+
+ bootstrap-build: support
+ cp support/c/${IDRIS2_SUPPORT} bootstrap/idris2_app
diff --git a/testing/idris2/APKBUILD b/testing/idris2/APKBUILD
new file mode 100644
index 0000000000..668ac6b535
--- /dev/null
+++ b/testing/idris2/APKBUILD
@@ -0,0 +1,55 @@
+# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
+# Maintainer:
+pkgname=idris2
+pkgver=0.3.0
+pkgrel=0
+pkgdesc="Purely functional programming language with first class types"
+url="https://www.idris-lang.org"
+arch="x86 x86_64" # limited by chez-scheme
+license="BSD-3-Clause"
+depends="chez-scheme"
+makedepends="bash py3-sphinx py3-sphinx_rtd_theme"
+subpackages="$pkgname-doc"
+options="!check" # TODO
+source="https://github.com/idris-lang/Idris2/archive/v$pkgver/idris2-$pkgver.tar.gz
+ 0001-Flush-standard-out-after-writing-prompt-to-it.patch
+ 0002-Better-default-permissions-for-created-directories.patch
+ 0003-Makefile-Don-t-run-bootstrap-test-on-bootstrap-by-de.patch"
+builddir="$srcdir/Idris2-$pkgver"
+
+# TODO: Install idris libs to /usr/lib/idris-$pkgver instead of /usr/idris-$pkgver
+# TODO: Make all tests pass
+# TODO: Self-hosting step (maybe split into idris2 and idris2-bootstrap?)
+# TODO: Install the Idris 2 API (make install-api)
+
+# TODO: https://github.com/idris-lang/Idris2/issues/737
+# TODO: https://github.com/idris-lang/Idris2/pull/1123
+
+build() {
+ # Bootstrap Idris 2 compiler from scheme sources.
+ make -j1 bootstrap PREFIX=/usr SCHEME=chez
+
+ # Create HTML documentation.
+ make -C docs html
+}
+
+check() {
+ make -j1 bootstrap-test
+}
+
+package() {
+ # Idris2 Makefile doesn't honor ${DESTDIR}
+ make IDRIS2_PREFIX="$pkgdir/usr" \
+ PREFIX="$pkgdir/usr" install
+
+ # Install additional documentation files
+ mkdir -p "$pkgdir"/usr/share/doc/$pkgname/
+ install -m644 CHANGELOG.md CONTRIBUTING.md \
+ CONTRIBUTORS README.md "$pkgdir"/usr/share/doc/$pkgname/
+ cp -r docs/build/html "$pkgdir"/usr/share/doc/$pkgname/
+}
+
+sha512sums="465153b1d39b0e9a5195ecd836a6e678469b73f619e82c64dab87bdf61c0a6222972a5a65a46fa3ee3ac2342e93e9dfda316eedae59a29bcaf86ff046ef6bb04 idris2-0.3.0.tar.gz
+2b84e01da8afcd0e2631f153b1b6ffab9db11385b4dc6bdcb6a9be6b13546300c765717b5766dbaced013f7cc914aec19ef8bbd5cddbc56bd9514a5c0cac3e76 0001-Flush-standard-out-after-writing-prompt-to-it.patch
+43bfd62529d2188dd3093f3c729441ce365aaf60a0cc5b3107b74ae29bf58ecac5ebbd7eaf31b9761788255bebcbc98e8749fc80618b41d1bfe62fb1784a0295 0002-Better-default-permissions-for-created-directories.patch
+0e25a363c447cdac6b32fc4f322cb2be8b57f3d7a8dcb42244b8738941c757a06c6f76e3ca96447f3325794e0089c9468db322c0f5b94230d62919f17b3229eb 0003-Makefile-Don-t-run-bootstrap-test-on-bootstrap-by-de.patch"