summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavide Depau2020-04-05 18:16:39 +0200
committerDavide Depau2020-04-05 18:16:39 +0200
commit8e7cc61696315c3674c4b62753e66626b0502870 (patch)
treeef8ea923c2c8ad5c6a1073ff83b73ae86482fa78
downloadaur-8e7cc61696315c3674c4b62753e66626b0502870.tar.gz
Initial commit
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD46
2 files changed, 65 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..876490816d7f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = sway-accel-rotate-git
+ pkgver = r4.db52ad3
+ pkgrel = 1
+ url = https://github.com/Depau/sway-accel-rotate
+ arch = i686
+ arch = x86_64
+ arch = arm
+ arch = armv7h
+ arch = armv6h
+ arch = aarch64
+ arch = pentium4
+ license = MIT
+ makedepends = go
+ depends = iio-sensor-proxy
+ source = sway-accel-rotate::git+https://github.com/Depau/sway-accel-rotate.git
+ sha1sums = SKIP
+
+pkgname = sway-accel-rotate-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..0e6723c1db83
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Davide Depau <davide@depau.eu>
+
+_pkgname=sway-accel-rotate
+pkgname="${_pkgname}-git"
+pkgver=r4.db52ad3
+pkgrel=1
+pkgdesk="Rotate Sway outputs based on current accelerometer orientation using iio-sensor-proxy"
+arch=('i686' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64' 'pentium4')
+url="https://github.com/Depau/sway-accel-rotate"
+license=('MIT')
+depends=(
+ 'iio-sensor-proxy'
+)
+makedepends=(
+ 'go'
+)
+source=(
+ "${_pkgname}::git+${url}.git"
+)
+sha1sums=(
+ SKIP
+)
+
+pkgver() {
+ cd "$srcdir/$_pkgname"
+ ( set -o pipefail
+ git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ )
+}
+
+build() {
+ export GOPATH="$srcdir/gopath"
+ cd "$srcdir/$_pkgname"
+
+ EXTRA_GOFLAGS="-modcacherw -gcflags all=-trimpath=${PWD} -asmflags all=-trimpath=${PWD}"
+ LDFLAGS="-linkmode external -extldflags \"${LDFLAGS}\""
+ go build ${GOFLAGS} -ldflags "-s -w ${LDFLAGS}" ${EXTRA_GOFLAGS} -o "${_pkgname}"
+}
+
+package() {
+ cd "$srcdir/$_pkgname"
+ install -Dm755 "$_pkgname" "$pkgdir/usr/bin/$_pkgname"
+ install -dm755 "$pkgdir/usr/share/licenses/$pkgname"
+ install -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}