Mercurial > dotfiles
comparison .chezmoiscripts/run_onchange_after_22-install-devtools.sh.tmpl @ 1093:9732db099471 draft
feat: enable dotfiles on aarch64/Fedora
author | "Zeger Van de Vannet <zeger@vandevan.net>" |
---|---|
date | Sun, 18 May 2025 16:28:58 +0200 |
parents | 6ab26ddbf78d |
children |
comparison
equal
deleted
inserted
replaced
1092:6fb43864241b | 1093:9732db099471 |
---|---|
1 {{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu" )) -}} | 1 {{ if (and (eq .chezmoi.os "linux") (or (eq .chezmoi.osRelease.name "Ubuntu" ) (eq .chezmoi.osRelease.name "Fedora Linux Asahi Remix" ))) -}} |
2 #!/usr/bin/env bash | |
2 {{ $packages := dict | 3 {{ $packages := dict |
3 "fd" (dict "version" "9.0.0" "url" "https://github.com/sharkdp/fd/releases/download/v${VERSION}/fd-v${VERSION}-i686-unknown-linux-musl.tar.gz") | 4 "fd" (dict "version" "10.2.0" "url" "https://github.com/sharkdp/fd/releases/download/v${VERSION}/fd-v${VERSION}-${PKG_ARCH}-unknown-linux-${PKG_LIBC}.tar.gz" "arch" ((eq .chezmoi.arch "arm64") | ternary "aarch64" "i686") ) |
4 "rg" (dict "version" "14.0.3" "url" "https://github.com/BurntSushi/ripgrep/releases/download/${VERSION}/ripgrep-${VERSION}-x86_64-unknown-linux-musl.tar.gz") | 5 "rg" (dict "version" "14.1.1" "url" "https://github.com/BurntSushi/ripgrep/releases/download/${VERSION}/ripgrep-${VERSION}-${PKG_ARCH}-unknown-linux-${PKG_LIBC}.tar.gz" "arch" ((eq .chezmoi.arch "arm64") | ternary "aarch64" "x86_64") ) |
5 "delta" (dict "version" "0.16.5" "url" "https://github.com/dandavison/delta/releases/download/${VERSION}/delta-${VERSION}-x86_64-unknown-linux-musl.tar.gz") | 6 "hyperfine" (dict "version" "1.19.0" "url" "https://github.com/sharkdp/hyperfine/releases/download/v${VERSION}/hyperfine-v${VERSION}-${PKG_ARCH}-unknown-linux-${PKG_LIBC}.tar.gz" "arch" ((eq .chezmoi.arch "arm64") | ternary "aarch64" "x86_64") ) -}} |
6 "hyperfine" (dict "version" "1.18.0" "url" "https://github.com/sharkdp/hyperfine/releases/download/v${VERSION}/hyperfine-v${VERSION}-x86_64-unknown-linux-musl.tar.gz") -}} | |
7 #!/usr/bin/env bash | |
8 | 7 |
9 set -xe | 8 set -xe |
10 | 9 |
11 DOWNLOAD_DIR=${TMPDIR:-/tmp}/devtools | 10 DOWNLOAD_DIR=${TMPDIR:-/tmp}/devtools |
12 INSTALL_DIR=$HOME/bin | 11 INSTALL_DIR=$HOME/bin |
15 mkdir -p $MANPAGE_DIR | 14 mkdir -p $MANPAGE_DIR |
16 | 15 |
17 mkdir -p $DOWNLOAD_DIR | 16 mkdir -p $DOWNLOAD_DIR |
18 pushd $DOWNLOAD_DIR | 17 pushd $DOWNLOAD_DIR |
19 | 18 |
19 {{ if (eq .chezmoi.arch "arm64") -}} | |
20 PKG_LIBC="gnu" | |
21 {{ else -}} | |
22 PKG_LIBC="musl" | |
23 {{ end }} | |
20 {{ range keys $packages | sortAlpha }} | 24 {{ range keys $packages | sortAlpha }} |
21 {{ $meta := get $packages . -}} | 25 {{ $meta := get $packages . -}} |
22 VERSION={{ get $meta "version" }} | 26 VERSION={{ get $meta "version" }} |
27 PKG_ARCH={{ get $meta "arch" }} | |
23 echo "Downloading {{ . }} v{{ get $meta "version" }} ..." | 28 echo "Downloading {{ . }} v{{ get $meta "version" }} ..." |
24 curl -fsSL {{ get $meta "url" }} | tar --strip-components=1 -xz | 29 curl -fsSL {{ get $meta "url" }} | tar --strip-components=1 -xz |
25 install -m 755 $DOWNLOAD_DIR/{{ . }} $INSTALL_DIR/{{ . }} | 30 install -m 755 $DOWNLOAD_DIR/{{ . }} $INSTALL_DIR/{{ . }} |
26 {{ end }} | 31 {{ end }} |
27 | 32 |