summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3f6852b950f2a3e2b6068f79b946d1ff7c34d30f (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
# Maintainer: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>

pkgname=(mojoshader-hg lib32-mojoshader-hg)
pkgver=1242
pkgrel=1
pkgdesc='library to work with Direct3D shaders on alternate 3D APIs and non-Windows platforms'
arch=('x86_64')
url='https://icculus.org/mojoshader/'
license=('custom:zlib')
makedepends=('mercurial')

source=("hg+https://hg.icculus.org/icculus/mojoshader"
        'optional-spirv-tools.patch')
md5sums=('SKIP'
         '1e2e365b39d32e3372658d2b4070df1a')

pkgver() {
  cd mojoshader
  hg identify -n
}

prepare() {
  cd mojoshader
  hg patch ../optional-spirv-tools.patch
}

build() {
  cd mojoshader
  mkdir -p build build-lib32

  cd build
  cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_SHARED_LIBS=ON \
    -DPROFILE_ARB1=OFF \
    -DPROFILE_ARB1_NV=OFF \
    -DPROFILE_BYTECODE=OFF \
    -DPROFILE_D3D=OFF \
    -DPROFILE_METAL=OFF \
    -G Ninja
  ninja

  cd ../build-lib32
  export CC="gcc -m32"
  export CXX="g++ -m32"
  export PKG_CONFIG="i686-pc-linux-gnu-pkg-config"
  cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_SHARED_LIBS=ON \
    -DPROFILE_ARB1=OFF \
    -DPROFILE_ARB1_NV=OFF \
    -DPROFILE_BYTECODE=OFF \
    -DPROFILE_D3D=OFF \
    -DPROFILE_METAL=OFF \
    -DENABLE_SPIRV_TOOLS=OFF \
    -G Ninja
  ninja
}

package_mojoshader-hg() {
  provides=('mojoshader')
  conflicts=('mojoshader')

  cd mojoshader
  mkdir -p "$pkgdir"/usr/lib/ "$pkgdir"/usr/include/ "$pkgdir"/usr/share/licenses/mojoshader-hg/
  install -Dm755 build/libmojoshader.so "$pkgdir"/usr/lib/
  install -Dm644 mojoshader.h "$pkgdir"/usr/include/
  install -Dm644 mojoshader_effects.h "$pkgdir"/usr/include/
  install -Dm644 mojoshader_version.h "$pkgdir"/usr/include/
  install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/mojoshader-hg/
}

package_lib32-mojoshader-hg() {
  depends=(mojoshader-hg)
  provides=('lib32-mojoshader')
  conflicts=('lib32-mojoshader')

  cd mojoshader
  mkdir -p "$pkgdir"/usr/lib32/
  install -Dm755 build-lib32/libmojoshader.so "$pkgdir"/usr/lib32/
}

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