summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0f98df6c001769454ea57a4e17f5d0fb485b47da (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
54
55
56
57
58
59
60
61
62
63
64
# Contributor: Axper Jan <483ken _at_ gmail _dot_ com
# Contributor: Daniel Kirchner <ekpyron at lavabit dot com>
# Contributor: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
# Maintainer: Ricardo Vieira <ricardo.vieira@tecnico.ulisboa.pt>

_pkgbase=glfw
pkgbase="$_pkgbase-git"
pkgname=("$_pkgbase-x11-git" "$_pkgbase-wayland-git")
pkgver=3.1.1.r124.g33c7c28
pkgrel=1
arch=('i686' 'x86_64' 'armv7h')
url="http://www.glfw.org/"
license=('custom:ZLIB')
optdepends=('doxygen: build glfw html documentation')
makedepends=('cmake' 'git' 'libxi' 'libxrandr' 'libxinerama' 'libxcursor' 'wayland' 'libxkbcommon' 'libgl')
conflicts=("$_pkgbase")
provides=("$_pkgbase=3.1.1")
source=("$_pkgbase::git+https://github.com/glfw/glfw")
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$_pkgbase"
  git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g'
}

prepare() {
  mkdir -p "$srcdir/$_pkgbase/build-x11"
  mkdir -p "$srcdir/$_pkgbase/build-wayland"
}

package_glfw-x11-git() {
  depends=('libxi' 'libxrandr' 'libxinerama' 'libxcursor' 'libgl')
  pkgdesc="A free, open source, portable framework for OpenGL application development. (git, X11 version)"

  cd "$srcdir/$_pkgbase/build-x11"
  cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_SHARED_LIBS=ON \
    -DGLFW_BUILD_EXAMPLES=OFF \
    -DGLFW_BUILD_TESTS=OFF \
    -Wno-dev \
    ..
  make DESTDIR="$pkgdir" install
  install -D -m644 ../COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

package_glfw-wayland-git() {
  depends=('wayland' 'libxkbcommon' 'libgl')
  pkgdesc="A free, open source, portable framework for OpenGL application development. (git, Wayland version)"

  cd "$srcdir/$_pkgbase/build-wayland"
  cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_SHARED_LIBS=ON \
    -DGLFW_BUILD_EXAMPLES=OFF \
    -DGLFW_BUILD_TESTS=OFF \
    -DGLFW_USE_WAYLAND=ON \
    -Wno-dev \
    ..
  make DESTDIR="$pkgdir" install
  install -D -m644 ../COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

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