summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e95b989d2787404baf423d4b648a9411bdfeb4f2 (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
# Maintainer: Emeric Grange <emeric.grange@gmail.com>
# Created: 27/02/2020

# The upstream software is not package friendly yet, so instead of rewriting its
# entire build system, we just built it (and its dependencies) as is and copy The
# results into /opt/shadered.
# If you want to help improve or maintain this package please let me know!

pkgname=shadered
pkgver=1.5.6
pkgrel=1
pkgdesc="Lightweight tool for creating and testing HLSL and GLSL shaders."
arch=("x86_64")
url="https://github.com/dfranx/SHADERed"
license=("MIT")
depends=(gtk3 sdl2 sfml assimp glew glm spirv-headers)
makedepends=(git cmake python ninja)

source=("git+https://github.com/dfranx/SHADERed.git#tag=v$pkgver"
        "git+https://github.com/dfranx/ImGuiColorTextEdit"
        "git+https://github.com/dfranx/SPIRV-VM.git"
        "git+https://github.com/dfranx/ShaderExpressionParser"
        "git+https://github.com/dfranx/SpvGenTwo"
        "git+https://github.com/dfranx/assimp.git"
        "git+https://github.com/KhronosGroup/glslang"
        "git+https://github.com/dfranx/imgui.git"
        "git+https://github.com/jtilly/inih"
        "git+https://github.com/zeux/pugixml"
        "git+https://github.com/KhronosGroup/SPIRV-Headers"
        "git+https://github.com/KhronosGroup/SPIRV-Tools.git"
        "SHADERed.sh")
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            '885a7c14a7e00477c9acce4c64145e075a044be7a9f774b272cd5af7bde31ee9')

prepare() {
  cd SHADERed
  git submodule init
  git config submodule.'libs/ImGuiColorTextEdit'.url "$srcdir/ImGuiColorTextEdit"
  git config submodule.'libs/SPIRV-VM'.url "$srcdir/SPIRV-VM"
  git config submodule.'libs/ShaderExpressionParser'.url "$srcdir/ShaderExpressionParser"
  git config submodule.'libs/SpvGenTwo'.url "$srcdir/SpvGenTwo"
  git config submodule.'libs/assimp'.url "$srcdir/assimp"
  git config submodule.'libs/glslang'.url "$srcdir/glslang"
  git config submodule.'libs/imgui'.url "$srcdir/imgui"
  git config submodule.'libs/inih'.url "$srcdir/inih"
  git config submodule.'libs/pugixml'.url "$srcdir/pugixml"
  git config submodule.'libs/spirv-headers'.url "$srcdir/SPIRV-Headers"
  git config submodule.'libs/spirv-tools'.url "$srcdir/SPIRV-Tools"
  git -c protocol.file.allow=always submodule update
}

build() {
  cd SHADERed/
  cmake \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -GNinja \
    .
  ninja
}

package() {
  cd "$srcdir/SHADERed"
  install -Dm644 "$srcdir/SHADERed/Misc/Icon/icon.svg" "$pkgdir/usr/share/pixmaps/$pkgname.svg"
  install -Dm644 "$srcdir/SHADERed/Misc/Linux/org.shadered.SHADERed.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
  install -Dm755 "$srcdir/SHADERed.sh" "$pkgdir/usr/bin/$pkgname"
  mkdir -p "$pkgdir/usr/share/$pkgname"
  cp -r $srcdir/SHADERed/bin/* "$pkgdir/usr/share/$pkgname"
}