Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arch AUR pkgbuild script. #15

Open
petar-v opened this issue Sep 21, 2024 · 0 comments
Open

Arch AUR pkgbuild script. #15

petar-v opened this issue Sep 21, 2024 · 0 comments

Comments

@petar-v
Copy link

petar-v commented Sep 21, 2024

Hello!

Thanks so much for making this. It's super useful.

I'd like to add it to AUR. However, for this, it would be best if you can make your makefile take an install dir argument. I've made the following PKGBUILD script and will submit it to AUR.

# Maintainer: Petar Vasilev <[email protected]>
pkgname=lenovo-vantage-linux
pkgver=r21.0e123d7 
pkgrel=1
pkgdesc="This shell script helps you to provide Lenovo Vantage in GNU/Linux operating system."
arch=('x86_64')
url="https://github.com/niizam/vantage" 
license=('GPL3')
depends=('zenity' 'xorg-xinput' 'networkmanager')
makedepends=('git' 'make')
optdepends=(
  'pulseaudio: for PulseAudio support'
  'pipewire-pulse: for PipeWire support instead of PulseAudio'
)

_commit="0e123d7508ca20bef26d4ea8ba2a13124f863d10"
source=("$pkgname::git+$url.git#commit=$_commit")
sha256sums=('5c2d16ee808695712c5e7010e623006678e8e24d40ef9297b62e02e420469eac')

provides=('lenovo-vantage-linux')

# Handle pulseaudio/pipewire-pulse
prepare() {
  if pacman -Qi pipewire-pulse &>/dev/null; then
    depends=('zenity' 'xorg-xinput' 'networkmanager' 'pipewire-pulse')
  fi
  if pacman -Qi pulseaudio &>/dev/null; then
    depends=('zenity' 'xorg-xinput' 'networkmanager' 'pulseaudio')
  fi
}

pkgver() {
  cd "$pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  cd "$srcdir/$pkgname"
  
  # Manually install files as per Makefile's instructions
  chmod a+rx ./vantage.sh
  install -Dm644 ./icon.png "$pkgdir/usr/share/icons/hicolor/scalable/apps/vantage.png"
  install -Dm644 ./vantage.desktop "$pkgdir/usr/share/applications/vantage.desktop"
  install -Dm755 ./vantage.sh "$pkgdir/usr/bin/vantage"
  install -Dm644 "./LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant