Merge branch 'redox_mods' into 'master'

Servo and dependencies: libpango, mozjs, aws-lc-rs, freetype-sys, mozangle, tikv-reallocator.

See merge request redox-os/cookbook!596
This commit is contained in:
Jeremy Soller 2025-08-31 10:30:53 -06:00
commit fab7788dfe
8 changed files with 279 additions and 22 deletions

View File

@ -1,31 +1,41 @@
[source]
tar="https://download.gnome.org/sources/pango/1.56/pango-1.56.3.tar.xz"
tar = "https://download.gnome.org/sources/pango/1.56/pango-1.56.3.tar.xz"
blake3 = "78542feaaf007c1d648b94c4e9b6655ed7515d27ce434766aea99bef886c21ac"
patches = ["redox.patch"]
[build]
dependencies = [
"cairo",
"expat",
"fontconfig",
"freetype2",
"fribidi",
"gettext",
"glib",
"harfbuzz",
"libffi",
"libiconv",
"libpng",
"pcre",
"pixman",
"zlib",
"cairo",
"expat",
"fontconfig",
"freetype2",
"fribidi",
"gettext",
"glib",
"harfbuzz",
"libffi",
"libiconv",
"libpng",
"libpthread-stubs",
"libx11",
"libxau",
"libxcb",
"libxext",
"libxrender",
"pcre",
"pcre2",
"pixman",
"x11proto",
"xcb-proto",
"xextproto",
"zlib",
]
template = "custom"
script = """
DYNAMIC_INIT
#TODO: why are these libs not automatic?
cookbook_meson \
-Dc_args="-lfontconfig -lexpat -lpixman-1 -lpng -lz" \
-Dc_args="-lfontconfig -lexpat -lpixman-1 -lpng -lz -lcairo" \
-Dbuild-examples=false \
-Dbuild-testsuite=false
"""

View File

@ -0,0 +1,40 @@
#TODO "No suitable wgpu::Adapter found" error on execution
[source]
git = "https://gitlab.redox-os.org/njskalski/mozjs.git"
branch = "redox_mods"
[build]
template = "custom"
#these dependencies are copied from Servo recipe. Some of them may be redundant, but I needed to reproduce the build bug.
dependencies = [
"freetype2",
"gettext",
"glib",
"gstreamer",
"harfbuzz",
"libffi",
"libiconv",
"libx11",
"libxcb",
"libpng",
"openssl1",
"pcre",
"zlib",
"x11proto",
"x11proto-kb",
"xcb-proto",
"xextproto",
"libxau",
"libpthread-stubs",
"fontconfig",
"expat",
"llvm18",
"gcc13",
]
script = """
# Build the library crates
"${COOKBOOK_REDOXER}" build --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" --workspace --release
# Library crates don't need installation, they're used as dependencies
"""

View File

@ -0,0 +1,15 @@
[source]
git = "https://gitlab.redox-os.org/njskalski/aws-lc-rs.git"
branch = "redox_mods"
[build]
template = "custom"
script = """
# we need HOST != TARGET, because otherwise we get this error: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189
# by this line https://gitlab.redox-os.org/njskalski/aws-lc-rs/-/blob/main/aws-lc-sys/builder/cc_builder.rs#L493
export HOST=x86_64-linux-gnu
rsync -a --delete "${COOKBOOK_SOURCE}/" ./
cargo build -p aws-lc-sys --target ${TARGET} --release
cargo build -p aws-lc-rs --target ${TARGET} --release
"""

View File

@ -0,0 +1,28 @@
[source]
git = "https://github.com/PistonDevelopers/freetype-sys.git"
[build]
template = "custom"
dependencies = [
"freetype2",
"zlib",
"libpng"
]
script = """
# export PKG_CONFIG_PATH="${COOKBOOK_SYSROOT}/lib/pkgconfig"
# #:${COOKBOOK_SYSROOT}/usr/lib/pkgconfig:${COOKBOOK_SYSROOT}/usr/share/pkgconfig"
# export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig"
# #:${COOKBOOK_SYSROOT}/usr/lib/pkgconfig"
# export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
# # I'm tired trying figure out why multiple pkgconfig paths are ignored by cargo building stuff
# # rsync -a -v ${COOKBOOK_SYSROOT}/usr/share/pkgconfig/*.pc ${COOKBOOK_SYSROOT}/lib/pkgconfig/
# rsync -a -v ${COOKBOOK_SYSROOT}/usr/lib/pkgconfig/*.pc ${COOKBOOK_SYSROOT}/lib/pkgconfig/
# ls -al $PKG_CONFIG_PATH
# env
rsync -a --delete "${COOKBOOK_SOURCE}/" ./
cargo build --release
"""

View File

@ -0,0 +1,41 @@
[source]
git = "https://gitlab.redox-os.org/njskalski/mozangle.git"
branch = "redox_mods"
[build]
template = "custom"
dependencies = [
"freetype2",
"gettext",
"glib",
"gstreamer",
"harfbuzz",
"libffi",
"libiconv",
"libx11",
"libxcb",
"libpng",
"openssl1",
"pcre",
"zlib",
"x11proto",
"x11proto-kb",
"xcb-proto",
"xextproto",
"libxau",
"libpthread-stubs",
"fontconfig",
"expat",
"relibc",
"gcc13",
]
script = """
export TARGET=${TARGET}
export TARGET_CC=${TARGET}-gcc
export TARGET_CXX=${TARGET}-g++
export TARGET_AR=${TARGET}-ar
rsync -a --delete "${COOKBOOK_SOURCE}/" ./
cargo build --release --target ${TARGET}
"""

View File

