summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fbfea073633f5197ccb91591074923d40b6ed4a9 (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
# Maintainer: Jochem Broekhoff <(lastname) dot (firstname) @ gmail.com>
pkgname=marble-marcher-ce
_pkgtag=1.4.5
pkgver=$(echo "${_pkgtag}" | sed "s/-//;s/v//")
pkgrel=1
pkgdesc="A video game demo that uses a fractal physics engine and fully procedural rendering to produce beautiful and unique gameplay unlike anything you've seen before."
arch=('x86_64')
license=('GPL2')
url="https://github.com/WAUthethird/Marble-Marcher-Community-Edition"

depends=("sfml"
         "anttweakbar"
         "glm"
         "eigen"
         "glew")

makedepends=("git"
             "cmake")

source=("${pkgname}::git+https://github.com/WAUthethird/Marble-Marcher-Community-Edition#tag=${_pkgtag}")
sha256sums=("SKIP")

prepare() {
    # Patch CMakeLists.txt with the correct prefix
    # NOTE: This is a temporary solution
    sed -e "s/\\/home\\/MMCE/\\/usr\\/share\\/${pkgname}/" \
        -i "${pkgname}/CMakeLists.txt"
}

build() {
    cd "${pkgname}"

    mkdir -p build
    cd build
    cmake ..
    cd ..
    cmake --build build
}

package() {
    cd "${pkgname}/build"

    # General install
    DESTDIR="${pkgdir}/" make install

    # Launcher script
    mkdir -p "${pkgdir}/usr/bin"
    cat >"${pkgdir}/usr/bin/${pkgname}" <<EOF
#!/bin/sh
cd "/usr/share/${pkgname}"
./MarbleMarcher                      
EOF
    chmod 755 "${pkgdir}/usr/bin/${pkgname}"

    # Desktop Entry
    mkdir -p "${pkgdir}/usr/share/applications"
    cat >"${pkgdir}/usr/share/applications/${pkgname}.desktop" <<EOF
[Desktop Entry]
Version=${pkgver}
Type=Application
Name=Marble Marcher: Community Edition
Icon=/usr/share/${pkgname}/images/MarbleMarcher.png
Exec=/usr/bin/${pkgname}
Categories=Game;
Terminal=false
EOF
    chmod 644 "${pkgdir}/usr/share/applications/${pkgname}.desktop"

    # Licenses
    install -Dm644 "${srcdir}/${pkgname}/LICENSE" \
            "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}