diff options
author | éclairevoyant | 2024-02-24 20:25:39 -0500 |
---|---|---|
committer | éclairevoyant | 2024-02-24 20:25:39 -0500 |
commit | 73c4d7daa0940d6446723d1701274036a822ef36 (patch) | |
tree | dbb86a59184ebdbb103000a1d1e294ac378f9d87 | |
parent | f2377deccf3c948b0439d26de2e03a66bb0288c4 (diff) | |
download | aur-73c4d7daa0940d6446723d1701274036a822ef36.tar.gz |
swhkd-git: follow rust packaging guidelines
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 75 |
2 files changed, 52 insertions, 41 deletions
@@ -1,19 +1,19 @@ pkgbase = swhkd-git - pkgdesc = A display server independent hotkey daemon inspired by sxhkd. - pkgver = 1.2.1.r17.g022466e + pkgdesc = Display server-independent hotkey daemon inspired by sxhkd + pkgver = 1.2.1.r70.g3db287e pkgrel = 1 url = https://github.com/waycrate/swhkd arch = x86_64 license = BSD - makedepends = rustup - makedepends = make makedepends = git + makedepends = rustup makedepends = scdoc depends = polkit - conflicts = swhkd-musl-git - source = swhkd::git+https://github.com/waycrate/swhkd.git - source = swhkd-vim::git+https://github.com/waycrate/swhkd-vim.git - sha256sums = SKIP - sha256sums = SKIP + provides = swhkd + conflicts = swhkd + source = git+https://github.com/waycrate/swhkd.git + source = git+https://github.com/waycrate/swhkd-vim.git + b2sums = SKIP + b2sums = SKIP pkgname = swhkd-git @@ -1,41 +1,52 @@ -# Maintainer: Aakash Sharma <aakashsensharma@gmail.com> -# Contributor: Sergey A. <murlakatamenka@disroot.org> -# Contributor: rv178 <idliyout@gmail.com> +# Maintainer: éclairevoyant +# Contributor: Aakash Sharma <aakashsensharma at gmail dot com> +# Contributor: Sergey A dot <murlakatamenka at disroot dot org> +# Contributor: rv178 <idliyout at gmail dot com> _pkgname="swhkd" -pkgname="${_pkgname}-git" -pkgver=1.2.1.r17.g022466e +pkgname="$_pkgname-git" +pkgver=1.2.1.r70.g3db287e pkgrel=1 -arch=("x86_64") -url="https://github.com/waycrate/swhkd" -pkgdesc="A display server independent hotkey daemon inspired by sxhkd." -license=("BSD") -depends=("polkit") -makedepends=("rustup" "make" "git" "scdoc") -conflicts=("swhkd-musl-git") -source=("${_pkgname}::git+${url}.git" - "${_pkgname}-vim::git+${url}-vim.git") -sha256sums=("SKIP" - "SKIP") - -build(){ - cd "$_pkgname" - make setup - make -} +arch=(x86_64) +url="https://github.com/waycrate/$_pkgname" +pkgdesc="Display server-independent hotkey daemon inspired by sxhkd" +license=(BSD) +depends=(polkit) +makedepends=(git rustup scdoc) +provides=(swhkd) +conflicts=(swhkd) +source=("git+$url.git" + "git+$url-vim.git") +b2sums=("SKIP" + "SKIP") -package() { - cd "$_pkgname" - make DESTDIR="$pkgdir/" install - - cd "${srcdir}/${_pkgname}-vim" - for i in ftdetect ftplugin indent syntax; do - install -Dm644 "$i/${_pkgname}.vim" \ - "${pkgdir}/usr/share/vim/vimfiles/$i/${_pkgname}.vim" - done +prepare() { + cd $_pkgname + + export RUSTUP_TOOLCHAIN=stable + cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" + + sed -i '/^BUILDFLAGS/ s|:=|?=|' Makefile } pkgver() { + git -C $_pkgname describe --long --tags --match'=[0-9]*' | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +build() { cd $_pkgname - git describe --long --tags --match'=[0-9]*' | sed 's/\([^-]*-g\)/r\1/;s/-/./g' + export RUSTUP_TOOLCHAIN=stable + export CARGO_TARGET_DIR=target + export BUILDFLAGS='--frozen --release --all-features' + make +} + +package() { + make -C $_pkgname DESTDIR="$pkgdir" install + + cd $_pkgname-vim + for i in ftdetect ftplugin indent syntax; do + install -Dm644 "$i/${_pkgname}.vim" \ + "$pkgdir/usr/share/vim/vimfiles/$i/$_pkgname.vim" + done } |