Simplify cargo recipes

This commit is contained in:
Jeremy Soller 2023-05-18 13:17:46 -06:00
parent 60bf37dd0c
commit 7cb4b95b03
No known key found for this signature in database
GPG Key ID: DCFCA852D3906975
8 changed files with 18 additions and 69 deletions

View File

@ -4,8 +4,5 @@ git = "https://gitlab.redox-os.org/redox-os/findutils.git"
[build]
template = "custom"
script = """
COOKBOOK_CARGO_FLAGS+=(
--bin find
)
cookbook_cargo
cookbook_cargo --bin find
"""

View File

@ -5,17 +5,5 @@ branch = "redox"
[build]
template = "custom"
script = """
EXAMPLES=(
styling
)
set -x
for example in "${EXAMPLES[@]}"
do
${COOKBOOK_CARGO} build \
--release \
--manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
--package "${example}"
mkdir -pv "${COOKBOOK_STAGE}/bin"
cp -v "target/${TARGET}/release/${example}" "${COOKBOOK_STAGE}/bin/iced_${example}"
done
cookbook_cargo_packages styling
"""

View File

@ -5,11 +5,5 @@ branch = "redox"
[build]
template = "custom"
script = """
set -x
${COOKBOOK_CARGO} build \
--release \
--manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
--package cosmic
mkdir -pv "${COOKBOOK_STAGE}/bin"
cp -v "target/${TARGET}/release/cosmic" "${COOKBOOK_STAGE}/bin/libcosmic"
cookbook_cargo_packages cosmic
"""

View File

@ -4,12 +4,7 @@ git = "https://gitlab.redox-os.org/redox-os/orbterm.git"
[build]
template = "custom"
script = """
COOKBOOK_CARGO_FLAGS=(
--path "${COOKBOOK_SOURCE}"
--root "${COOKBOOK_STAGE}/ui"
--locked
--no-track
)
COOKBOOK_STAGE="${COOKBOOK_STAGE}/ui"
cookbook_cargo
"""

View File

@ -4,28 +4,12 @@ git = "https://gitlab.redox-os.org/redox-os/orbutils.git"
[build]
template = "custom"
script = """
COOKBOOK_CARGO_FLAGS=(
--path "${COOKBOOK_SOURCE}/orbutils"
--root "${COOKBOOK_STAGE}/ui"
--locked
--no-track
)
COOKBOOK_STAGE="${COOKBOOK_STAGE}/ui"
ORIGINAL_SOURCE="${COOKBOOK_SOURCE}"
COOKBOOK_SOURCE="${ORIGINAL_SOURCE}/orbutils"
cookbook_cargo
COOKBOOK_CARGO_FLAGS=(
--path "${COOKBOOK_SOURCE}/calculator"
--root "${COOKBOOK_STAGE}/ui"
--locked
--no-track
)
COOKBOOK_SOURCE="${ORIGINAL_SOURCE}/calculator"
cookbook_cargo
"""
[package]
dependencies = [
"orbital",
"expat",
"fontconfig",
"freetype",
"libpng",
"zlib",
]

View File

@ -4,9 +4,6 @@ git = "https://gitlab.redox-os.org/redox-os/redoxer.git"
[build]
template = "custom"
script = """
COOKBOOK_CARGO_FLAGS=(
--path "${COOKBOOK_SOURCE}/daemon"
--root "${COOKBOOK_STAGE}"
)
COOKBOOK_SOURCE="${COOKBOOK_SOURCE}/daemon"
cookbook_cargo
"""

View File

@ -5,12 +5,7 @@ branch = "redox"
[build]
template = "custom"
script = """
COOKBOOK_CARGO_FLAGS+=(
--no-default-features
--features feat_os_unix_redox
--bin coreutils
)
cookbook_cargo
cookbook_cargo --no-default-features --features feat_os_unix_redox --bin coreutils
BINS=(
base32

View File

@ -461,14 +461,13 @@ export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
# cargo template
COOKBOOK_CARGO="${COOKBOOK_REDOXER}"
COOKBOOK_CARGO_FLAGS=(
--path "${COOKBOOK_SOURCE}"
--root "${COOKBOOK_STAGE}"
--locked
--no-track
)
function cookbook_cargo {
"${COOKBOOK_CARGO}" install "${COOKBOOK_CARGO_FLAGS[@]}"
"${COOKBOOK_CARGO}" install \
--path "${COOKBOOK_SOURCE}" \
--root "${COOKBOOK_STAGE}" \
--locked \
--no-track \
"$@"
}
# helper for installing binaries that are cargo examples