redox/recipes/wip/web/firefox/recipe.toml

62 lines
2.0 KiB
TOML

#TODO compiled, need testing
# mach: https://firefox-source-docs.mozilla.org/setup/linux_build.html
# dependencies: https://packages.gentoo.org/packages/www-client/firefox/dependencies
# feature flags: https://wiki.gentoo.org/wiki/Firefox#USE_flags
[source]
git = "https://github.com/willnode/firefox"
branch = "redox-150"
shallow_clone = true
[build]
template = "custom"
dependencies = [
"libffi",
"freetype2",
"gtk3",
"pango",
"libxkbcommon",
"libice",
"mesa-x11",
"nspr",
"libxrandr",
"libsm",
# TODO: Should separate clang library and runtime
"clang21",
# "nss-nspr",
# "startup-notification",
"zlib",
# "ffmpeg6",
# "expat",
# "libepoxy",
# "pipewire",
]
script = """
DYNAMIC_INIT
cat ${COOKBOOK_RECIPE}/mozconfig > mozconfig
sed -i "s|COOKBOOK_BUILD|${COOKBOOK_BUILD}|g" mozconfig
sed -i "s|TARGET_CC|${CC}|g" mozconfig
sed -i "s|TARGET_CXX|${CXX}|g" mozconfig
sed -i "s|TARGET|${TARGET}|g" mozconfig
sed -i "s|NPROC|${COOKBOOK_MAKE_JOBS}|g" mozconfig
export MOZCONFIG="${COOKBOOK_BUILD}/mozconfig"
export PYTHONDONTWRITEBYTECODE=1
unset CC_WRAPPER
if [[ -z "$CI" ]]; then export MACH_NO_TERMINAL_FOOTER=1; fi;
# clang-sys specifics
PREFIX_INCLUDE="$COOKBOOK_HOST_SYSROOT/$TARGET/include"
export CLANGFLAGS="-I $PREFIX_INCLUDE/c++/13.2.0 -I $PREFIX_INCLUDE/c++/13.2.0/$TARGET -I $PREFIX_INCLUDE/c++/13.2.0/backward"
export CLANGFLAGS="$CLANGFLAGS -I $PREFIX_INCLUDE -I $COOKBOOK_SYSROOT/lib/clang/21/include -D__redox__"
export BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_redox="-target x86_64-unknown-redox -nostdinc $CLANGFLAGS"
export LLVM_CONFIG_PATH="$COOKBOOK_TOOLCHAIN/bin/llvm-config"
# Don't poison the stage1 compiler (host -> host)
unset AR AS CC CXX LD NM OBJCOPY OBJDUMP RANLIB READELF RUSTFLAGS STRIP
(cd ${COOKBOOK_SOURCE} && ./mach build -v)
(cd ${COOKBOOK_SOURCE} && ./mach package)
mkdir -p ${COOKBOOK_STAGE}/usr/lib/firefox ${COOKBOOK_STAGE}/usr/bin
rsync -a ./dist/firefox/ ${COOKBOOK_STAGE}/usr/lib/firefox/
ln -s ../lib/firefox/firefox ${COOKBOOK_STAGE}/usr/bin/firefox
"""