mirror of
https://github.com/ivabus/pantry
synced 2024-11-23 08:55:07 +03:00
+rust-lang.org/cargo
This commit is contained in:
parent
b696981301
commit
1b2738fbf2
2 changed files with 78 additions and 14 deletions
54
projects/rust-lang.org/cargo/package.yml
Normal file
54
projects/rust-lang.org/cargo/package.yml
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
distributable:
|
||||||
|
url: https://github.com/rust-lang/cargo/archive/refs/tags/{{version}}.tar.gz
|
||||||
|
strip-components: 1
|
||||||
|
|
||||||
|
versions:
|
||||||
|
github: rust-lang/cargo/tags
|
||||||
|
|
||||||
|
provides:
|
||||||
|
- bin/cargo
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
git-scm.org: 2
|
||||||
|
rust-lang.org: '*'
|
||||||
|
openssl.org: ^1 # cargo needs the certs
|
||||||
|
|
||||||
|
build:
|
||||||
|
dependencies:
|
||||||
|
gnu.org/tar: '*'
|
||||||
|
tukaani.org/xz: '*'
|
||||||
|
freedesktop.org/pkg-config: ^0.29
|
||||||
|
script: |-
|
||||||
|
case "{{hw.platform}}-{{hw.arch}}" in
|
||||||
|
darwin-aarch64)
|
||||||
|
TRIPLE=aarch64-apple-darwin
|
||||||
|
;;
|
||||||
|
darwin-x86-64)
|
||||||
|
TRIPLE=x86_64-apple-darwin
|
||||||
|
;;
|
||||||
|
linux-aarch64)
|
||||||
|
TRIPLE=aarch64-unknown-linux-gnu
|
||||||
|
;;
|
||||||
|
linux-x86-64)
|
||||||
|
TRIPLE=x86_64-unknown-linux-gnu
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# cargo requires cargo to cargo
|
||||||
|
# FIXME: versions?
|
||||||
|
curl https://static.rust-lang.org/dist/2022-08-11/cargo-1.63.0-$TRIPLE.tar.xz | tar Jxf -
|
||||||
|
|
||||||
|
./cargo-1.63.0-$TRIPLE/cargo/bin/cargo $ARGS
|
||||||
|
env:
|
||||||
|
ARGS:
|
||||||
|
- install
|
||||||
|
- --root={{ prefix }}
|
||||||
|
- --path=.
|
||||||
|
|
||||||
|
test:
|
||||||
|
script: |
|
||||||
|
cargo init .
|
||||||
|
echo 'fn main() {println!("Hello World!");}' >src/main.rs
|
||||||
|
cargo clippy
|
||||||
|
cargo run
|
||||||
|
cargo run --release
|
|
@ -6,20 +6,23 @@ versions:
|
||||||
github: rust-lang/rust
|
github: rust-lang/rust
|
||||||
strip: /^Rust /
|
strip: /^Rust /
|
||||||
|
|
||||||
# TODO cargo should be a separate package (probs)
|
|
||||||
# NOTE that it does have independent versioning
|
|
||||||
# TODO we should disable rust-up etc. if you want that, install rust with rust-up!
|
# TODO we should disable rust-up etc. if you want that, install rust with rust-up!
|
||||||
|
|
||||||
provides:
|
provides:
|
||||||
- bin/cargo
|
- bin/cargo-clippy
|
||||||
- bin/rustc
|
- bin/cargo-fmt
|
||||||
- bin/rustdoc
|
- bin/clippy-driver
|
||||||
- bin/rust-lldb
|
- bin/rls
|
||||||
|
- bin/rust-analyzer
|
||||||
- bin/rust-gdb
|
- bin/rust-gdb
|
||||||
- bin/rust-gdbgui
|
- bin/rust-gdbgui
|
||||||
|
- bin/rust-lldb
|
||||||
|
- bin/rustc
|
||||||
|
- bin/rustdoc
|
||||||
|
- bin/rustfmt
|
||||||
|
|
||||||
|
# FIXME: unused?
|
||||||
options:
|
options:
|
||||||
- cargo # the rust package manager
|
|
||||||
- rls
|
- rls
|
||||||
- clippy
|
- clippy
|
||||||
- rustfmt
|
- rustfmt
|
||||||
|
@ -30,18 +33,15 @@ dependencies:
|
||||||
#FIXME strictly rustc only needs a linker
|
#FIXME strictly rustc only needs a linker
|
||||||
tea.xyz/gx/cc: c99
|
tea.xyz/gx/cc: c99
|
||||||
zlib.net: 1
|
zlib.net: 1
|
||||||
#TODO cargo needs git
|
|
||||||
# this is a usage dependency, it's not required for cargo to run, just for some usages of cargo to run
|
|
||||||
# so would be a little more strict than “recommended“
|
|
||||||
#git-scm.com: 2
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
dependencies:
|
dependencies:
|
||||||
tea.xyz/gx/make: '*' #FIXME surely we don’t need make AND ninja
|
tea.xyz/gx/make: '*' #FIXME surely we don’t need make AND ninja
|
||||||
cmake.org: ^3.20
|
cmake.org: ^3.20
|
||||||
ninja-build.org: ^1.10
|
ninja-build.org: ^1.10
|
||||||
curl.se: '*'
|
|
||||||
python.org: 3
|
python.org: 3
|
||||||
|
openssl.org: '*' # needed to build openssl-sys
|
||||||
|
freedesktop.org/pkg-config: ^0.29
|
||||||
script: |-
|
script: |-
|
||||||
# --enable-optimize not available as of 1.63.0
|
# --enable-optimize not available as of 1.63.0
|
||||||
if test {{version.major}} -eq 1 -a {{version.minor}} -lt 63; then
|
if test {{version.major}} -eq 1 -a {{version.minor}} -lt 63; then
|
||||||
|
@ -50,15 +50,25 @@ build:
|
||||||
|
|
||||||
./configure $ARGS
|
./configure $ARGS
|
||||||
make install
|
make install
|
||||||
mv ./build/{{ hw.target }}/stage0/bin/cargo {{ prefix }}/bin/cargo
|
|
||||||
|
for tool in $tools; do
|
||||||
|
./x.py install $tool
|
||||||
|
done
|
||||||
|
|
||||||
rm -rf {{prefix}}/share/doc
|
rm -rf {{prefix}}/share/doc
|
||||||
#TODO ^^ build cargo properly
|
|
||||||
env:
|
env:
|
||||||
ARGS:
|
ARGS:
|
||||||
- --enable-vendor
|
- --enable-vendor
|
||||||
- --prefix={{ prefix }}
|
- --prefix={{ prefix }}
|
||||||
- --enable-ninja
|
- --enable-ninja
|
||||||
- --disable-docs # docs are online
|
- --disable-docs # docs are online
|
||||||
|
- --tools=rls,clippy,rustfmt,analysis
|
||||||
|
tools:
|
||||||
|
- rls # deprecated for rust-analyzer some time ago -- remove eventually
|
||||||
|
- clippy
|
||||||
|
- rustfmt
|
||||||
|
- rust-analyzer
|
||||||
|
|
||||||
test:
|
test:
|
||||||
script: |
|
script: |
|
||||||
rustc $FIXTURE -o hello
|
rustc $FIXTURE -o hello
|
||||||
|
|
Loading…
Reference in a new issue