summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Bassi2019-02-23 11:52:47 -0800
committerCaleb Bassi2019-02-23 11:54:45 -0800
commit5ef0c5cc7998913e55fd8a98532b254c91ad9972 (patch)
tree19e0059935f951465d9a1a54291b3b05c54a96ad
parentf4439a9a4f3ba4e0c68ef0ffc46b3521f3ce0a58 (diff)
downloadaur-5ef0c5cc7998913e55fd8a98532b254c91ad9972.tar.gz
Fix pkgbuild after rust migration
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD28
2 files changed, 26 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 35d9a79cd928..13ce5d22b4c0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,15 +1,16 @@
pkgbase = swaylock-blur-git
- pkgdesc = A script that runs swaylock and sets the image to a blurred screenshot of the desktop
- pkgver = r3.cb1df3d
- pkgrel = 2
+ pkgdesc = A small Rust program that runs swaylock and sets the image to a blurred screenshot of the desktop
+ pkgver = r6.2011a78
+ pkgrel = 1
url = https://github.com/cjbassi/swaylock-blur
arch = any
license = MIT
makedepends = git
+ makedepends = cargo
depends = swaylock
depends = imagemagick
depends = grim
- depends = jq
+ depends = sway
provides = swaylock-blur
conflicts = swaylock-blur
source = git+https://github.com/cjbassi/swaylock-blur
diff --git a/PKGBUILD b/PKGBUILD
index 50046fc10df8..6e8d3d0b8f7e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,19 +2,20 @@
pkgname=swaylock-blur-git
_pkgname=${pkgname%-git}
-pkgver=r3.cb1df3d
-pkgrel=2
-pkgdesc="A script that runs swaylock and sets the image to a blurred screenshot of the desktop"
+pkgver=r6.2011a78
+pkgrel=1
+pkgdesc="A small Rust program that runs swaylock and sets the image to a blurred screenshot of the desktop"
arch=("any")
url="https://github.com/cjbassi/swaylock-blur"
license=("MIT")
-depends=("swaylock" "imagemagick" "grim" "jq")
-makedepends=("git")
+depends=("swaylock" "imagemagick" "grim" "sway")
+makedepends=("git" "cargo")
provides=(${_pkgname})
conflicts=(${_pkgname})
source=("git+${url}")
md5sums=("SKIP")
+# https://wiki.archlinux.org/index.php/VCS_package_guidelines
pkgver() {
cd "${_pkgname}"
( set -o pipefail
@@ -23,7 +24,20 @@ pkgver() {
)
}
+# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=loop
+build() {
+ cd "${_pkgname}"
+ if command -v rustup > /dev/null 2>&1; then
+ RUSTFLAGS="-C target-cpu=native" rustup run stable \
+ cargo build --release
+ elif rustc --version | grep -q nightly; then
+ RUSTFLAGS="-C target-cpu=native" \
+ cargo build --release
+ else
+ cargo build --release
+ fi
+}
+
package() {
- mkdir -p ${pkgdir}/usr/bin/
- install ${srcdir}/${_pkgname}/${_pkgname} ${pkgdir}/usr/bin/${_pkgname}
+ install -Dm755 "${srcdir}/${_pkgname}/target/release/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
}