summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ebad9ad21d4c71ba8083ce378e5cd36c5e0611de (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
pkgname=godot-mono
pkgver=3.0.2
pkgrel=1
pkgdesc="An advanced, feature packed, multi-platform 2D and 3D game engine."
arch=('x86_64')
url="https://godotengine.org/"
license=('MIT')
depends=('mono>=5.4.0' 'xterm' 'msbuild-stable')
optdepends=('dotnet-sdk')
makedepends=(
    'scons>=3.0' 
    'libxcursor' 
    'libxinerama' 
    'libxi' 
    'libxrandr' 
    'mesa' 
    'glu' 
    'alsa-lib' 
    'pulseaudio'
    'freetype2'
    'gcc'
    'pkg-config'
    'msbuild'
    'rsync'
)
provides=('godot-mono')
conflicts=('godot-mono-bin')
source=(${pkgname}::git+https://github.com/godotengine/godot.git)
md5sums=('SKIP')

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

    #Checkout actual version of Godot
    git checkout ${pkgver}-stable

    #Build temporary binaries to generate needed files for mono support
    TERM=xterm scons platform=x11 tools=yes module_mono_enabled=yes mono_glue=no
    bin/godot.x11.tools.64.mono --generate-mono-glue modules/mono/glue

    # Build normal binaries
    TERM=xterm scons platform=x11 target=release_debug tools=yes module_mono_enabled=yes bits=64
}

package() {
    install -d \
        "${pkgdir}/opt/${pkgname}/" \
        "${pkgdir}/usr/bin/" \
        "${pkgdir}/usr/share/applications/"

    rsync -a \
        "${srcdir}/${pkgname}/bin" "${pkgdir}/opt/${pkgname}"

    # I have to use TERM=xterm because of an bug in mono
    cat > "${pkgdir}/usr/bin/${pkgname}" <<-EOF
		#!/usr/bin/env bash
		TERM=xterm /opt/godot-mono/bin/godot.x11.opt.tools.64.mono
	EOF
    
    chmod a+x ${pkgdir}/usr/bin/${pkgname}

    install -Dm644 \
        "${srcdir}/${pkgname}/icon.svg" \
        "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${pkgname}.svg"

    cat > "${pkgdir}/usr/share/applications/${pkgname}.desktop" <<-EOF
		[Desktop Entry]
		Type=Application
		Name=Godot-Mono
		GenericName=Godot 2D and 3D game engine
		Comment=Godot is an Open-Source game engine for 2D and 3D games
		Keywords=game-dev;development;
		Categories=Development;
		Exec=/usr/bin/${pkgname}
		Icon=${pkgname}
	EOF
}