catchup with lots of updates
[buildscripts] / rust
1 #!/bin/bash
2 # Copyright (C) 2019 Ian Kelling
3 # SPDX-License-Identifier: AGPL-3.0-or-later
4
5 # alternatively, using https://iankelling.org/git/?p=errhandle;a=tree
6 # source /path/errhandle/err
7 # on my machine
8 source /a/bin/errhandle/err
9 source /a/bin/distro-functions/src/package-manager-abstractions
10
11 PATH="$PATH:$HOME/.cargo/bin"
12 hash -r
13
14 # todo: this should happen in some kind of sandbox or vm
15
16 # install rust.
17 if type -t rustc &>/dev/null; then
18 rustup update
19 else
20 curl https://sh.rustup.rs -sSf | bash -s -- -y
21 fi
22
23 if ! which rg &>/dev/null; then
24 cargo install ripgrep
25 fi
26
27 if ! type -t cargo-install-update &>/dev/null; then
28 # due to
29 # error: failed to run custom build command for `openssl-sys v0.9.53`
30 pi libssl-dev pkg-config
31 cargo install cargo-update
32 fi
33
34 cargo install-update -a