summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5be7ed349de4a0ea304505b044bbb2ee3eced187 (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
# Maintainer: Daniel Bermond < gmail-com: danielbermond >

pkgname=crossc-git
_srcname=crossc
pkgver=1.6.0.r0.g98689d7
pkgrel=3
pkgdesc='Portable C wrapper for SPIRV-Cross (git version)'
arch=('i686' 'x86_64')
url='https://github.com/rossy/crossc/'
license=('APACHE')
depends=('gcc-libs')
makedepends=('git')
provides=('crossc')
conflicts=('crossc')
source=('git+https://github.com/rossy/crossc.git'
        'git+https://github.com/KhronosGroup/SPIRV-Cross.git')
sha256sums=('SKIP'
            'SKIP')

prepare() {
    cd "$_srcname"
    
    git submodule init
    git config --local 'submodule.SPIRV-Cross.url' "${srcdir}/SPIRV-Cross"
    git submodule update
}

pkgver() {
    cd "$_srcname"
    
    # git, tags available
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//'
}

build() {
    cd "$_srcname"
    
    make
}

package() {
    cd "$_srcname"
    
    local _file
    local _lib
    local _soname
    local _somaj
    local _sover
    
    make DESTDIR="$pkgdir" prefix='/usr' install
    
    cd "${pkgdir}/usr/lib"
    
    # create missing symbolic link
    while read -rd '' _file
    do
        _lib="${_file##*/}"
        _soname="${_lib%%.*}"
        _sover="${_lib##*.so.}"
        _somaj="${_sover%%.*}"
        
        ln -s "${_lib}" "${_soname}.so.${_somaj}"
        
    done < <(find . -type f -name 'lib*.so.*.*.*' -print0)
}