Compare commits

...

4 Commits

Author SHA1 Message Date
Niel D
f890c750b2 Merge branch 'make-arti-work-on-redox' into 'master'
Make Arti working on Redox

See merge request redox-os/redox!2402
2026-11-01 23:12:23 +00:00
Jeremy Soller
51ca58cc2b Merge branch 'install-places' into 'master'
Improve install for bzip2, cmake, termcap, tcl, libicu, mupdf

See merge request redox-os/redox!2414
2026-11-01 06:09:04 -07:00
Wildan M
84eae1e507
Improve install for bzip2, cmake, termcap, tcl, libicu, mupdf 2026-11-01 13:35:01 +07:00
Niel Duysters
7643fac87b Make Arti work on Redox
Several steps were required to get Arti to work on Redox:
- Disable harden feature to resolve secmem-proc issue
- Static link sqlite inside Arti
- Patch to resolve "try_lock() not supported"

With these changes Arti can be used on Redox. If it's called with argument `--disable-fs-permission-checks` since `/home` permissions do not restrict groups to write.

TODOs added to revisit later:
- Check if `redox.patch` is still required after planned Rust toolchain update.
- Instead of `static-sqlite` use our own linked `sqlite3` once that is fully functional.
2026-10-28 20:51:11 +01:00
12 changed files with 116 additions and 19 deletions

View File

@ -29,6 +29,7 @@ xfce4-full = {}
acid = {}
adwaita-icon-theme = {}
arti = "source"
atk = {}
autoconf = {}
automake = {}

View File

