cub: full AUR package manager + Phase 1-5 native build tools
cub redesign (local/recipes/system/cub/): - AUR RPC v5 client (serde_json) with search/info - ~/.cub/ user-local recipe/source/repo storage - Enhanced PKGBUILD parser: optdepends, .SRCINFO, split packages, 19 linuxism patterns - Recipe generation: host: prefix on dev-deps, shallow_clone, cargopath, installs, optional-packages - Dependency resolver: scans build errors for missing commands/headers/libs/pkgconfig, maps to packages - Dependency installation: checks installed packages, fetches AUR deps, interactive prompt - ~110 Arc→Redox dependency mappings - ratatui TUI: search, info, install, build, query views - 14 Arch-style CLI switches (-S/-Si/-Syu/-G/-R/-Q/-Qi/-Ql) - 65 tests, 0 failures, clean build Phase 1-5 native build tools (local/recipes/dev/): - P1 Substrate: tar, m4, diffutils (gnulib bypass), mkfifo kernel patch (1085 lines) - P2 Build Systems: bison, flex, meson (standalone wrapper), ninja-build, libtool - P3 Native GCC: gcc-native, binutils-native (cross-compiled for redox host) - P4 Native LLVM: llvm-native (clang + lld from monorepo) - P5 Native Rust: rust-native (rustc + cargo) - Groups: build-essential-native, dev-essential expanded Config: - redbear-mini: +7 tools (diffutils, tar, bison, flex, meson, ninja, m4) - redbear-full: +4 native tools (gcc, binutils, llvm, rust) - All recipes moved to local/ with symlinks for cookbook discovery (Red Bear policy) Docs: - BUILD-TOOLS-PORTING-PLAN.md: phased porting roadmap - CUB-WORKFLOW-ASSESSMENT.md: gap analysis and integration assessment
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
# Native GNU Binutils 2.43.1 for Red Bear OS
|
||||
# Produces binutils that RUN on x86_64-unknown-redox and TARGET x86_64-unknown-redox.
|
||||
# Built via cross-compilation from host using the existing cross-compiler in prefix/.
|
||||
|
||||
[source]
|
||||
same_as = "../../../../recipes/dev/binutils-gdb"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"gcc13",
|
||||
"gnu-binutils",
|
||||
"libgmp",
|
||||
"libmpfr",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
|
||||
# Use the cross-compiler to produce native redox binaries
|
||||
export CC="${COOKBOOK_TARGET}-gcc"
|
||||
export CXX="${COOKBOOK_TARGET}-g++"
|
||||
export AR="${COOKBOOK_TARGET}-ar"
|
||||
export RANLIB="${COOKBOOK_TARGET}-ranlib"
|
||||
|
||||
# Configure for native compilation
|
||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
--host="${GNU_TARGET}"
|
||||
--target="${GNU_TARGET}"
|
||||
--prefix=/usr
|
||||
--with-sysroot="${COOKBOOK_SYSROOT}"
|
||||
--enable-default-hash-style=gnu
|
||||
--disable-werror
|
||||
--disable-nls
|
||||
--disable-multilib
|
||||
)
|
||||
|
||||
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}"
|
||||
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}"
|
||||
"${COOKBOOK_MAKE}" install DESTDIR="${COOKBOOK_STAGE}"
|
||||
|
||||
# Native binutils don't need the target prefix - provide unprefixed links
|
||||
for tool in ar as ld nm objcopy objdump ranlib readelf size strings strip; do
|
||||
if [ -f "${COOKBOOK_STAGE}/usr/bin/${GNU_TARGET}-${tool}" ]; then
|
||||
ln -sf "${GNU_TARGET}-${tool}" "${COOKBOOK_STAGE}/usr/bin/${tool}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Remove libtool archives
|
||||
rm -f "${COOKBOOK_STAGE}"/usr/lib/*.la
|
||||
"""
|
||||
|
||||
[package]
|
||||
description = "Native GNU Binutils 2.43.1 for Red Bear OS (runs on redox, targets redox)"
|
||||
@@ -0,0 +1,21 @@
|
||||
[source]
|
||||
tar = "https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.xz"
|
||||
blake3 = "9dd90be8df4d0474b941e2ca14ac76d11b7ccb46edb26344b60d866178bbcc98"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
export ac_cv_func___fseterr=yes
|
||||
export ac_cv_type_sigset_t=yes
|
||||
export ac_cv_type_posix_spawnattr_t=yes
|
||||
export ac_cv_type_posix_spawn_file_actions_t=yes
|
||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
--disable-nls
|
||||
)
|
||||
cookbook_configure
|
||||
"""
|
||||
|
||||
[package]
|
||||
description = "GNU parser generator (yacc-compatible)"
|
||||
dependencies = ["m4"]
|
||||
@@ -0,0 +1,15 @@
|
||||
[source]
|
||||
tar = "https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
--disable-nls
|
||||
)
|
||||
cookbook_configure
|
||||
"""
|
||||
|
||||
[package]
|
||||
description = "Fast lexical analyzer generator (lex-compatible)"
|
||||
@@ -0,0 +1,96 @@
|
||||
# Native GCC 13.2.0 for Red Bear OS
|
||||
# Produces GCC that RUNS on x86_64-unknown-redox and TARGETS x86_64-unknown-redox.
|
||||
# Built via cross-compilation from the host using the existing cross-compiler in prefix/.
|
||||
#
|
||||
# This is Strategy A from BUILD-TOOLS-PORTING-PLAN.md: pre-built native toolchain
|
||||
# produced by cross-compilation, avoiding the multi-stage self-hosting bootstrap.
|
||||
#
|
||||
# To use: repo cook local/recipes/dev/gcc-native
|
||||
# The resulting gcc binary runs inside Red Bear OS.
|
||||
|
||||
[source]
|
||||
same_as = "../../../../recipes/dev/gcc13"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"gcc13",
|
||||
"gcc13.cxx",
|
||||
"gnu-binutils",
|
||||
"libgmp",
|
||||
"libmpfr",
|
||||
"mpc",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
|
||||
# Use the cross-compiler to produce native redox binaries
|
||||
export CC="${COOKBOOK_TARGET}-gcc"
|
||||
export CXX="${COOKBOOK_TARGET}-g++"
|
||||
export AR="${COOKBOOK_TARGET}-ar"
|
||||
export RANLIB="${COOKBOOK_TARGET}-ranlib"
|
||||
export LD="${COOKBOOK_TARGET}-ld"
|
||||
export NM="${COOKBOOK_TARGET}-nm"
|
||||
export STRIP="${COOKBOOK_TARGET}-strip"
|
||||
|
||||
# Configure for native compilation: host AND target are both redox
|
||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
--host="${GNU_TARGET}"
|
||||
--target="${GNU_TARGET}"
|
||||
--prefix=/usr
|
||||
--with-sysroot="${COOKBOOK_SYSROOT}"
|
||||
--with-gmp="${COOKBOOK_SYSROOT}/usr"
|
||||
--with-mpfr="${COOKBOOK_SYSROOT}/usr"
|
||||
--with-mpc="${COOKBOOK_SYSROOT}/usr"
|
||||
--with-linker-hash-style=gnu
|
||||
--enable-languages=c,c++,lto
|
||||
--enable-initfini-array
|
||||
--disable-nls
|
||||
--disable-multilib
|
||||
--enable-host-shared
|
||||
--enable-threads=posix
|
||||
--enable-libstdcxx-threads
|
||||
--disable-bootstrap
|
||||
--with-bugurl="https://gitlab.redox-os.org/redox-os/gcc/-/issues"
|
||||
)
|
||||
|
||||
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}"
|
||||
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" all-gcc all-target-libgcc all-target-libstdc++-v3
|
||||
"${COOKBOOK_MAKE}" install-gcc install-target-libgcc install-target-libstdc++-v3 DESTDIR="${COOKBOOK_STAGE}"
|
||||
|
||||
# Native GCC doesn't need the target prefix
|
||||
for tool in gcc g++ c++ cpp gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool gfortran; do
|
||||
if [ -f "${COOKBOOK_STAGE}/usr/bin/${GNU_TARGET}-${tool}" ]; then
|
||||
ln -sf "${GNU_TARGET}-${tool}" "${COOKBOOK_STAGE}/usr/bin/${tool}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Provide cc symlink
|
||||
ln -sf gcc "${COOKBOOK_STAGE}/usr/bin/cc"
|
||||
|
||||
# Remove libtool archives
|
||||
rm -f "${COOKBOOK_STAGE}"/usr/lib/libgcc_s.so* "${COOKBOOK_STAGE}"/usr/lib/libstdc++.so*
|
||||
rm -f "${COOKBOOK_STAGE}"/usr/lib/*.la
|
||||
|
||||
# Copy libgcc and libstdc++ into target lib dir
|
||||
mkdir -p "${COOKBOOK_STAGE}/usr/lib/${GNU_TARGET}"
|
||||
cp -a "${COOKBOOK_STAGE}"/usr/lib/gcc/${GNU_TARGET}/13.2.0/libgcc.a "${COOKBOOK_STAGE}/usr/lib/${GNU_TARGET}/" || true
|
||||
cp -a "${COOKBOOK_STAGE}"/usr/lib/gcc/${GNU_TARGET}/13.2.0/libgcc_eh.a "${COOKBOOK_STAGE}/usr/lib/${GNU_TARGET}/" || true
|
||||
"""
|
||||
|
||||
[package]
|
||||
description = "Native GCC 13.2.0 compiler for Red Bear OS (runs on redox, targets redox)"
|
||||
dependencies = ["gnu-binutils"]
|
||||
|
||||
[[optional-packages]]
|
||||
name = "cxx"
|
||||
dependencies = []
|
||||
files = [
|
||||
"usr/bin/*c++",
|
||||
"usr/bin/*g++",
|
||||
"usr/bin/g++",
|
||||
"usr/include/c++/**",
|
||||
"usr/lib/*c++*",
|
||||
"usr/libexec/gcc/**/cc1plus",
|
||||
"usr/share/gcc-*/python/libstdcxx/**",
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
[source]
|
||||
tar = "http://ftp.gnu.org/gnu/make/make-4.4.tar.gz"
|
||||
blake3 = "1a0e5353205e106bd9b3c0f4a5f37ee1156a1e1c8feb771d1b4842c216612cba"
|
||||
patches = [
|
||||
"redox.patch"
|
||||
]
|
||||
script = """
|
||||
autotools_recursive_regenerate
|
||||
"""
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
cookbook_configure
|
||||
"""
|
||||
|
||||
[package]
|
||||
description = "GNU Make build system (mkfifo jobserver enabled)"
|
||||
@@ -0,0 +1,40 @@
|
||||
diff -ruwN make-4.4/src/arscan.c source/src/arscan.c
|
||||
--- make-4.4/src/arscan.c 2022-10-23 16:52:32.000000000 +0200
|
||||
+++ source/src/arscan.c 2024-08-23 18:28:49.206084084 +0200
|
||||
@@ -331,7 +331,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef WINDOWS32
|
||||
-# if !defined (__ANDROID__) && !defined (__BEOS__)
|
||||
+# if 0
|
||||
# include <ar.h>
|
||||
# else
|
||||
/* These platforms don't have <ar.h> but have archives in the same format
|
||||
diff -ruwN make-4.4/src/getopt1.c source/src/getopt1.c
|
||||
--- make-4.4/src/getopt1.c 2022-10-23 21:52:32.000000000 +0700
|
||||
+++ source/src/getopt1.c 2026-01-24 23:28:34.306706884 +0700
|
||||
@@ -48,6 +48,10 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+#ifdef __redox__
|
||||
+#define ELIDE_CODE
|
||||
+#endif
|
||||
+
|
||||
#ifndef ELIDE_CODE
|
||||
|
||||
|
||||
diff -ruwN make-4.4/src/getopt.c source/src/getopt.c
|
||||
--- make-4.4/src/getopt.c 2022-10-23 21:52:32.000000000 +0700
|
||||
+++ source/src/getopt.c 2026-01-24 23:21:09.488487860 +0700
|
||||
@@ -56,6 +56,10 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+#ifdef __redox__
|
||||
+#define ELIDE_CODE
|
||||
+#endif
|
||||
+
|
||||
#ifndef ELIDE_CODE
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/libtool"
|
||||
branch = "v2.5.4-redox"
|
||||
shallow_clone = true
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
unset CFLAGS
|
||||
cp -r "${COOKBOOK_SOURCE}"/. ./
|
||||
./bootstrap \
|
||||
--skip-po \
|
||||
--force \
|
||||
--gnulib-srcdir=./gnulib
|
||||
COOKBOOK_CONFIGURE="./configure"
|
||||
cookbook_configure
|
||||
"""
|
||||
|
||||
[package]
|
||||
description = "GNU Libtool (shared library support)"
|
||||
@@ -0,0 +1,117 @@
|
||||
[source]
|
||||
same_as = "../../../../recipes/dev/llvm21"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"llvm21",
|
||||
"llvm21.runtime",
|
||||
"llvm21.dev",
|
||||
"clang21",
|
||||
"lld21",
|
||||
"zstd",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
ARCH="$(echo "${TARGET}" | cut -d - -f1)"
|
||||
|
||||
generate_cookbook_cmake_file "$COOKBOOK_HOST_TARGET" "" "$COOKBOOK_TOOLCHAIN" native.cmake
|
||||
|
||||
case "${ARCH}" in
|
||||
x86 | x86_64) LLVM_TARGETS_TO_BUILD="X86";;
|
||||
aarch64) LLVM_TARGETS_TO_BUILD="AArch64";;
|
||||
riscv64gc) LLVM_TARGETS_TO_BUILD="RISCV";;
|
||||
esac
|
||||
|
||||
COOKBOOK_CMAKE_FLAGS+=(
|
||||
-DLLVM_ENABLE_PROJECTS="clang;lld"
|
||||
-DLLVM_BUILD_LLVM_DYLIB=On
|
||||
-DLLVM_LINK_LLVM_DYLIB=On
|
||||
-DLLVM_INCLUDE_UTILS=On
|
||||
-DLLVM_INSTALL_UTILS=On
|
||||
-DLLVM_TARGETS_TO_BUILD="$LLVM_TARGETS_TO_BUILD"
|
||||
-DLLVM_ENABLE_ZLIB=Off
|
||||
-DLLVM_USE_STATIC_ZSTD=On
|
||||
-DLLVM_ENABLE_LIBXML2=Off
|
||||
-DCLANG_LINK_CLANG_DYLIB=ON
|
||||
-DLIBCLANG_BUILD_STATIC=1
|
||||
-DCROSS_TOOLCHAIN_FLAGS_NATIVE="-DCMAKE_TOOLCHAIN_FILE=$(realpath native.cmake)"
|
||||
-DCMAKE_CXX_FLAGS="--std=gnu++11"
|
||||
-DBUILD_SHARED_LIBS=False
|
||||
-DLLVM_BUILD_EXAMPLES=Off
|
||||
-DLLVM_BUILD_TESTS=Off
|
||||
-DLLVM_DEFAULT_TARGET_TRIPLE="${TARGET}"
|
||||
-DLLVM_ENABLE_LTO=Off
|
||||
-DLLVM_ENABLE_RTTI=On
|
||||
-DLLVM_ENABLE_THREADS=On
|
||||
-DLLVM_INCLUDE_EXAMPLES=Off
|
||||
-DLLVM_INCLUDE_TESTS=Off
|
||||
-DLLVM_OPTIMIZED_TABLEGEN=On
|
||||
-DLLVM_TARGET_ARCH=$ARCH
|
||||
-DLLVM_TOOLS_INSTALL_DIR=bin
|
||||
-DLLVM_UTILS_INSTALL_DIR=bin
|
||||
-DUNIX=1
|
||||
-DLLVM_TABLEGEN_EXE=${COOKBOOK_HOST_SYSROOT}/bin/llvm-tblgen
|
||||
-DCLANG_TABLEGEN_EXE=${COOKBOOK_HOST_SYSROOT}/bin/clang-tblgen
|
||||
)
|
||||
|
||||
COOKBOOK_SOURCE="$COOKBOOK_SOURCE/llvm"
|
||||
cookbook_cmake
|
||||
|
||||
# Create unprefixed symlinks for native use
|
||||
for tool in clang clang++ clang-cpp clang-cl clang-check clang-format clang-tidy \
|
||||
lld ld.lld ld64.lld wasm-ld \
|
||||
llvm-ar llvm-ranlib llvm-nm llvm-objdump llvm-objcopy llvm-strip \
|
||||
llvm-readelf llvm-size llvm-strings llvm-symbolizer llvm-addr2line \
|
||||
llvm-config llvm-link llvm-profdata llvm-cov \
|
||||
llvm-as llvm-dis llc opt; do
|
||||
if [ -f "${COOKBOOK_STAGE}/usr/bin/${tool}" ]; then
|
||||
: # already has unprefixed name
|
||||
elif [ -f "${COOKBOOK_STAGE}/usr/bin/${GNU_TARGET}-${tool}" ]; then
|
||||
ln -sf "${GNU_TARGET}-${tool}" "${COOKBOOK_STAGE}/usr/bin/${tool}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Provide cc/c++ symlinks
|
||||
if [ -f "${COOKBOOK_STAGE}/usr/bin/clang" ]; then
|
||||
ln -sf clang "${COOKBOOK_STAGE}/usr/bin/cc"
|
||||
ln -sf clang++ "${COOKBOOK_STAGE}/usr/bin/c++"
|
||||
elif [ -f "${COOKBOOK_STAGE}/usr/bin/${GNU_TARGET}-clang" ]; then
|
||||
ln -sf "${GNU_TARGET}-clang" "${COOKBOOK_STAGE}/usr/bin/cc"
|
||||
ln -sf "${GNU_TARGET}-clang++" "${COOKBOOK_STAGE}/usr/bin/c++"
|
||||
fi
|
||||
|
||||
# Remove libtool archives
|
||||
rm -f "${COOKBOOK_STAGE}"/usr/lib/*.la
|
||||
"""
|
||||
|
||||
[package]
|
||||
description = "Native LLVM/Clang/LLD 21 toolchain for Red Bear OS"
|
||||
dependencies = ["llvm21.runtime"]
|
||||
|
||||
[[optional-packages]]
|
||||
name = "dev"
|
||||
dependencies = [".runtime"]
|
||||
files = [
|
||||
"usr/include/llvm*/**",
|
||||
"usr/include/clang*/**",
|
||||
"usr/include/lld*/**",
|
||||
"usr/lib/libLLVM*.a",
|
||||
"usr/lib/libclang*.a",
|
||||
"usr/lib/liblld*.a",
|
||||
"usr/lib/cmake/llvm/**",
|
||||
"usr/lib/cmake/clang/**",
|
||||
"usr/lib/cmake/lld/**",
|
||||
]
|
||||
|
||||
[[optional-packages]]
|
||||
name = "runtime"
|
||||
files = [
|
||||
"usr/bin/clang*",
|
||||
"usr/bin/lld*",
|
||||
"usr/bin/llvm-*",
|
||||
"usr/bin/llc",
|
||||
"usr/bin/opt",
|
||||
"usr/lib/libLLVM*.so*",
|
||||
"usr/lib/libclang*.so*",
|
||||
]
|
||||
@@ -0,0 +1,15 @@
|
||||
[source]
|
||||
tar = "https://ftp.gnu.org/gnu/m4/m4-1.14.21.tar.xz"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
--disable-nls
|
||||
)
|
||||
cookbook_configure
|
||||
"""
|
||||
|
||||
[package]
|
||||
description = "GNU M4 macro processor"
|
||||
@@ -0,0 +1,25 @@
|
||||
[source]
|
||||
tar = "https://github.com/mesonbuild/meson/releases/download/1.3.0/meson-1.3.0.tar.gz"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
cp -r "${COOKBOOK_SOURCE}"/. ./
|
||||
|
||||
mkdir -p "${COOKBOOK_STAGE}/usr/bin"
|
||||
mkdir -p "${COOKBOOK_STAGE}/usr/lib/meson"
|
||||
|
||||
cp -r mesonbuild "${COOKBOOK_STAGE}/usr/lib/meson/"
|
||||
cp meson.py "${COOKBOOK_STAGE}/usr/lib/meson/"
|
||||
|
||||
cat > "${COOKBOOK_STAGE}/usr/bin/meson" << 'MESON_WRAPPER'
|
||||
#!/bin/sh
|
||||
exec python3 /usr/lib/meson/meson.py "$@"
|
||||
MESON_WRAPPER
|
||||
chmod +x "${COOKBOOK_STAGE}/usr/bin/meson"
|
||||
"""
|
||||
|
||||
[package]
|
||||
description = "Meson build system"
|
||||
dependencies = ["python312"]
|
||||
@@ -0,0 +1,9 @@
|
||||
[source]
|
||||
git = "https://github.com/ninja-build/ninja"
|
||||
rev = "v1.13.1"
|
||||
|
||||
[build]
|
||||
template = "cmake"
|
||||
|
||||
[package]
|
||||
description = "Ninja build system"
|
||||
@@ -0,0 +1,29 @@
|
||||
[llvm]
|
||||
download-ci-llvm = false
|
||||
static-libstdcpp = false
|
||||
link-shared = true
|
||||
|
||||
[build]
|
||||
host = ["COOKBOOK_TARGET"]
|
||||
target = ["COOKBOOK_TARGET"]
|
||||
submodules = false
|
||||
docs = false
|
||||
tools = ["cargo", "clippy", "rustdoc", "rustfmt", "src"]
|
||||
extended = true
|
||||
verbose = 1
|
||||
|
||||
[install]
|
||||
prefix = "install"
|
||||
sysconfdir = "etc"
|
||||
|
||||
[rust]
|
||||
backtrace = false
|
||||
codegen-tests = false
|
||||
|
||||
[target.COOKBOOK_TARGET]
|
||||
cc = "COOKBOOK_GNU_TARGET-gcc"
|
||||
cxx = "COOKBOOK_GNU_TARGET-g++"
|
||||
ar = "COOKBOOK_GNU_TARGET-ar"
|
||||
linker = "COOKBOOK_GNU_TARGET-gcc"
|
||||
crt-static = false
|
||||
llvm-config = "COOKBOOK_SYSROOT/bin/llvm-config"
|
||||
@@ -0,0 +1,39 @@
|
||||
[source]
|
||||
same_as = "../../../../recipes/dev/rust"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"zlib",
|
||||
"curl",
|
||||
"openssl3",
|
||||
"llvm-native",
|
||||
"llvm-native.runtime",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
ARCH="${TARGET%%-*}"
|
||||
export CARGO_TARGET_${ARCH^^}_UNKNOWN_REDOX_RUSTFLAGS="${RUSTFLAGS}"
|
||||
cat "${COOKBOOK_ROOT}/bin/${TARGET}-llvm-config" > "${COOKBOOK_SYSROOT}/bin/llvm-config"
|
||||
export LD_LIBRARY_PATH="${COOKBOOK_HOST_SYSROOT}/lib:${LD_LIBRARY_PATH}"
|
||||
|
||||
cat ${COOKBOOK_RECIPE}/config.toml > config.toml
|
||||
sed -i "s|COOKBOOK_SYSROOT|${COOKBOOK_SYSROOT}|g" config.toml
|
||||
sed -i "s|COOKBOOK_TOOLCHAIN|${COOKBOOK_HOST_SYSROOT}|g" config.toml
|
||||
sed -i "s|COOKBOOK_TARGET|${TARGET}|g" config.toml
|
||||
sed -i "s|COOKBOOK_GNU_TARGET|${GNU_TARGET}|g" config.toml
|
||||
|
||||
unset AR AS CC CXX LD LDFLAGS NM OBJCOPY OBJDUMP RANLIB READELF RUSTFLAGS CARGO_ENCODED_RUSTFLAGS STRIP
|
||||
|
||||
python3 "${COOKBOOK_SOURCE}/x.py" install \
|
||||
--config config.toml \
|
||||
--jobs ${COOKBOOK_MAKE_JOBS}
|
||||
|
||||
mkdir -p "${COOKBOOK_STAGE}"/usr
|
||||
rsync -av --delete "${COOKBOOK_BUILD}"/install/* "${COOKBOOK_STAGE}"/usr/
|
||||
rm -rf "${COOKBOOK_STAGE}"/usr/lib/rustlib/*.log
|
||||
"""
|
||||
|
||||
[package]
|
||||
description = "Native Rust toolchain for Red Bear OS (rustc + cargo running on redox)"
|
||||
dependencies = ["llvm-native.runtime"]
|
||||
Reference in New Issue
Block a user