[arch-commits] Commit in autorandr/trunk (PKGBUILD)

David Runge dvzrv at archlinux.org
Sat Apr 25 17:59:08 UTC 2020


    Date: Saturday, April 25, 2020 @ 17:59:07
  Author: dvzrv
Revision: 621030

upgpkg: autorandr 1.10-1: Upgrading to 1.10.

Adding zsh-completions to optdepends. Switching to x86_64 as arch, as now a compiled tool is included.
Compiling autorandr-launcher without Makefile, as the Makefile doesn't support LDFLAGS.
Installing files without Makefile, as this way installing autorandr.py via setuptools is easier.
Installing zsh completion file.

Modified:
  autorandr/trunk/PKGBUILD

----------+
 PKGBUILD |   39 +++++++++++++++++++++++++++++++++------
 1 file changed, 33 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-04-25 17:56:55 UTC (rev 621029)
+++ PKGBUILD	2020-04-25 17:59:07 UTC (rev 621030)
@@ -1,29 +1,56 @@
 # Maintainer: David Runge <dvzrv at archlinux.org>
 
 pkgname=autorandr
-pkgver=1.9
+pkgver=1.10
 pkgrel=1
 pkgdesc="Auto-detect connected display hardware and load appropiate X11 setup using xrandr"
-arch=('any')
+arch=('x86_64')
 url="https://github.com/phillipberndt/autorandr"
 license=('GPL3')
 depends=('python-setuptools' 'xorg-xrandr')
 makedepends=('bash-completion')
-optdepends=('bash-completion: auto-completion for autorandr'
-            'xorg-xdpyinfo: For detecting the primary XRandR output')
+optdepends=('bash-completion: auto-completion for autorandr in Bash'
+            'xorg-xdpyinfo: For detecting the primary XRandR output'
+            'zsh-completions: auto-completion for autorandr in ZSH')
 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/phillipberndt/${pkgname}/archive/${pkgver}.tar.gz")
-sha512sums=('ca1727a1ac2a55b0ebce3051e7e976fc675633269972785b72ec0001e598cc028f7fff95bcfafa38f8dca900795818d8aaef26c3081528cf26b85f5290318c70')
+sha512sums=('875433c4dd995d6170b511d6936d79c6a0790f823ad053b268bba7974d68f68674ba5474b59f2fba6ff6eed8871b2499e950f60c0e5698d39358159da454d9c5')
 
 build() {
   cd "${pkgname}-${pkgver}"
   python setup.py build
+  # compile the autorandr-launcher manually, as the Makefile is weird
+  # https://github.com/phillipberndt/autorandr/issues/195
+  gcc -Wall $CFLAGS contrib/autorandr_launcher/autorandr_launcher.c \
+      -o contrib/autorandr_launcher/autorandr-launcher \
+      $(pkg-config --libs --cflags pkg-config xcb xcb-randr) $LDFLAGS
 }
 
 package() {
+  local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
   cd "${pkgname}-${pkgver}"
   python setup.py install --skip-build \
     --optimize=1 \
     --root="${pkgdir}/"
-  make DESTDIR="${pkgdir}" PREFIX=/usr install
+  # symlink executable in place, as we are installing with setuptools but
+  # there's no entry_point
+  chmod +x "${pkgdir}/usr/lib/python${python_version}/site-packages/${pkgname}.py"
+  ln -svf "/usr/lib/python${python_version}/site-packages/${pkgname}.py" \
+    "${pkgdir}/usr/bin/${pkgname}"
+  install -vDm 644 "contrib/etc/xdg/autostart/${pkgname}.desktop" \
+    -t "${pkgdir}/etc/xdg/autostart/"
+  # launcher
+  install -vDm 755 contrib/autorandr_launcher/autorandr-launcher \
+    -t "${pkgdir}/usr/bin"
+  install -vDm 644 "contrib/etc/xdg/autostart/${pkgname}-launcher.desktop" \
+    -t "${pkgdir}/etc/xdg/autostart/"
+  # man page
+  install -vDm 644 "${pkgname}.1" -t "${pkgdir}/usr/share/man/man1/"
+  # bash completion
+  install -vDm 644 "contrib/bash_completion/${pkgname}" \
+    -t "${pkgdir}/$(pkg-config --variable=completionsdir bash-completion)"
+  # zsh completion
+  install -vDm 644 "contrib/zsh_completion/_${pkgname}" \
+    -t "${pkgdir}/usr/share/zsh/site-functions/"
+  # docs
   install -vDm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}/"
 }


More information about the arch-commits mailing list