summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ddd2b64de5014a36b2b3e132d6806fc941a1bdf3 (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
# Maintainer: pingplug < aur at pingplug dot me >
# Contributor: Jan de Groot < jgc at archlinux dot org >

pkgname=xf86-video-mga
pkgver=2.0.0
pkgrel=1
pkgdesc="X.org mga video driver"
arch=('x86_64')
url="https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga"
license=('custom')
groups=('xorg-drivers' 'xorg')
depends=('glibc')
makedepends=('xorg-server-devel'
             'git')
optdepends=('mga-dri: DRI1 support from community repo')
conflicts=('xorg-server<1.19'
           'X-ABI-VIDEODRV_VERSION<23'
           'X-ABI-VIDEODRV_VERSION>=24')
source=("git+https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga.git")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${pkgname}"
  git describe | sed 's/^.*mga-//g' | sed 's/-/+/g'
}

prepare() {
  cd "${srcdir}/${pkgname}"
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd "${srcdir}/${pkgname}"
  # Since pacman 5.0.2-2, hardened flags are now enabled in makepkg.conf
  # With them, module fail to load with undefined symbol.
  # See https://bugs.archlinux.org/task/55102 / https://bugs.archlinux.org/task/54845
  export CFLAGS=${CFLAGS/-fno-plt}
  export CXXFLAGS=${CXXFLAGS/-fno-plt}
  export LDFLAGS=${LDFLAGS/,-z,now}
  ./configure \
    --prefix=/usr
  make
}

package() {
  cd "${srcdir}/${pkgname}"
  make DESTDIR="${pkgdir}" install
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}

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