aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 73e7d0b60622227a657a249ddfa3cba61212674f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Maintainer: Philipp Schmitt <philipp@schmitt.co>
# Upstream: https://github.com/phillipberndt/fakexrandr
pkgname=fakexrandr-git
pkgver=r68.bb5ee75
pkgrel=2
pkgdesc="Fake XRandR configurations for multi-head setups with crappy video drivers, like fakexinerama but with xrandr"
arch=(any)
url="https://github.com/phillipberndt/fakexrandr"
license=('GPL')
depends=('xorg-xrandr')
makedepends=('git' 'glibc' 'sed' 'python2')
source=("$pkgname"::'git+https://github.com/phillipberndt/fakexrandr.git')
sha1sums=('SKIP')

_pkgname=fakexrandr
_lib_dir=/usr/lib/$_pkgname

pkgver() {
  cd "$srcdir/$pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$srcdir/$pkgname"
  # Fix python interpreter (python -> python2)
  sed -i '1s/python/python2/g' make_skeleton.py
  # Add custom fakexrandr lib path (bypass detection)
  sed -i "s|^\(FAKE_LIBRARY_DIRECTORY=\)$|\1${_lib_dir}|" configure
  # FIXME THIS AINT WORKING
  # Fix missing target
  sed -i "s|\(install\) \(.*\) \(.*\);|\1 \2 \3/\2;|" Makefile
  # Fix missing DEST_DIR in Makefile
  sed -i "s|\(TARGET_DIR=\).*|\1${pkgdir}${_lib_dir}; \\\|" Makefile
  # Don't even try to run ldconfig now
  sed -i "s/\(ldconfig\)/#\1/" Makefile
  # Create ld.so.conf.d config file
  echo "$_lib_dir" > "${_pkgname}.conf"
}

build() {
  cd "$srcdir/$pkgname"
  ./configure
  make
}

package() {
  cd "$srcdir/$pkgname"
  mkdir -p "$pkgdir/$_lib_dir" "${pkgdir}/usr/bin"
  make PREFIX="$pkgdir/usr" install
  install -D -m 644 "${_pkgname}.conf" "$pkgdir/etc/ld.so.conf.d/${_pkgname}.conf"
}

# vim: set et ts=2 sw=2 :