# Maintainer: Raphael Nestler # Contributor: Sampson Crowley # Contributor: Rhys Kenwell # Github Contributors: https://github.com/SampsonCrowley/arch_packages/contributors.md pkgname=heroku-cli pkgver=8.11.1 pkgrel=1 pkgdesc="CLI to manage Heroku apps and services with forced auto-update removed" arch=('any') url="https://devcenter.heroku.com/articles/heroku-cli" license=('custom' 'ISC') depends=('nodejs') makedepends=('yarn' 'git' 'npm') optdepends=('git: Deploying to Heroku') conflicts=('heroku-cli-bin' 'heroku-client-standalone' 'heroku-toolbelt' 'ruby-heroku') source=("git+https://github.com/heroku/cli.git#commit=v${pkgver}") sha256sums=('d9138827a59b6ddf630da902f543ca5a088ac13e50e2b8eb33aaad915edb1b4f') sha512sums=('21aa184176143bed3376d4d6bff9df848e49bf55d6e8cae321e37d353c56065a761c27ee32c6fdd1d05c7cb2efb7d3acd7a182572733def604b47d7393b1d82b') options=('!strip') provides=('heroku' 'heroku-cli') prepare() { pushd "$srcdir" pushd "cli" pushd packages/cli # remove forced auto-update plugin sed -i "/oclif\/plugin-update/d" ./package.json # remove pin to node 16 sed -i 's/"node": "~16.20.0"/"node": ">=16"/g' ./package.json # install dependencies, must be done with yarn as of 7.60 yarn install # create base package yarn pack --filename "heroku-v$VERSION-linux-x64.tar.xz" tar -xzvf "heroku-v$VERSION-linux-x64.tar.xz" -C "$srcdir/" popd popd # Remove any existing package rm -rf heroku/ # final installation mv package heroku pushd heroku yarn --prod popd # unneeded compilation files for file in *; do if [[ "$file" = "heroku" ]]; then continue else rm -rf "$file" fi done popd } package() { install -dm755 "$pkgdir/usr/lib/heroku" install -dm755 "$pkgdir/usr/bin" install -dm755 "$pkgdir/usr/share/licenses/$pkgname" cp -a "$srcdir/heroku" "$pkgdir/usr/lib" # completions local autocompletedir="$srcdir/heroku/autocomplete-scripts" install -Dm644 "$autocompletedir/bash/heroku.bash" "$pkgdir/usr/share/bash-completion/completions/heroku" install -Dm644 "$autocompletedir/zsh/_heroku" "$pkgdir/usr/share/zsh/site-functions/_heroku" ln -sf "../../../lib/heroku/LICENSE" "$pkgdir/usr/share/licenses/$pkgname" ln -sf "../lib/heroku/bin/run" "$pkgdir/usr/bin/heroku" # Remove empty directories find "${pkgdir}" -type d -empty -delete }