mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-24 13:54:19 +08:00
Merge branch 'master' into allow_build_on_freebsd
This commit is contained in:
commit
dc0f56c2ad
9
config.sh
Executable file
9
config.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash -e
|
||||
|
||||
# Configuration
|
||||
export TARGET=x86_64-unknown-redox
|
||||
|
||||
# Automatic variables
|
||||
ROOT="$(cd `dirname "$0"` && pwd)"
|
||||
REPO="$ROOT/repo/$TARGET"
|
||||
export CC="$ROOT/libc-artifacts/gcc.sh"
|
||||
57
cook.sh
57
cook.sh
@ -1,19 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env bash -e
|
||||
|
||||
# Configuration
|
||||
export TARGET=x86_64-unknown-redox
|
||||
|
||||
# Automatic variables
|
||||
ROOT="$(cd `dirname "$0"` && pwd)"
|
||||
REPO="$ROOT/repo/$TARGET"
|
||||
export CC="$ROOT/libc-artifacts/gcc.sh"
|
||||
source config.sh
|
||||
|
||||
# Variables to be overriden by recipes
|
||||
export BINDIR=bin
|
||||
export CARGOFLAGS=
|
||||
|
||||
set -e
|
||||
|
||||
function usage {
|
||||
echo "cook.sh $1 <op>" >&2
|
||||
echo " dist" >&2
|
||||
@ -22,6 +14,8 @@ function usage {
|
||||
echo " clean" >&2
|
||||
echo " fetch" >&2
|
||||
echo " unfetch" >&2
|
||||
echo " prepare" >&2
|
||||
echo " unprepare" >&2
|
||||
echo " publish" >&2
|
||||
echo " unpublish" >&2
|
||||
echo " stage" >&2
|
||||
@ -40,7 +34,7 @@ function op {
|
||||
|
||||
case "$2" in
|
||||
dist)
|
||||
op $1 fetch
|
||||
op $1 prepare
|
||||
op $1 update
|
||||
op $1 build
|
||||
op $1 stage
|
||||
@ -49,7 +43,7 @@ function op {
|
||||
distclean)
|
||||
op $1 untar
|
||||
op $1 unstage
|
||||
op $1 unfetch
|
||||
op $1 unprepare
|
||||
;;
|
||||
fetch)
|
||||
if [ -n "$TAR" ]
|
||||
@ -64,9 +58,6 @@ function op {
|
||||
mkdir source
|
||||
tar xvf source.tar -C source --strip-components 1
|
||||
fi
|
||||
|
||||
rm -rf build
|
||||
cp -r source build
|
||||
elif [ -n "$GIT" ]
|
||||
then
|
||||
if [ ! -d source ]
|
||||
@ -79,19 +70,22 @@ function op {
|
||||
git submodule sync
|
||||
git submodule update --init --recursive
|
||||
popd > /dev/null
|
||||
|
||||
rm -rf build
|
||||
cp -r source build
|
||||
fi
|
||||
|
||||
;;
|
||||
unfetch)
|
||||
rm -rfv build source
|
||||
rm -rfv source
|
||||
if [ -n "$TAR" ]
|
||||
then
|
||||
rm -f source.tar
|
||||
fi
|
||||
;;
|
||||
prepare)
|
||||
rm -rf build
|
||||
cp -r source build
|
||||
;;
|
||||
unprepare)
|
||||
rm -rf build
|
||||
;;
|
||||
version)
|
||||
pushd build > /dev/null
|
||||
skip="0"
|
||||
@ -135,7 +129,7 @@ function op {
|
||||
fi
|
||||
if [ "$skip" -eq "0" ]
|
||||
then
|
||||
cp -r "$ROOT/Xargo.toml" "$ROOT/.cargo" "$ROOT/libc-artifacts" .
|
||||
cp -r "$ROOT/Xargo.toml" .
|
||||
xargo build --target "$TARGET" --release $CARGOFLAGS
|
||||
fi
|
||||
popd > /dev/null
|
||||
@ -149,7 +143,7 @@ function op {
|
||||
fi
|
||||
if [ "$skip" -eq "0" ]
|
||||
then
|
||||
cp -r "$ROOT/Xargo.toml" "$ROOT/.cargo" "$ROOT/libc-artifacts" .
|
||||
cp -r "$ROOT/Xargo.toml" .
|
||||
xargo test --no-run --target "$TARGET" --release $CARGOFLAGS
|
||||
fi
|
||||
popd > /dev/null
|
||||
@ -222,24 +216,7 @@ function op {
|
||||
|
||||
if [ -n "$1" ]
|
||||
then
|
||||
if [ "$1" = "repo" ]
|
||||
then
|
||||
if [ ! "$COOK_QUIET" = "1" ]
|
||||
then
|
||||
echo -e "\033[01;38;5;215mcook - repo\033[0m" >&2
|
||||
fi
|
||||
|
||||
echo "[packages]" > "$REPO/repo.toml"
|
||||
for toml in "$REPO/"*".toml"
|
||||
do
|
||||
package="$(basename "$toml" .toml)"
|
||||
if [ "$package" != "repo" ]
|
||||
then
|
||||
version="$(grep version "$toml" | cut -d '=' -f2-)"
|
||||
echo "$package =$version" >> "$REPO/repo.toml"
|
||||
fi
|
||||
done
|
||||
elif [ -d "$ROOT/recipes/$1" ]
|
||||
if [ -d "$ROOT/recipes/$1" ]
|
||||
then
|
||||
cd "$ROOT/recipes/$1"
|
||||
source recipe.sh
|
||||
|
||||
15
fetch.sh
Executable file
15
fetch.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash -e
|
||||
|
||||
source config.sh
|
||||
|
||||
if [ $# = 0 ]
|
||||
then
|
||||
recipes="$(ls -1 recipes)"
|
||||
else
|
||||
recipes="$@"
|
||||
fi
|
||||
|
||||
for recipe in $recipes
|
||||
do
|
||||
./cook.sh "$recipe" fetch
|
||||
done
|
||||
1
recipes/contain/recipe.sh
Normal file
1
recipes/contain/recipe.sh
Normal file
@ -0,0 +1 @@
|
||||
GIT=https://github.com/redox-os/contain.git
|
||||
@ -1,14 +0,0 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"ahcid",
|
||||
"alxd",
|
||||
"bgad",
|
||||
"e1000d",
|
||||
"nvmed",
|
||||
"pcid",
|
||||
"ps2d",
|
||||
"rtl8168d",
|
||||
"vboxd",
|
||||
"vesad",
|
||||
"xhcid"
|
||||
]
|
||||
@ -1,7 +1,12 @@
|
||||
GIT=https://github.com/redox-os/drivers
|
||||
GIT=https://github.com/redox-os/drivers.git
|
||||
CARGOFLAGS=--all
|
||||
BINDIR="/sbin"
|
||||
|
||||
function recipe_update {
|
||||
cp ../Cargo.toml ./
|
||||
function recipe_version {
|
||||
echo "0.1.1"
|
||||
return 1
|
||||
}
|
||||
|
||||
function recipe_stage {
|
||||
mkdir -pv "$1/etc"
|
||||
cp -v pcid.toml "$1/etc/pcid.toml"
|
||||
}
|
||||
|
||||
1
recipes/installer/recipe.sh
Normal file
1
recipes/installer/recipe.sh
Normal file
@ -0,0 +1 @@
|
||||
GIT=https://github.com/redox-os/installer.git
|
||||
1
recipes/netstack/recipe.sh
Normal file
1
recipes/netstack/recipe.sh
Normal file
@ -0,0 +1 @@
|
||||
GIT=https://github.com/redox-os/netstack.git
|
||||
@ -1,2 +1 @@
|
||||
GIT=https://github.com/redox-os/orbital.git
|
||||
BINDIR="/sbin"
|
||||
|
||||
1
recipes/ptyd/recipe.sh
Normal file
1
recipes/ptyd/recipe.sh
Normal file
@ -0,0 +1 @@
|
||||
GIT=https://github.com/redox-os/ptyd.git
|
||||
1
recipes/randd/recipe.sh
Normal file
1
recipes/randd/recipe.sh
Normal file
@ -0,0 +1 @@
|
||||
GIT=https://github.com/redox-os/randd.git
|
||||
1
recipes/redoxfs/recipe.sh
Normal file
1
recipes/redoxfs/recipe.sh
Normal file
@ -0,0 +1 @@
|
||||
GIT=https://github.com/redox-os/redoxfs.git
|
||||
71
repo.sh
Executable file
71
repo.sh
Executable file
@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash -e
|
||||
|
||||
source config.sh
|
||||
|
||||
if [ $# = 0 ]
|
||||
then
|
||||
recipes="$(ls -1 recipes)"
|
||||
else
|
||||
recipes="$@"
|
||||
fi
|
||||
|
||||
for recipe in $recipes
|
||||
do
|
||||
if [ ! -d "recipes/$recipe/source" ]
|
||||
then
|
||||
echo -e "\033[01;38;5;215mrepo - fetching $recipe\033[0m" >&2
|
||||
./cook.sh "$recipe" fetch
|
||||
fi
|
||||
|
||||
if [ ! -d "recipes/$recipe/build" ]
|
||||
then
|
||||
echo -e "\033[01;38;5;155mrepo - preparing $recipe\033[0m" >&2
|
||||
./cook.sh "$recipe" prepare
|
||||
else
|
||||
TIME_SOURCE="$(find recipes/$recipe/source -type f -not -path '*/.git*' -printf "%Ts\n" | sort -nr | head -n 1)"
|
||||
TIME_BUILD="$(find recipes/$recipe/build -type f -not -path '*/.git*' -printf "%Ts\n" | sort -nr | head -n 1)"
|
||||
if [ "$TIME_SOURCE" -gt "$TIME_BUILD" ]
|
||||
then
|
||||
echo -e "\033[01;38;5;155mrepo - repreparing $recipe\033[0m" >&2
|
||||
./cook.sh "$recipe" unprepare prepare
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f "recipes/$recipe/stage.tar" ]
|
||||
then
|
||||
echo -e "\033[01;38;5;155mrepo - building $recipe\033[0m" >&2
|
||||
./cook.sh "$recipe" update build stage tar
|
||||
else
|
||||
TIME_BUILD="$(find recipes/$recipe/build -type f -not -path '*/.git*' -printf "%Ts\n" | sort -nr | head -n 1)"
|
||||
TIME_STAGE="$(stat -c "%Y" recipes/$recipe/stage.tar)"
|
||||
if [ "$TIME_BUILD" -gt "$TIME_STAGE" ]
|
||||
then
|
||||
echo -e "\033[01;38;5;155mrepo - rebuilding $recipe\033[0m" >&2
|
||||
./cook.sh "$recipe" untar unstage update build stage tar
|
||||
else
|
||||
echo -e "\033[01;38;5;155mrepo - $recipe up to date\033[0m" >&2
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
for recipe in $recipes
|
||||
do
|
||||
if [ "recipes/$recipe/stage.tar" -nt "$REPO/$recipe.tar" ]
|
||||
then
|
||||
echo -e "\033[01;38;5;155mrepo - publishing $recipe\033[0m" >&2
|
||||
./cook.sh $recipe publish
|
||||
fi
|
||||
done
|
||||
|
||||
echo -e "\033[01;38;5;155mrepo - generating repo.toml\033[0m" >&2
|
||||
|
||||
echo "[packages]" > "$REPO/repo.toml"
|
||||
for toml in "$REPO/"*".toml"
|
||||
do
|
||||
package="$(basename "$toml" .toml)"
|
||||
if [ "$package" != "repo" ]
|
||||
then
|
||||
version="$(grep version "$toml" | cut -d '=' -f2-)"
|
||||
echo "$package =$version" >> "$REPO/repo.toml"
|
||||
fi
|
||||
done
|
||||
@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ $# = 0 ]
|
||||
then
|
||||
recipes=$(ls -1 recipes)
|
||||
else
|
||||
recipes=$@
|
||||
fi
|
||||
|
||||
publish=""
|
||||
for recipe in $recipes
|
||||
do
|
||||
if [ ! -f "recipes/$recipe/stage.tar" ]
|
||||
then
|
||||
echo "$recipe: building..."
|
||||
./cook.sh $recipe dist
|
||||
publish="${publish} $recipe"
|
||||
else
|
||||
oldver=$(COOK_QUIET=1 ./cook.sh $recipe gitversion)
|
||||
./cook.sh $recipe fetch
|
||||
newver=$(COOK_QUIET=1 ./cook.sh $recipe gitversion)
|
||||
if [ "$oldver" = "$newver" ]
|
||||
then
|
||||
echo "$recipe: up to date (version $newver)."
|
||||
else
|
||||
echo "$recipe: updating $oldver -> $newver..."
|
||||
./cook.sh $recipe unstage untar dist
|
||||
publish="${publish} $recipe"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
for recipe in $publish
|
||||
do
|
||||
./cook.sh $recipe publish
|
||||
done
|
||||
|
||||
./cook.sh repo
|
||||
Loading…
Reference in New Issue
Block a user