summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d71a73c9c03c161e8a80056ad72d7ca1164c54d4 (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
# Maintainer: Asakura Mizu <asakuramizu111@gmail.com>
pkgname=defoldsdk-headers
pkgver=1.9.4.redfdbe3
pkgrel=1
epoch=
pkgdesc='Headers for Defold SDK'
arch=('x86_64')
url='https://defold.com/'
license=('custom')
groups=()
depends=()
makedepends=('curl' 'jq')
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=defoldsdk-headers.install
changelog=
validpgpkeys=()
source=('LICENSE')
sha256sums=('be6e9921ba01445d200ba3dc09b5cab149a58d57a76ca98376b52af87d817a7a')

prepare() {
    cd "$srcdir"

    curl -O https://d.defold.com/stable/info.json
    _sha1=$(cat info.json | jq -r '.sha1')
    curl -O "https://d.defold.com/archive/stable/${_sha1}/engine/defoldsdk_headers.zip"

    bsdtar -xf defoldsdk_headers.zip
}

pkgver() {
    cd "$srcdir"

    _version=$(cat info.json | jq -r '.version')
    _sha1=$(cat info.json | jq -r '.sha1')
    echo "${_version}.r${_sha1:0:7}"
}

package() {
    cd "$srcdir"

    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    mkdir -p "$pkgdir/usr/include"

    cp -r defoldsdk/include "$pkgdir/usr/include/defoldsdk"
    cp -r defoldsdk/sdk/include/dmsdk "$pkgdir/usr/include/defoldsdk"
}