diff --git a/cook.sh b/cook.sh index e5ce05430b9489616b5e9d74e2bdd1f93397a623..9db13abc768e0e6a53aacf8e4e09ec709777f693 100755 --- a/cook.sh +++ b/cook.sh @@ -46,36 +46,67 @@ function op { ;; update) pushd build > /dev/null - xargo update + skip="0" + if [ "$(type -t recipe_update)" = "function" ] + then + recipe_update || skip="1" + fi + if [ "$skip" -eq "0" ] + then + xargo update + fi popd > /dev/null ;; build) pushd build > /dev/null - cp -r "$ROOT/Xargo.toml" "$ROOT/.cargo" "$ROOT/libc-artifacts" . - xargo build --target "$TARGET" --release $CARGOFLAGS + skip="0" + if [ "$(type -t recipe_build)" = "function" ] + then + recipe_build || skip="1" + fi + if [ "$skip" -eq "0" ] + then + cp -r "$ROOT/Xargo.toml" "$ROOT/.cargo" "$ROOT/libc-artifacts" . + xargo build --target "$TARGET" --release $CARGOFLAGS + fi popd > /dev/null ;; test) pushd build > /dev/null - cp -r "$ROOT/Xargo.toml" "$ROOT/.cargo" "$ROOT/libc-artifacts" . - xargo test --no-run --target "$TARGET" --release $CARGOFLAGS + skip="0" + if [ "$(type -t recipe_test)" = "function" ] + then + recipe_test || skip="1" + fi + if [ "$skip" -eq "0" ] + then + cp -r "$ROOT/Xargo.toml" "$ROOT/.cargo" "$ROOT/libc-artifacts" . + xargo test --no-run --target "$TARGET" --release $CARGOFLAGS + fi popd > /dev/null ;; clean) pushd build > /dev/null - xargo clean + skip="0" + if [ "$(type -t recipe_clean)" = "function" ] + then + recipe_clean || skip="1" + fi + if [ "$skip" -eq "0" ] + then + xargo clean + fi popd > /dev/null ;; stage) mkdir -p stage pushd build > /dev/null - skip_bins="0" + skip="0" if [ "$(type -t recipe_stage)" = "function" ] then - recipe_stage ../stage - skip_bins="$?" + recipe_stage ../stage || skip="1" fi - if [ "$skip_bins" -eq "0" ] + if [ "$skip" -eq "0" ] then #TODO xargo install --root "../stage" $CARGOFLAGS bins="$(find target/$TARGET/release/ -maxdepth 1 -type f ! -name '*.*')" diff --git a/recipes/orbdata/recipe.sh b/recipes/orbdata/recipe.sh new file mode 100644 index 0000000000000000000000000000000000000000..e7ecb8412fdb241bafc2edaad357ec62f78ff129 --- /dev/null +++ b/recipes/orbdata/recipe.sh @@ -0,0 +1,27 @@ +GIT=https://github.com/redox-os/orbdata.git + +function recipe_update { + echo "skipping update" + return 1 +} + +function recipe_build { + echo "skipping build" + return 1 +} + +function recipe_test { + echo "skipping test" + return 1 +} + +function recipe_clean { + echo "skipping clean" + return 1 +} + +function recipe_stage { + mkdir -pv "$1/ui" + cp -Rv ./* "$1/ui" + return 1 +} diff --git a/recipes/orbutils/recipe.sh b/recipes/orbutils/recipe.sh index f8bc489a59038ffb04b691756962f5a27b8b4948..e049cafdce052b8ca2d06428c88384db3821541a 100644 --- a/recipes/orbutils/recipe.sh +++ b/recipes/orbutils/recipe.sh @@ -1,6 +1,2 @@ GIT=https://github.com/redox-os/orbutils.git BINDIR=/ui/bin - -function recipe_stage { - cp -Rv ui "$1/ui" -}