Convert some recipes to toml

This commit is contained in:
Jeremy Soller 2023-05-18 12:49:23 -06:00
parent 5ee7d682f1
commit 60bf37dd0c
No known key found for this signature in database
GPG Key ID: DCFCA852D3906975
14 changed files with 82 additions and 102 deletions

View File

@ -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
}

View File

@ -0,0 +1,6 @@
[source]
tar = "https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz"
blake3 = "da1cc8af8551c343de9f42af0ae53fd7dff3623487157623892b6cd7e3bb5692"
[build]
template = "configure"

View File

@ -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
}

View File

@ -0,0 +1,6 @@
[source]
tar = "https://ftp.gnu.org/gnu/automake/automake-1.16.5.tar.xz"
blake3 = "f42cfc333aaaa11f2bcb05b5b0273b8706c820c22f9ba4367f7eb920551695cd"
[build]
template = "configure"

View File

@ -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
}

View File

@ -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
"""

View File

@ -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
}

10
recipes/cpal/recipe.toml Normal file
View File

@ -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
"""

View File

@ -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
}

View File

@ -0,0 +1,8 @@
[source]
git = "https://gitlab.redox-os.org/redox-os/orbclient.git"
[build]
template = "custom"
script = """
cookbook_cargo_examples simple
"""

View File

@ -8,6 +8,7 @@ COOKBOOK_CARGO_FLAGS=(
--path "${COOKBOOK_SOURCE}"
--root "${COOKBOOK_STAGE}/ui"
--locked
--no-track
)
cookbook_cargo
"""

View File

@ -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
}

10
recipes/winit/recipe.toml Normal file
View File

@ -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
"""

View File

@ -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=(