@ -35,6 +35,15 @@ ln -s "libbz2.so.1.0" "${COOKBOOK_STAGE}/usr/lib/libbz2.so.1"
ln -s "libbz2.so.1.0" "${COOKBOOK_STAGE}/usr/lib/libbz2.so"
fi
mkdir -p "${COOKBOOK_STAGE}/usr/lib/pkgconfig"
# Change symlinks in usr/bin as relative
find "${COOKBOOK_STAGE}/usr/bin" -type l | while read -r link; do
target=$(readlink "$link")
if [[ "$target" = /* ]]; then
ln -snfr "$target" "$link"
fi
done
mkdir -p "${COOKBOOK_STAGE}/usr/lib/pkgconfig" "${COOKBOOK_STAGE}/usr/share/"
cp "${COOKBOOK_RECIPE}/pkgconfig" "${COOKBOOK_STAGE}/usr/lib/pkgconfig/bzip2.pc"
mv "${COOKBOOK_STAGE}/usr/man" "${COOKBOOK_STAGE}/usr/share/"
"""

View File

@ -3,7 +3,7 @@ tar = "https://github.com/Kitware/CMake/releases/download/v4.3.2/cmake-4.3.2.tar
blake3 = "cbd0121189df1502f61e8f12f044b4a901b1ea16c74c016b85714e4661b8537f"
[build]
template = "cmake"
template = "custom"
dependencies = [
# "cppdap",
"curl",
@ -17,14 +17,19 @@ dependencies = [
"zlib",
"zstd",
]
cmakeflags = [
"-DBUILD_TESTING=Off",
"-DCMAKE_USE_SYSTEM_BZIP2=On",
"-DCMAKE_USE_SYSTEM_CURL=On",
"-DCMAKE_USE_SYSTEM_EXPAT=On",
"-DCMAKE_USE_SYSTEM_LIBARCHIVE=On",
"-DCMAKE_USE_SYSTEM_LIBUV=On",
"-DCMAKE_USE_SYSTEM_NGHTTP2=On",
"-DCMAKE_USE_SYSTEM_ZLIB=On",
"-DCMAKE_USE_SYSTEM_ZSTD=On",
]
script = """
DYNAMIC_INIT
COOKBOOK_CMAKE_FLAGS=(
-DBUILD_TESTING=Off
-DCMAKE_USE_SYSTEM_BZIP2=On
-DCMAKE_USE_SYSTEM_CURL=On
-DCMAKE_USE_SYSTEM_EXPAT=On
-DCMAKE_USE_SYSTEM_LIBARCHIVE=On
-DCMAKE_USE_SYSTEM_LIBUV=On
-DCMAKE_USE_SYSTEM_NGHTTP2=On
-DCMAKE_USE_SYSTEM_ZLIB=On
-DCMAKE_USE_SYSTEM_ZSTD=On
)
cookbook_cmake
mv "${COOKBOOK_STAGE}/usr/doc" "${COOKBOOK_STAGE}/usr/share/"
"""

View File

@ -6,13 +6,20 @@ patches = [
]
[build]
template = "custom"
compiler = "no-lto"
script = """
DYNAMIC_STATIC_INIT
export ac_cv_header_stdc=yes
COOKBOOK_CONFIGURE_FLAGS+=(
--prefix="${COOKBOOK_STAGE}/usr"
--enable-install-termcap
--with-termcap="${COOKBOOK_STAGE}/etc/termcap"
)
COOKBOOK_MAKE_FLAGS=(
infodir="$COOKBOOK_STAGE/usr/share/info"
)
# termcap only emit static object
export CC+=" -fPIC"
mkdir -p "${COOKBOOK_STAGE}/etc"
cookbook_configure
"""

View File

@ -1,5 +1,5 @@
#TODO add script for gnu make: https://github.com/ip7z/7zip/blob/main/DOC/readme.txt#L110
[source]
tar = "https://7-zip.org/a/7z2605-src.tar.xz"
tar = "https://github.com/ip7z/7zip/releases/download/26.05/7z2605-src.tar.xz"
[build]
template = "cmake"

View File

@ -1,7 +1,10 @@
#TODO compiled but not tested
[source]
tar = "http://prdownloads.sourceforge.net/tcl/tcl8.6.13-src.tar.gz"
blake3 = "a44611c5d38d7dbc1e6ce49d6a78ae7d43817b861412b54b30357bc431510978"
tar = "http://prdownloads.sourceforge.net/tcl/tcl9.1.0-src.tar.gz"
blake3 = "a5c4860fdbd9e01f002ab2cf8508f912f43ab218a5035d93cad23d57ac8b8db3"
patches = [
"redox.patch"
]
[build]
template = "custom"
@ -12,6 +15,7 @@ COOKBOOK_CONFIGURE_FLAGS+=(
ac_cv_func_memcmp_working=yes
tcl_cv_strstr_unbroken=
tcl_cv_strtoul_unbroken=
--disable-zipfs
)
cookbook_configure
"""

View File

@ -0,0 +1,23 @@
diff -ruwN source/generic/tclBasic.c source-new/generic/tclBasic.c
--- source/generic/tclBasic.c 2026-09-23 18:52:24.000000000 +0000
+++ source-new/generic/tclBasic.c 2026-10-31 22:41:10.290905986 +0000
@@ -8034,7 +8034,7 @@
return TCL_ERROR;
}
errno = 0;
- return CheckDoubleResult(interp, fma(d1, d2, d3));
+ return CheckDoubleResult(interp, d1 * d2 + d3);
}
static int
diff -ruwN source/pkgs/sqlite3.53.4/compat/sqlite3/sqlite3.c source-new/pkgs/sqlite3.53.4/compat/sqlite3/sqlite3.c
--- source/pkgs/sqlite3.53.4/compat/sqlite3/sqlite3.c 2026-09-11 17:37:04.000000000 +0000
+++ source-new/pkgs/sqlite3.53.4/compat/sqlite3/sqlite3.c 2026-10-31 22:44:08.440361284 +0000
@@ -15688,6 +15688,7 @@
/************** End of parse.h ***********************************************/
/************** Continuing where we left off in sqliteInt.h ******************/
+#include <alloca.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -16,6 +16,7 @@ CPPFLAGS+=" -fno-lto"
COOKBOOK_CONFIGURE="${COOKBOOK_SOURCE}/source/configure"
COOKBOOK_CONFIGURE_FLAGS+=(
icu_cv_host_frag=mh-linux
--sbindir=/usr/bin
)
if [ "$TARGET" != "$COOKBOOK_HOST_TARGET" ]; then
COOKBOOK_CONFIGURE_FLAGS+=(

View File

@ -14,10 +14,11 @@ dependencies = [
"libgumbo",
# "freeglut", TODO: HAVE_GLUT=yes
]
compiler = "gcc"
script = """
DYNAMIC_INIT
cd $COOKBOOK_SOURCE
mkdir -p $COOKBOOK_BUILD/shared-release
"${COOKBOOK_MAKE}" install-libs install-apps shared=yes build=release USE_SYSTEM_LIBS=yes \
"${COOKBOOK_MAKE}" install-libs install-apps shared=yes build=release USE_SYSTEM_LIBS=yes prefix=/usr \
-j "${COOKBOOK_MAKE_JOBS}" DESTDIR="${COOKBOOK_STAGE}" "OUT=$COOKBOOK_BUILD/shared-release"
"""

View File

@ -1,9 +1,17 @@
#TODO fix secmem-proc crate
[source]
git = "https://gitlab.torproject.org/tpo/core/arti"
rev = "arti-v2.7.0"
shallow_clone = true
# TODO: Check if this patch is still necessary after
# we've updated our Rust toolchains on Redox.
patches = ["redox.patch"]
[build]
template = "cargo"
# TODO: Remove `static-sqlite` feature once Redox' sqlite3-package is fully functional.
cargoflags = [
"--no-default-features",
"--features=default-runtime,dns-proxy,compression,bridge-client,pt-client,onion-service-client,vanguards,flowctl-cc,static-sqlite",
]
cargopackages = ["arti"]
dependencies = [
"openssl3",

View File

@ -0,0 +1,38 @@
diff --git a/crates/fslock-guard/Cargo.toml b/crates/fslock-guard/Cargo.toml
index 9cbffb2c..2fd42d35 100644
--- a/crates/fslock-guard/Cargo.toml
+++ b/crates/fslock-guard/Cargo.toml
@@ -24,2 +24,2 @@
-[target.'cfg(target_os = "android")'.dependencies]
+[target.'cfg(any(target_os = "android", target_os = "redox"))'.dependencies]
libc = "0.2"
diff --git a/crates/fslock-guard/src/lib.rs b/crates/fslock-guard/src/lib.rs
index b5e938bb..7c32168c 100644
--- a/crates/fslock-guard/src/lib.rs
+++ b/crates/fslock-guard/src/lib.rs
@@ -177,7 +177,7 @@ impl Drop for LockFileGuard {
/// Try to lock `f`, blocking if need be.
///
/// On non-android, this just calls [`fs::File::lock`].
-#[cfg(not(target_os = "android"))]
+#[cfg(not(any(target_os = "android", target_os = "redox")))]
fn do_lock(f: &fs::File) -> std::io::Result<()> {
f.lock()
}
@@ -185,7 +185,7 @@ fn do_lock(f: &fs::File) -> std::io::Result<()> {
/// Try to lock `f`, without blocking.
///
/// On non-android, this just calls [`fs::File::try_lock`].
-#[cfg(not(target_os = "android"))]
+#[cfg(not(any(target_os = "android", target_os = "redox")))]
fn do_try_lock(f: &fs::File) -> Result<(), std::fs::TryLockError> {
f.try_lock()
}
@@ -207,2 +207,2 @@
-#[cfg(target_os = "android")]
+#[cfg(any(target_os = "android", target_os = "redox"))]
fn do_lock(f: &fs::File) -> std::io::Result<()> {
@@ -234,2 +234,2 @@
-#[cfg(target_os = "android")]
+#[cfg(any(target_os = "android", target_os = "redox"))]
fn do_try_lock(f: &fs::File) -> Result<(), std::fs::TryLockError> {

View File

@ -220,7 +220,7 @@ COOKBOOK_MAKE="make"
function cookbook_configure {
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}" "$@"
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" "${COOKBOOK_MAKE_FLAGS[@]}"
"${COOKBOOK_MAKE}" install DESTDIR="${COOKBOOK_STAGE}"
"${COOKBOOK_MAKE}" install DESTDIR="${COOKBOOK_STAGE}" "${COOKBOOK_MAKE_FLAGS[@]}"
}
COOKBOOK_CMAKE="cmake"