summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander F Rødseth2016-09-07 10:27:25 +0200
committerAlexander F Rødseth2016-09-07 10:27:25 +0200
commit491c2a27a69e7b9948ffb4c84aa68eb626b56aca (patch)
tree5775c0b2d59978f7f2d44aca6abd804e09d48acc
parent79913a181241a69d43bc234525d9400490a8ade8 (diff)
downloadaur-491c2a27a69e7b9948ffb4c84aa68eb626b56aca.tar.gz
Detect DPI before adjusting the image size
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD21
2 files changed, 16 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d309299e4bc4..c91a01e9e60f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,16 @@
+# Generated by mksrcinfo v8
+# Wed Sep 7 08:27:20 UTC 2016
pkgbase = ghextris
pkgdesc = Tetris-like game on a hexagonal grid
pkgver = 0.9.0
- pkgrel = 4
+ pkgrel = 5
url = http://mjr.iki.fi/software/ghextris
arch = x86_64
arch = i686
license = GPL
makedepends = gettext
makedepends = setconf
+ makedepends = xorg-xdpyinfo
depends = gnome-python
source = http://mjr.iki.fi/software/ghextris_0.9.0-1.tar.gz
sha256sums = cd67776a35561879407208a5ecd201a23fcd5726a4962eaba1e25219c44c4cd6
diff --git a/PKGBUILD b/PKGBUILD
index 2a08f867a274..e8a45c6070a4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,26 +1,21 @@
-# Maintainer: Alexander Rødseth <rodseth@gmail.com>
-# Contributor: Arkham <arkham at archlinux dot us>
+# Maintainer: Alexander F Rødseth <xyproto@archlinux.org>
+# Contributor: Arkham <arkham@archlinux.us>
# Contributor: brix <blbennett@telus.net>
pkgname=ghextris
pkgver=0.9.0
-pkgrel=4
+pkgrel=5
pkgdesc='Tetris-like game on a hexagonal grid'
arch=('x86_64' 'i686')
url='http://mjr.iki.fi/software/ghextris'
license=('GPL')
depends=('gnome-python')
-makedepends=('gettext' 'setconf')
+makedepends=('gettext' 'setconf' 'xorg-xdpyinfo')
source=("http://mjr.iki.fi/software/${pkgname}_$pkgver-1.tar.gz")
sha256sums=('cd67776a35561879407208a5ecd201a23fcd5726a4962eaba1e25219c44c4cd6')
prepare() {
cd "$pkgname-$pkgver"
-
- # HiDPI
- sed -i 's/24/48/' ghextris.py
- sed -i 's/26/52/' ghextris.py
- sed -i 's/14/28/' ghextris.py
setconf install.sh BINDIR '"$PREFIX/bin"'
setconf install.sh SHAREDIR '"$PREFIX/share/ghextris"'
@@ -28,6 +23,14 @@ prepare() {
sed -i -e 's:share/games:share:' install.sh
sed -i -e 's:python2.3:python2:' -e 's:whrandom:random:g' "$pkgname.py"
+
+ # Adjust the image sizes for DPI > 96
+ DPI=$(xdpyinfo | grep resolution | head -1 | cut -d"x" -f2 | cut -d" " -f1)
+ if (( DPI > 96 )); then
+ sed -i 's/24/48/' ghextris.py
+ sed -i 's/26/52/' ghextris.py
+ sed -i 's/14/28/' ghextris.py
+ fi
}
package() {