|
| 1 | +pkgname=asdf-vm |
| 2 | +pkgver=0.14.1 |
| 3 | +pkgdesc='Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more' |
| 4 | +repology=("project: ${pkgname}") |
| 5 | +arch=('any') |
| 6 | +url='https://asdf-vm.com' |
| 7 | +license=('MIT') |
| 8 | +depends=( |
| 9 | + 'curl' |
| 10 | + 'git' |
| 11 | +) |
| 12 | +optdepends=( |
| 13 | + 'build-essential: Array of tools to build software' |
| 14 | + 'bash-completion: For completions to work in Bash' |
| 15 | + 'libncurses5-dev: Text-based UI library for terminal applications' |
| 16 | + 'libncurses-dev: Text-based UI library for terminal applications' |
| 17 | + 'unzip: Needed by some plugins, like Elixir' |
| 18 | +) |
| 19 | +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/asdf-vm/asdf/archive/v${pkgver}.tar.gz") |
| 20 | +sha256sums=('308a7f2e1eb551e435458974fbe37dcef1c940e961ad40e47ae78cabc154543e') |
| 21 | + |
| 22 | +package() { |
| 23 | + cd "asdf-${pkgver}" |
| 24 | + |
| 25 | + local dst="${pkgdir}/opt/${pkgname}" |
| 26 | + mkdir -p "${dst}" |
| 27 | + |
| 28 | + cp -r bin lib asdf.elv asdf.fish asdf.nu asdf.sh defaults help.txt version.txt "${dst}" |
| 29 | + |
| 30 | + local usrshare="${pkgdir}/usr/share" |
| 31 | + |
| 32 | + local docdir="${usrshare}/doc/${pkgname}" |
| 33 | + mkdir -p "${docdir}" |
| 34 | + cp help.txt "${docdir}" |
| 35 | + |
| 36 | + # https://aur.archlinux.org/packages/asdf-vm#comment-886293 |
| 37 | + find . \ |
| 38 | + -path ./.github \ |
| 39 | + -prune \ |
| 40 | + -o \ |
| 41 | + -name '*.md' \ |
| 42 | + -exec cp --parents '{}' "${docdir}" \; |
| 43 | + |
| 44 | + install -Dm644 -t "${usrshare}/licenses/${pkgname}/" LICENSE |
| 45 | + |
| 46 | + cd completions |
| 47 | + |
| 48 | + install -Dm644 asdf.bash "${usrshare}/bash-completion/completions/asdf" |
| 49 | + install -Dm644 asdf.fish "${usrshare}/fish/vendor_completions.d/asdf.fish" |
| 50 | + install -Dm644 _asdf "${usrshare}/zsh/site-functions/_asdf" |
| 51 | +} |
| 52 | + |
| 53 | +post_install() { |
| 54 | + cat << EOF |
| 55 | + |
| 56 | +Add the following line to your .bashrc or .profile: |
| 57 | +. /opt/asdf-vm/asdf.sh |
| 58 | + |
| 59 | +For more information see the official instructions [0]. |
| 60 | +Especially the section titled "YOUR_SHELL & Pacman". |
| 61 | + |
| 62 | +[0] https://asdf-vm.com/guide/getting-started.html#_3-install-asdf |
| 63 | + |
| 64 | +EOF |
| 65 | +} |
0 commit comments