Migrate glutin to new recipe format

This commit is contained in:
Jeremy Soller 2022-12-08 09:15:15 -07:00
parent 5df67123ce
commit 7d31150e21
No known key found for this signature in database
GPG Key ID: 87F211AF2BE4C2FE
2 changed files with 32 additions and 22 deletions

View File

@ -1,22 +0,0 @@
GIT=https://gitlab.redox-os.org/redox-os/glutin.git
GIT_UPSTREAM=https://github.com/rust-windowing/glutin.git
BUILD_DEPENDS=(llvm mesa zlib)
BRANCH=redox-0.29
function recipe_build {
sysroot="$(realpath ../sysroot)"
set -x
cargo rustc --target "$TARGET" --release --package glutin_examples --example window \
-- \
-L "${sysroot}/lib" \
-C link-args="-Wl,-Bstatic $("${PKG_CONFIG}" --libs osmesa) -lz -lstdc++ -lc -lgcc"
set +x
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
mkdir -pv "$dest/bin"
cp -v "target/${TARGET}/release/examples/window" "$dest/bin/glutin"
skip=1
}

View File

@ -0,0 +1,32 @@
[source]
git = "https://gitlab.redox-os.org/redox-os/glutin.git"
branch = "redox-0.29"
upstream = "https://github.com/rust-windowing/glutin.git"
[build]
template = "custom"
dependencies = [
"llvm",
"mesa",
"zlib"
]
script = """
EXAMPLES=(
multiwindow
transparent
window
)
for example in "${EXAMPLES[@]}"
do
cargo rustc \
--target "$TARGET" \
--release \
--manifest-path "${COOKBOOK_SOURCE}/glutin_examples/Cargo.toml" \
--example "${example}" \
-- \
-L "${COOKBOK_SYSROOT}/lib" \
-C link-args="-Wl,-Bstatic $("${TARGET}-pkg-config" --libs osmesa) -lz -lstdc++ -lc -lgcc"
mkdir -pv "${COOKBOOK_STAGE}/bin"
cp -v "target/${TARGET}/release/examples/${example}" "${COOKBOOK_STAGE}/bin/glutin_${example}"
done
"""