summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 83caf815ca7f0824d2a0a15921271410d0d780d8 (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
# Maintainer: Arthur LAURENT <arthur.laurent4@gmail.com>
pkgname='shaderwriter-git'
pkgver=r114.9ba87a7
pkgrel=2
pkgdesc='Library used to write shaders from C++, and export them in either GLSL, HLSL or SPIR-V.'

arch=('any')
url="https://github.com/DragonJoker/ShaderWriter.git"
license=('MIT')

provides=('shaderwriter')
makedepends=('cmake' 'git')
conflicts=('shaderwriter')

source=('git+https://github.com/DragonJoker/ShaderWriter.git')
sha256sums=('SKIP')

pkgver() {
  cd 'ShaderWriter' 
  ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

prepare() {
    cd 'ShaderWriter'
    git submodule update --init
}

build() {
    cd 'ShaderWriter'
    cmake . -DCMAKE_BUILD_TYPE=Release -DPROJECTS_USE_PRECOMPILED_HEADERS=OFF -DSDW_BUILD_EXPORTER_HLSL=OFF -DSDW_BUILD_GLSL=ON -DSDW_BUILD_EXPORTER_SPIRV=ON -DSDW_BUILD_STATIC_EXPORTERS=OFF -DSDW_BUILD_STATIC_SDW=OFF -DSDW_GENERATE_SOURCE=OFF -DSDW_BUILD_VULKAN_LAYER=OFF -DCMAKE_INSTALL_PREFIX="$pkgdir/usr"
    cmake --build .
}

package() {
    cd 'ShaderWriter'
    cmake --build . --target install
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/shaderwriter-git/LICENSE"
}