@ -0,0 +1,12 @@
#TODO "No suitable wgpu::Adapter found" error on execution
[source]
git = "https://gitlab.redox-os.org/njskalski/jemallocator.git"
branch = "redox_mods"
[build]
template = "custom"
script = """
# Build the library crates
"${COOKBOOK_REDOXER}" build --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" --workspace --release
# Library crates don't need installation, they're used as dependencies
"""

View File

@ -0,0 +1,61 @@
# Copy this file to .servobuild in the Servo root directory
# Paths starting with "./" are relative to the repo root
# Tool options
[tools]
[build]
# Set "mode = dev" or use `mach build --dev` to build the project with warning.
# or Set "mode = release" or use `mach build --release` for optimized build.
# Use `mode = <profile>` or `mach build --profile=<profile>` to build the given
# profile. Check the `Cargo.toml` manifest for a complete list of custom profiles.
# Defaults to prompting before building
#mode = "dev"
# Set "android = true" or use `mach build --android` to build the Android app.
android = false
# Enable `debug_assert!` macros in release mode
debug-assertions = true
# Set "debug-mozjs" or use `mach build --debug-mozjs` to build a debug spidermonkey.
debug-mozjs = false
# When a GL error occurs as a result of a WebGL operation, print the stack trace for the content
# JS and native Rust code that triggered the failed operation. Warning: very slow.
webgl-backtrace = false
# When a DOM exception is reported, print the stack trace for the content JS and native Rust code
# that triggered it.
dom-backtrace = false
# Pick a media stack based on the target. Other values are "gstreamer" and "dummy"
media-stack = "dummy"
# Set to the path to your ccache binary to enable caching of compiler outputs
#ccache = "/usr/local/bin/ccache"
# Any optional flags that will be added to $RUSTFLAGS
#rustflags = ""
# Enable or disable rustcs incremental compilation
# Cargos default is to enable it in debug mode but not in release mode.
# Leaving this key unspecified makes mach keep Cargos default.
# It can be set to true or false in order to always enable or always disable
# incremental compilation.
#incremental = false
#incremental = true
# Android information
[android]
# Defaults to the value of $ANDROID_SDK_ROOT, $ANDROID_NDK_ROOT respectively
#sdk = "/opt/android-sdk"
#ndk = "/opt/android-ndk"
# OpenHarmony
[ohos]
# Defaults to the value of $OHOS_SDK_NATIVE
#ndk = "/path/to/ohos-sdk/<host-os>/native"

View File

@ -1,9 +1,7 @@
#TODO not compiled or tested
# if the script is wrong, read this - https://github.com/servo/servo#release-build
# advanced build instructions - https://github.com/servo/servo/wiki/Building#manual-build-setup
[source]
git = "https://github.com/servo/servo"
#git = "https://gitlab.redox-os.org/redox-os/servo"
git = "https://gitlab.redox-os.org/njskalski/servo.git"
branch = "redox_mods"
[build]
template = "custom"
dependencies = [
@ -14,11 +12,63 @@ dependencies = [
"harfbuzz",
"libffi",
"libiconv",
"libx11",
"libxcb",
"libpng",
"openssl1",
"pcre",
"zlib",
"x11proto",
"x11proto-kb",
"xcb-proto",
"xextproto",
"libxau",
"libpthread-stubs",
"fontconfig",
"expat",
"relibc",
"gcc13",
]
script = """
cookbook_cargo_packages servoshell
cp "${COOKBOOK_RECIPE}/.servobuild" "${COOKBOOK_SOURCE}/.servobuild"
# Add wrapper to PATH
export PATH="${COOKBOOK_RECIPE}:${PATH}"
export TARGET=${TARGET}
# Force cargo to use the correct build target
export CARGO_BUILD_TARGET=${TARGET}
# jemalloc specific configuration
export JEMALLOC_SYS_WITH_LG_PAGE=16
export TARGET_CC=${TARGET}-gcc
export TARGET_CXX=${TARGET}-g++
export TARGET_AR=${TARGET}-ar
export PKG_CONFIG_ALLOW_CROSS=1
# this /usr/share/pkgconfig comes from x11proto, that stages pc files in wrong dir.
export PKG_CONFIG_PATH="${COOKBOOK_SYSROOT}/lib/pkgconfig"
#:${COOKBOOK_SYSROOT}/usr/lib/pkgconfig:${COOKBOOK_SYSROOT}/usr/share/pkgconfig"
export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig"
#:${COOKBOOK_SYSROOT}/usr/lib/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
export RUSTFLAGS="-C target-feature=-crt-static -C link-args=-lpng -C link-args=-lxcb -C link-args=-lexpat -C link-args=-lgcc_s -C link-args=-lz -C link-args=-lXau -C link-args=-no-pie"
rsync -a --delete "${COOKBOOK_SOURCE}/" ./
# I'm tired trying figure out why multiple pkgconfig paths are ignored by cargo building stuff
rsync -a -v ${COOKBOOK_SYSROOT}/usr/share/pkgconfig/*.pc ${COOKBOOK_SYSROOT}/lib/pkgconfig/
rsync -a -v ${COOKBOOK_SYSROOT}/usr/lib/pkgconfig/*.pc ${COOKBOOK_SYSROOT}/lib/pkgconfig/
echo "listing ${COOKBOOK_SYSROOT}/lib/pkgconfig"
ls -al ${COOKBOOK_SYSROOT}/lib/pkgconfig
# -j 1 to lock down "which crate fails", because cargo tree -i doesn't work for gaol
cargo build --target ${TARGET} --release
mkdir -pv "${COOKBOOK_STAGE}/usr/servo"
cp -r -v "target/${TARGET}/release/servo" "${COOKBOOK_STAGE}/usr/servo"
"""