Package GNU Readline and the target libseccomp library
@@ -0,0 +1,33 @@
1+defpkgbuild(libseccomp,
2+ #:pkgname, "libseccomp",
3+ #:pkgver, "2.5.5",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "Library and tools for Linux syscall filtering",
6+ #:arch, [#:x86-64, #:aarch64],
7+ #:url, "https://github.com/seccomp/libseccomp",
8+ #:license, "LGPL-2.1-or-later",
9+ #:depends, ["musl"],
10+ #:makedepends, ["linux-headers"],
11+ #:source, ["https://github.com/seccomp/libseccomp/releases/download/v2.5.5/libseccomp-2.5.5.tar.gz",
12+ "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/libseccomp/loongarch64.patch",
13+ "remove-redefinition-prctl.patch", "check.py"],
14+ #:sha256sums, ["248a2c8a4d9b9858aa6baf52712c34afefcf9c9e94b76dce02c1c9aa25fb3375",
15+ "0b7c5782ebf6b996e16147f10b2e366fe75b6275ba589e043ec78ec7779cc651",
16+ "3506ffadf6699b78164594b3615043233c9f57d9e6bde0418c552754a505f0dc",
17+ "aeb5ec0522d3f9818369587a9a02305db2117db99744b193bed4eca475df157a"],
18+ #:prepare, fn() {
19+ run("patch", "--batch", "--fuzz=0", "-d", "libseccomp-2.5.5", "-p1", "-i", "../loongarch64.patch")
20+ run("patch", "--batch", "--fuzz=0", "-d", "libseccomp-2.5.5", "-p1", "-i", "../remove-redefinition-prctl.patch")
21+ },
22+ #:build, fn() {
23+ run("vinix-configure", "libseccomp-2.5.5/configure", "--disable-python")
24+ run("make")
25+ },
26+ #:check, fn() {
27+ run("python3", "check.py")
28+ },
29+ #:package, fn() {
30+ run("make", "install", string-append("DESTDIR=", pkgdir()))
31+ run("find", pkgdir(), "-name", "*.la", "-delete")
32+ run("install", "-Dm644", "libseccomp-2.5.5/LICENSE", string-append(pkgdir(), "/usr/share/licenses/libseccomp/LICENSE"))
33+ })
@@ -0,0 +1,8 @@
1+"""Query both release ABI tables with the target resolver."""
2+import subprocess
3+
4+for architecture, expected in (("x86_64", "0"), ("aarch64", "63")):
5+ result = subprocess.check_output(["vinix-run", "--library-path", "src/.libs",
6+ "tools/.libs/scmp_sys_resolver", "-a", architecture, "read"], text=True)
7+ if result.strip() != expected:
8+ raise SystemExit(f"incorrect read syscall for {architecture}: {result.strip()}")
@@ -0,0 +1,9 @@
1+--- a/src/system.c
2++++ b/src/system.c
3+@@ -22,6 +22,5 @@
4+ #include <stdlib.h>
5+ #include <errno.h>
6+-#include <sys/prctl.h>
7+
8+ #define _GNU_SOURCE
9+ #include <unistd.h>
@@ -0,0 +1,77 @@
1+defpkgbuild(readline,
2+ #:pkgname, "readline",
3+ #:pkgver, "8.2.13",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "GNU readline and history libraries",
6+ #:arch, [#:x86-64, #:aarch64],
7+ #:license, "GPL-3.0-or-later",
8+ #:url, "https://tiswww.case.edu/php/chet/readline/rltop.html",
9+ #:depends, ["musl", "ncurses"],
10+ #:backup, ["etc/inputrc"],
11+ #:source, ["https://ftp.gnu.org/gnu/readline/readline-8.2.tar.gz",
12+ "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/readline/fix-ncurses-underlinking.patch",
13+ "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/readline/fix-rl_do_undo-crash.patch",
14+ "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/readline/inputrc",
15+ "readline82-001.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-001",
16+ "readline82-002.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-002",
17+ "readline82-003.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-003",
18+ "readline82-004.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-004",
19+ "readline82-005.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-005",
20+ "readline82-006.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-006",
21+ "readline82-007.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-007",
22+ "readline82-008.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-008",
23+ "readline82-009.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-009",
24+ "readline82-010.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-010",
25+ "readline82-011.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-011",
26+ "readline82-012.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-012",
27+ "readline82-013.patch::https://ftp.gnu.org/gnu/readline/readline-8.2-patches/readline82-013", "check-history.c"],
28+ #:sha256sums, ["3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35",
29+ "2b95ef139bba6ada370d1182b21ea92029923ff9d29ca0b45d25ae7e07fec5a5",
30+ "da6c997aac6601bd52e274e365da38850c7f3b2bd6e44fc057fa7f567c0727fa",
31+ "1372f6d69c3638d63724c6daecf339c82bb9520a77ead2d497cb66e7114e62bb",
32+ "bbf97f1ec40a929edab5aa81998c1e2ef435436c597754916e6a5868f273aff7",
33+ "e06503822c62f7bc0d9f387d4c78c09e0ce56e53872011363c74786c7cd4c053",
34+ "24f587ba46b46ed2b1868ccaf9947504feba154bb8faabd4adaea63ef7e6acb0",
35+ "79572eeaeb82afdc6869d7ad4cba9d4f519b1218070e17fa90bbecd49bd525ac",
36+ "622ba387dae5c185afb4b9b20634804e5f6c1c6e5e87ebee7c35a8f065114c99",
37+ "c7b45ff8c0d24d81482e6e0677e81563d13c74241f7b86c4de00d239bc81f5a1",
38+ "5911a5b980d7900aabdbee483f86dab7056851e6400efb002776a0a4a1bab6f6",
39+ "a177edc9d8c9f82e8c19d0630ab351f3fd1b201d655a1ddb5d51c4cee197b26a",
40+ "3d9885e692e1998523fd5c61f558cecd2aafd67a07bd3bfe1d7ad5a31777a116",
41+ "758e2ec65a0c214cfe6161f5cde3c5af4377c67d820ea01d13de3ca165f67b4c",
42+ "e0013d907f3a9e6482cc0934de1bd82ee3c3c4fd07a9646aa9899af237544dd7",
43+ "6c8adf8ed4a2ca629f7fd11301ed6293a6248c9da0c674f86217df715efccbd3",
44+ "1ea434957d6ec3a7b61763f1f3552dad0ebdd6754d65888b5cd6d80db3a788a8",
45+ "4a865aa80975c4c53212fe632508150b5414d9c50bd662dad13e9692d34290f4"],
46+ #:prepare, fn() {
47+ for-each(fn(file) {
48+ run("patch", "--batch", "-d", "readline-8.2", "-p0", "-i", string-append("../", file))
49+ }, list("fix-ncurses-underlinking.patch",
50+ "fix-rl_do_undo-crash.patch",
51+ "readline82-001.patch",
52+ "readline82-002.patch",
53+ "readline82-003.patch",
54+ "readline82-004.patch",
55+ "readline82-005.patch",
56+ "readline82-006.patch",
57+ "readline82-007.patch",
58+ "readline82-008.patch",
59+ "readline82-009.patch",
60+ "readline82-010.patch",
61+ "readline82-011.patch",
62+ "readline82-012.patch",
63+ "readline82-013.patch"))
64+ },
65+ #:build, fn() {
66+ run("vinix-configure", "readline-8.2/configure", "--enable-static", "--enable-shared")
67+ run("make")
68+ },
69+ #:package, fn() {
70+ run("make", "install", string-append("DESTDIR=", pkgdir()))
71+ run("rm", "-f", string-append(pkgdir(), "/usr/share/info/dir"))
72+ run("install", "-Dm644", "inputrc", string-append(pkgdir(), "/etc/inputrc"))
73+ run("vinix-cc", string-append("-I", pkgdir(), "/usr/include"), "check-history.c",
74+ string-append("-L", pkgdir(), "/usr/lib"), "-lreadline", "-o", "check-history")
75+ run("vinix-run", "--library-path", string-append(pkgdir(), "/usr/lib"), "./check-history")
76+ run("install", "-Dm644", "readline-8.2/COPYING", string-append(pkgdir(), "/usr/share/licenses/readline/COPYING"))
77+ })
@@ -0,0 +1,15 @@
1+#include <stdio.h>
2+#include <stdlib.h>
3+#include <string.h>
4+#include <readline/history.h>
5+#include <readline/readline.h>
6+
7+int main(void) {
8+ using_history();
9+ add_history("Vinix history");
10+ HIST_ENTRY *entry = history_get(history_base);
11+ int valid = rl_readline_version == RL_READLINE_VERSION && entry &&
12+ strcmp(entry->line, "Vinix history") == 0;
13+ clear_history();
14+ return valid ? EXIT_SUCCESS : EXIT_FAILURE;
15+}