diff --git a/.gitignore b/.gitignore index 64dda0f6597b2e659f7ea46b26096dca6ce329e3..22481bbf1962ebfbe8ae506ae794994591161f87 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ stage.sig stage.tar stage.tar.gz stage.toml +sysroot xargo diff --git a/cook.sh b/cook.sh index 9d11a95b9c83978f8e29839d06798f55da545e53..4a9ab7831bcd39d7b4292cc4a86ede43b86141e0 100755 --- a/cook.sh +++ b/cook.sh @@ -95,6 +95,21 @@ function op { fi ;; prepare) + rm -rf sysroot + mkdir sysroot + + if [ ${#BUILD_DEPENDS} -gt 0 ] + then + pushd $ROOT + ./repo.sh ${BUILD_DEPENDS} + popd + + for i in "${BUILD_DEPENDS[@]}" + do + CC=cc cargo run --release --manifest-path "$ROOT/pkgutils/Cargo.toml" --bin pkg -- --target=$TARGET install --root sysroot "$REPO/$i.tar.gz" + done + fi + rm -rf build cp -r source build @@ -105,6 +120,7 @@ function op { ;; unprepare) rm -rf build + rm -rf sysroot ;; version) pushd build > /dev/null diff --git a/pkgutils b/pkgutils index c7a89531e1a788a8e5a96f12c8949f9a2a8e9bdb..96a6b2d9fe30d054ef754e6cc3bf88ff60e40199 160000 --- a/pkgutils +++ b/pkgutils @@ -1 +1 @@ -Subproject commit c7a89531e1a788a8e5a96f12c8949f9a2a8e9bdb +Subproject commit 96a6b2d9fe30d054ef754e6cc3bf88ff60e40199 diff --git a/recipes/cargo/recipe.sh b/recipes/cargo/recipe.sh index 835267931c250bd7a8bf68930700aa7b947a62f2..dad63c3bc4c284777d979027a88c97aa5dccb2dc 100644 --- a/recipes/cargo/recipe.sh +++ b/recipes/cargo/recipe.sh @@ -1,22 +1,7 @@ GIT=https://github.com/ids1024/cargo.git BRANCH=redox +BUILD_DEPENDS=(openssl) function recipe_build { - if [ -d openssl-redox ] - then - git -C openssl-redox pull - else - git clone https://github.com/ids1024/openssl.git -b redox --depth 1 openssl-redox - fi - - rm -rf openssl-prefix - mkdir openssl-prefix - - pushd openssl-redox - ./Configure no-shared no-dgram redox-x86_64 --prefix="/" - make -j"$(nproc)" - make DESTDIR="$PWD/../openssl-prefix" install - popd - - export OPENSSL_DIR=$PWD/openssl-prefix + export OPENSSL_DIR="$PWD/../sysroot" } diff --git a/recipes/curl/recipe.sh b/recipes/curl/recipe.sh index ad96990c21d13e1636edaca06a6a4452325e81e6..80ef01b77c1de11f93f8fbbfa507151a3eb797ce 100644 --- a/recipes/curl/recipe.sh +++ b/recipes/curl/recipe.sh @@ -1,5 +1,6 @@ GIT=https://github.com/ids1024/curl.git BRANCH=redox +BUILD_DEPENDS=(openssl) HOST=x86_64-elf-redox @@ -14,27 +15,8 @@ function recipe_update { } function recipe_build { - if [ -d openssl-redox ] - then - git -C openssl-redox pull - else - git clone https://github.com/ids1024/openssl.git -b redox --depth 1 openssl-redox - fi - - rm -rf openssl-prefix - mkdir openssl-prefix - - pushd openssl-redox - ./Configure no-shared no-dgram redox-x86_64 --prefix="/" - make -j"$(nproc)" - make DESTDIR="$PWD/../openssl-prefix" install - popd - - rm -rf openssl-prefix/lib/pkgconfig # pkg-config returns paths based on / prefix, breaking cross compile - - ./configure --prefix=/ --host=${HOST} --disable-tftp --disable-ftp --disable-ntlm-wb --with-ssl="$PWD/openssl-prefix" --with-ca-path=/ssl/certs + ./configure --prefix=/ --host=${HOST} --disable-tftp --disable-ftp --disable-ntlm-wb --with-ssl="$PWD/../sysroot" --with-ca-path=/ssl/certs make - skip=1 } diff --git a/recipes/dash/recipe.sh b/recipes/dash/recipe.sh index 27c87435fe0111cdd707df66d45a51d5e299f135..26c147b787efd89811549f835e9286caa4fc20dc 100644 --- a/recipes/dash/recipe.sh +++ b/recipes/dash/recipe.sh @@ -44,7 +44,6 @@ function recipe_clean { function recipe_stage { dest="$(realpath $1)" make DESTDIR="$dest" install - echo -e '#!/bin/ion\ndash @args[1..]' > "$1/bin/sh" - chmod a+x "$1/bin/sh" + ln -s "dash" "$1/bin/sh" skip=1 } diff --git a/recipes/gcc/recipe.sh b/recipes/gcc/recipe.sh index a27002e6d73bdcfe96e7673f3c9297a183f86769..fecb8472853cd8e15e01b4255f39adf934ed57b2 100644 --- a/recipes/gcc/recipe.sh +++ b/recipes/gcc/recipe.sh @@ -53,7 +53,6 @@ function recipe_stage { dest="$(realpath $1)" make DESTDIR="$dest" install-gcc install-target-libgcc find "$dest"/{bin,libexec} -exec x86_64-elf-redox-strip {} ';' 2> /dev/null - echo -e '#!/bin/ion\ngcc @args[1..]' > "$1/bin/cc" - chmod a+x "$1/bin/cc" + ln -s "gcc" "$1/bin/cc" skip=1 } diff --git a/recipes/openssl/recipe.sh b/recipes/openssl/recipe.sh new file mode 100644 index 0000000000000000000000000000000000000000..48559cac75479e8587133ab0a3c59deda42aa4a6 --- /dev/null +++ b/recipes/openssl/recipe.sh @@ -0,0 +1,38 @@ +GIT=https://github.com/ids1024/openssl.git +BRANCH=redox + +HOST=x86_64-elf-redox + +function recipe_version { + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + skip=1 +} + +function recipe_update { + echo "skipping update" + skip=1 +} + +function recipe_build { + ./Configure no-shared no-dgram redox-x86_64 --prefix="/" + make -j"$(nproc)" + skip=1 +} + +function recipe_test { + echo "skipping test" + skip=1 +} + +function recipe_clean { + make clean + skip=1 +} + +function recipe_stage { + dest="$(realpath $1)" + make DESTDIR="$dest" install + rm -rf "$1/lib/pkgconfig" # pkg-config returns paths based on / prefix, breaking cross compile + rm -rf "$1/{share,ssl}" + skip=1 +}