summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 823d473bc1039a37cbe4f7aad94644a37d0b0469 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Maintainer: Luis Marques <luigoalma@gmail.com>
# Taken and modified glfw package for lib32, original maintainers and contributors:
# Maintainer: Sven-Hendrik Haase <svenstaro@gmail.com>
# Contributor: philefou <tuxication AT gmail DOT com>
# Contributor: lindquist <tomas@famolsen.dk>
# Contributor: Christoph Siegenthaler <csi@gmx.ch>
# Contributor: Mihai Militaru <mihai.militaru@ephemeros.org>
# Contributor: SpepS <dreamspepser at yahoo dot it>

pkgbase=lib32-glfw
pkgname=('lib32-glfw-x11' 'lib32-glfw-wayland')
pkgver=3.3.8
pkgrel=1
arch=('x86_64')
url="https://www.glfw.org/"
license=('custom:ZLIB')
makedepends=('lib32-mesa' 'cmake' 'vulkan-headers' 'lib32-vulkan-icd-loader'
             'extra-cmake-modules' 'wayland-protocols' 'lib32-libxi' 'lib32-libxrandr'
             'lib32-libxcursor' 'lib32-libxkbcommon' 'lib32-libxinerama')
source=("glfw-${pkgver}.tar.gz"::"https://github.com/glfw/glfw/archive/${pkgver}.tar.gz")
sha512sums=('70d6d99fb7e7616990516070c9a430915dc68d89ec4fe785570f0b35f5c9606a34121e0cd57c0a7debb50e87e2a8e8d97d81a6d52d65ef454f7fd191bd9f679f')

prepare() {
  cd "$srcdir/glfw-$pkgver"
  mkdir build-x11 build-wayland
}

build() {
  export CC='gcc -m32'
  export CXX='g++ -m32'
  export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'

  cd "$srcdir/glfw-$pkgver/build-x11"

  cmake .. \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DCMAKE_INSTALL_LIBDIR=lib32 \
      -DBUILD_SHARED_LIBS=ON \
      -DGLFW_BUILD_DOCS=OFF \
      -DGLFW_BUILD_EXAMPLES=OFF \
      -DGLFW_BUILD_TESTS=OFF

  cd ../build-wayland

  cmake .. \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DCMAKE_INSTALL_LIBDIR=lib32 \
      -DBUILD_SHARED_LIBS=ON \
      -DGLFW_BUILD_DOCS=OFF \
      -DGLFW_BUILD_EXAMPLES=OFF \
      -DGLFW_BUILD_TESTS=OFF \
      -DGLFW_USE_WAYLAND=ON
}

package_lib32-glfw-x11() {
  pkgdesc="A free, open source, portable framework for graphical application development (x11) (32-bit)"
  depends=('lib32-libxi' 'lib32-libxrandr' 'lib32-libxinerama' 'lib32-libxcursor' 'lib32-libgl')
  replaces=('lib32-glfw')
  conflicts=('lib32-glfw')
  provides=("lib32-glfw=$pkgver")

  cd "$srcdir/glfw-$pkgver"/build-x11

  make DESTDIR=$pkgdir install

  cd ..

  rm -rf "${pkgdir}"/usr/{bin,include,share}

  install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
}

package_lib32-glfw-wayland() {
  pkgdesc="A free, open source, portable framework for graphical application development (wayland) (32-bit)"
  depends=('lib32-wayland' 'lib32-libxkbcommon' 'lib32-libgl')
  conflicts=('lib32-glfw')
  provides=("lib32-glfw=$pkgver")

  cd "$srcdir/glfw-$pkgver"/build-wayland

  make DESTDIR=$pkgdir install

  cd ..

  rm -rf "${pkgdir}"/usr/{bin,include,share}

  install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
}