Partially port postgres, update valkey

This commit is contained in:
Wildan M 2026-03-14 11:49:36 +07:00
parent 371d751e3e
commit 51264207ae
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
4 changed files with 61 additions and 5 deletions

View File

@ -0,0 +1,15 @@
#TODO require sys/ipc.h
[source]
tar = "https://ftp.postgresql.org/pub/source/v18.3/postgresql-18.3.tar.bz2"
blake3 = "52696c9d474ce3e2073f97d4ba891af59ffc67a9dfb8f9f5adac409d1fe0dc28"
patches = [
"redox.patch"
]
[build]
template = "meson"
mesonflags = [
]
dependencies = [
"zstd",
"readline",
]

View File

@ -0,0 +1,40 @@
diff --color -ruwN source/meson.build source-new/meson.build
--- source/meson.build 2026-02-24 04:56:43.000000000 +0700
+++ source-new/meson.build 2026-03-14 10:58:35.570033768 +0700
@@ -256,6 +256,10 @@
# LDFLAGS.
ldflags += ['-Wl,-z,now', '-Wl,-z,relro']
+elif host_system == 'redox'
+ sema_kind = 'unnamed_posix'
+ shmem_kind = 'sysv'
+
elif host_system == 'openbsd'
# you're ok
diff --color -ruwN source/src/include/port/redox.h source-new/src/include/port/redox.h
--- source/src/include/port/redox.h 1970-01-01 07:00:00.000000000 +0700
+++ source-new/src/include/port/redox.h 2026-03-14 10:50:26.877146350 +0700
@@ -0,0 +1 @@
+/* src/include/port/redox.h */
diff --color -ruwN source/src/makefiles/Makefile.redox source-new/src/makefiles/Makefile.redox
--- source/src/makefiles/Makefile.redox 1970-01-01 07:00:00.000000000 +0700
+++ source-new/src/makefiles/Makefile.redox 2026-03-14 10:51:25.313879766 +0700
@@ -0,0 +1,6 @@
+rpath = -Wl,-R'$(rpathdir)'
+
+
+# Rule for building a shared library from a single .o file
+%.so: %.o
+ $(CC) $(CFLAGS) $< $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@
diff --color -ruwN source/src/template/redox source-new/src/template/redox
--- source/src/template/redox 1970-01-01 07:00:00.000000000 +0700
+++ source-new/src/template/redox 2026-03-14 10:55:40.896750233 +0700
@@ -0,0 +1,7 @@
+# src/template/redox
+
+# Prefer unnamed POSIX semaphores
+PREFERRED_SEMAPHORES=UNNAMED_POSIX
+
+# Extra CFLAGS for code that will go into a shared library
+CFLAGS_SL="-fPIC"

View File

@ -1,12 +1,13 @@
#TODO Compiling, server crashes in page fault
#TODO Compiling, not tested
[source]
git = "https://github.com/valkey-io/valkey"
rev = "a47e8fa1505578d78cef5c5e11da0972c3dae560" # 8.1.3
shallow_clone = true
rev = "9.0.3"
[build]
template = "custom"
dependencies = [
"openssl1"
"openssl3"
]
script = """
@ -14,6 +15,6 @@ rsync -av --delete "${COOKBOOK_SOURCE}"/* ./
${COOKBOOK_MAKE} MALLOC=libc BUILD_TLS=yes \
WARN="-Wall -W -Wno-missing-field-initializers" \
WARNINGS="-Wall -W -Wno-missing-field-initializers" \
AR="${TARGET}-gcc-ar"
AR="${TARGET}-gcc-ar" CFLAGS="${CFLAGS} ${CPPFLAGS}"
${COOKBOOK_MAKE} install PREFIX="${COOKBOOK_STAGE}"/usr
"""

View File

@ -1,4 +1,4 @@
#TODO node is working but ld.so crashing with npm
#TODO promote
[source]
tar = "https://nodejs.org/dist/v21.7.3/node-v21.7.3.tar.xz"
blake3 = "95a56db4f9729b2f8384ab58ccb2ec0c41da05991f7400ef97bd76748d77870b"