diff --git a/recipes/autoconf/recipe.sh b/recipes/autoconf/recipe.sh deleted file mode 100644 index 750349aa4d5eaa23fc8c302fc78268203d46c455..0000000000000000000000000000000000000000 --- a/recipes/autoconf/recipe.sh +++ /dev/null @@ -1,25 +0,0 @@ -VERSION=2.71 -TAR=https://ftp.gnu.org/gnu/autoconf/autoconf-$VERSION.tar.xz - -function recipe_version { - echo "$VERSION" - skip=1 -} - -function recipe_build { - wget -O build-aux/config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false" - ./configure --build=${BUILD} --host=${HOST} --prefix='' - "$REDOX_MAKE" -j"$($NPROC)" - skip=1 -} - -function recipe_clean { - "$REDOX_MAKE" clean - skip=1 -} - -function recipe_stage { - dest="$(realpath $1)" - "$REDOX_MAKE" DESTDIR="$dest" install - skip=1 -} diff --git a/recipes/autoconf/recipe.toml b/recipes/autoconf/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..a4f8df2f82ae959a4c76b964073b30700aedbe16 --- /dev/null +++ b/recipes/autoconf/recipe.toml @@ -0,0 +1,6 @@ +[source] +tar = "https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz" +blake3 = "da1cc8af8551c343de9f42af0ae53fd7dff3623487157623892b6cd7e3bb5692" + +[build] +template = "configure" diff --git a/recipes/automake/recipe.sh b/recipes/automake/recipe.sh deleted file mode 100644 index 22776f81a884e6ca43a64ae8b2dd58c5146bc08f..0000000000000000000000000000000000000000 --- a/recipes/automake/recipe.sh +++ /dev/null @@ -1,28 +0,0 @@ -VERSION=1.16.5 -TAR=https://ftp.gnu.org/gnu/automake/automake-$VERSION.tar.xz - -function recipe_version { - echo "$VERSION" - skip=1 -} - -function recipe_build { - wget -O lib/config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false" - sed -i 's|.*/doc/help2man.*|\&\& true|' Makefile.in - sed -i 's|install-info-am install-man|install-info-am|' Makefile.in - - ./configure --build=${BUILD} --host=${HOST} --prefix='' - "$REDOX_MAKE" -j"$($NPROC)" - skip=1 -} - -function recipe_clean { - "$REDOX_MAKE" clean - skip=1 -} - -function recipe_stage { - dest="$(realpath $1)" - "$REDOX_MAKE" DESTDIR="$dest" install - skip=1 -} diff --git a/recipes/automake/recipe.toml b/recipes/automake/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..c733beb953e441ef425502d0e449f7d0ed9a13c7 --- /dev/null +++ b/recipes/automake/recipe.toml @@ -0,0 +1,6 @@ +[source] +tar = "https://ftp.gnu.org/gnu/automake/automake-1.16.5.tar.xz" +blake3 = "f42cfc333aaaa11f2bcb05b5b0273b8706c820c22f9ba4367f7eb920551695cd" + +[build] +template = "configure" diff --git a/recipes/cosmic-text/recipe.sh b/recipes/cosmic-text/recipe.sh deleted file mode 100644 index 8d7d37ea5fc091c07f219890fa7c52e30f1ef842..0000000000000000000000000000000000000000 --- a/recipes/cosmic-text/recipe.sh +++ /dev/null @@ -1,17 +0,0 @@ -GIT=https://github.com/pop-os/cosmic-text.git -BRANCH=main - -function recipe_build { - sysroot="$(realpath ../sysroot)" - set -x - cargo build --target "$TARGET" --release --package editor-orbclient --features vi - set +x - skip=1 -} - -function recipe_stage { - dest="$(realpath $1)" - mkdir -pv "$dest/bin" - cp -v "target/${TARGET}/release/editor-orbclient" "$dest/bin/cosmic-text" - skip=1 -} diff --git a/recipes/cosmic-text/recipe.toml b/recipes/cosmic-text/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..32f0525b9d0d12842eafdd033cbbb0c4139ed4eb --- /dev/null +++ b/recipes/cosmic-text/recipe.toml @@ -0,0 +1,9 @@ +[source] +git = "https://github.com/pop-os/cosmic-text.git" +branch = "main" + +[build] +template = "custom" +script = """ +cookbook_cargo_packages editor-orbclient +""" diff --git a/recipes/cpal/recipe.sh b/recipes/cpal/recipe.sh deleted file mode 100644 index 2ffe7617c28fe1786555c0bb58d2054271758205..0000000000000000000000000000000000000000 --- a/recipes/cpal/recipe.sh +++ /dev/null @@ -1,11 +0,0 @@ -GIT=https://gitlab.redox-os.org/redox-os/cpal.git -GIT_UPSTREAM=https://github.com/tomaka/cpal.git -BRANCH=redox -CARGOFLAGS="--example beep" - -function recipe_stage { - dest="$(realpath $1)" - mkdir -pv "$dest/bin" - cp -v "target/${TARGET}/release/examples/beep" "$dest/bin/cpal" - skip=1 -} diff --git a/recipes/cpal/recipe.toml b/recipes/cpal/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..4ff3861b2593c53772370e8f2fe86c47e6979a35 --- /dev/null +++ b/recipes/cpal/recipe.toml @@ -0,0 +1,10 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/cpal.git" +branch = "redox" +upstream = "https://github.com/tomaka/cpal.git" + +[build] +template = "custom" +script = """ +cookbook_cargo_examples beep +""" diff --git a/recipes/orbclient/recipe.sh b/recipes/orbclient/recipe.sh deleted file mode 100644 index cdd0c9787211c500f7f642c9545be5902468cfe7..0000000000000000000000000000000000000000 --- a/recipes/orbclient/recipe.sh +++ /dev/null @@ -1,10 +0,0 @@ - -GIT=https://gitlab.redox-os.org/redox-os/orbclient.git -CARGOFLAGS="--example simple" - -function recipe_stage { - dest="$(realpath $1)" - mkdir -pv "$dest/bin" - cp -v "target/${TARGET}/release/examples/simple" "$dest/bin/orbclient" - skip=1 -} diff --git a/recipes/orbclient/recipe.toml b/recipes/orbclient/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..27f07e47b1c286e5141fe106eac686909d5eb664 --- /dev/null +++ b/recipes/orbclient/recipe.toml @@ -0,0 +1,8 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/orbclient.git" + +[build] +template = "custom" +script = """ +cookbook_cargo_examples simple +""" diff --git a/recipes/orbterm/recipe.toml b/recipes/orbterm/recipe.toml index e6e23e1555dff4df9a8ce5919d4ca00c4a53cc84..8692545822658c29c3b991d0d9146a2f5faec635 100644 --- a/recipes/orbterm/recipe.toml +++ b/recipes/orbterm/recipe.toml @@ -8,6 +8,7 @@ COOKBOOK_CARGO_FLAGS=( --path "${COOKBOOK_SOURCE}" --root "${COOKBOOK_STAGE}/ui" --locked + --no-track ) cookbook_cargo """ diff --git a/recipes/winit/recipe.sh b/recipes/winit/recipe.sh deleted file mode 100644 index 4ac8f27c68f4c6a2e4db88c81e46fe0d00ba2ac0..0000000000000000000000000000000000000000 --- a/recipes/winit/recipe.sh +++ /dev/null @@ -1,11 +0,0 @@ -GIT=https://gitlab.redox-os.org/redox-os/winit.git -GIT_UPSTREAM=https://github.com/rust-windowing/winit.git -BRANCH=redox-0.27 -CARGOFLAGS="--example window" - -function recipe_stage { - dest="$(realpath $1)" - mkdir -pv "$dest/bin" - cp -v "target/${TARGET}/release/examples/window" "$dest/bin/winit" - skip=1 -} diff --git a/recipes/winit/recipe.toml b/recipes/winit/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..818e6e835acab2358d90c0b0f52dae1e6fc85363 --- /dev/null +++ b/recipes/winit/recipe.toml @@ -0,0 +1,10 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/winit.git" +branch = "redox-0.27" +upstream = "https://github.com/rust-windowing/winit.git" + +[build] +template = "custom" +script = """ +cookbook_cargo_examples window +""" diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 5d36682da250a8a1957ea8f2c8a0ba36ba5f98fc..b055920b6f9799982c6523b9f5940e45d0d843a9 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -471,6 +471,38 @@ function cookbook_cargo { "${COOKBOOK_CARGO}" install "${COOKBOOK_CARGO_FLAGS[@]}" } +# helper for installing binaries that are cargo examples +function cookbook_cargo_examples { + recipe="$(basename "${COOKBOOK_RECIPE}")" + for example in "$@" + do + "${COOKBOOK_CARGO}" build \ + --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \ + --example "${example}" \ + --release + mkdir -pv "${COOKBOOK_STAGE}/bin" + cp -v \ + "target/${TARGET}/release/examples/${example}" \ + "${COOKBOOK_STAGE}/bin/${recipe}_${example}" + done +} + +# helper for installing binaries that are cargo packages +function cookbook_cargo_packages { + recipe="$(basename "${COOKBOOK_RECIPE}")" + for package in "$@" + do + "${COOKBOOK_CARGO}" build \ + --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \ + --package "${package}" \ + --release + mkdir -pv "${COOKBOOK_STAGE}/bin" + cp -v \ + "target/${TARGET}/release/${package}" \ + "${COOKBOOK_STAGE}/bin/${recipe}_${package}" + done +} + # configure template COOKBOOK_CONFIGURE="${COOKBOOK_SOURCE}/configure" COOKBOOK_CONFIGURE_FLAGS=(