summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f0eb46d5db139a4b0006cf144f29053ffd6d5ed5 (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
# Maintainer: Lone_Wolf <Lone_Wolf@klaas-de-kat.nl>
# Contributor: Eric Engestrom <aur [at] engestrom [dot] ch>
# Contributor: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Laurent Carlier <lordheavym@gmail.com>


pkgname=lib32-spirv-tools-git
pkgver="2023.6".3900.f9184c650
pkgrel=1
pkgdesc='API and commands for processing SPIR-V modules (32-bit version)'
url='https://github.com/KhronosGroup/SPIRV-Tools'
arch=('i686' 'x86_64')
license=('Apache-2.0')
groups=('vulkan-devel')
source=('git+https://github.com/KhronosGroup/SPIRV-Tools'
              'git+https://github.com/google/googletest.git'
              'git+https://github.com/google/effcee.git'
              'git+https://github.com/google/re2.git'
              'git+https://github.com/abseil/abseil-cpp.git'
)
sha1sums=('SKIP'
          'SKIP'
          'SKIP'
          'SKIP'
          'SKIP')
depends=(lib32-glibc lib32-gcc-libs spirv-tools-git sh)
makedepends=(cmake python git spirv-headers-git)
conflicts=(lib32-spirv-tools)
provides=(lib32-spirv-tools)


cmake_args=(
  -G "Unix Makefiles"
  -D CMAKE_BUILD_TYPE=Release
  -D CMAKE_INSTALL_PREFIX=/usr
  -D CMAKE_INSTALL_LIBDIR=lib32
  -D SPIRV-Headers_SOURCE_DIR=/usr/
  -D BUILD_SHARED_LIBS=ON
  -D SPIRV_TOOLS_BUILD_STATIC=OFF
  -D SPIRV_WERROR=OFF
)




prepare() {
  # link external sources so cmake can find them
  pushd SPIRV-Tools/external
  ln -s "$srcdir"/googletest
  ln -s $srcdir/abseil-cpp abseil_cpp
  ln -s "$srcdir"/effcee
  ln -s "$srcdir"/re2
  popd
  
  export CC='gcc -m32'
  export CXX='g++ -m32'
  export PKG_CONFIG=i686-pc-linux-gnu-pkg-config

  cmake   -S SPIRV-Tools -B _build "${cmake_args[@]}" -Wno-dev
  make -C _build spirv-tools-build-version
}

pkgver() {
  local _ver1 _ver2
  # read fails if only 1 var is used
  IFS="," read -r _ver1 _ver2 < _build/build-version.inc || [ -n "_ver1" ]
  
  cd SPIRV-Tools  
  echo ${_ver1//v/}.$(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}



build() {
  make -C _build
}

check() {
    make -C _build test
}

package() {
  
  make -C _build DESTDIR="$pkgdir" install
  rm -r "$pkgdir"/usr/{bin,include}
}