summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 736966792d567221353926b3143a26e382c79656 (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
# Maintainer: Aaron Fischer <mail@aaron-fischer.net>
# Co-maintainer: Spike29 <leguen.yannick@gmail.com>
# Contributor: J0k3r <moebius282 at gmail dot com>

pkgname=netradiant-git
pkgver=r2557.757a17fb
pkgrel=2
epoch=1
pkgdesc='The open source, cross platform level editor for idtech games (GtkRadiant fork)'
url='https://netradiant.gitlab.io/'
license=('Apache-2.0' 'BSD-3-Clause' 'GPL-2.0-or-later' 'LGPL-2.1-or-later' 'MIT' 'Zlib')
arch=('i686' 'x86_64')
depends=('bash' 'cairo' 'gdk-pixbuf2' 'gcc-libs' 'glibc' 'glib2' 'gtk2' 'gtkglext' 'libglvnd' 'libjpeg-turbo'
         'libpng' 'libwebp' 'libxml2' 'libx11' 'minizip' 'pango' 'zlib')
makedepends=('cmake' 'git' 'make' 'svn' 'unzip' 'wget')
provides=('netradiant' 'h2data' 'q2map' 'q3data' 'q3map2' 'qdata3')
source=("${pkgname}::git+https://gitlab.com/xonotic/netradiant.git"
        "git+https://github.com/DaemonEngine/crunch.git")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}/"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

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

    # Fetch the Crunch submodule
    git submodule init
    git config submodule.libs/crunch.url "${srcdir}/crunch"
    git -c protocol.file.allow=always submodule update
}

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

    # Workaround for https://gitlab.com/xonotic/netradiant/-/issues/194
    export CFLAGS+=" -Wno-error=incompatible-pointer-types"

    # Possible values for the GAMEPACKS_LICENSE_LIST filter are "free",
    # "all" (free + proprietary) and "none".
    # If you only want to fetch the Unvanquished and Xonotic gamepacks for example,
    # use -DGAMEPACKS_LICENSE_LIST=none and -DGAMEPACKS_NAME_LIST="Unvanquished Xonotic".
    # See https://gitlab.com/xonotic/netradiant/-/blob/master/README.md for further instructions.
    cmake -G "Unix Makefiles" -S. -Bbuild \
    -DCMAKE_BUILD_TYPE=Release \
    -DOpenGL_GL_PREFERENCE=GLVND \
    -DFHS_INSTALL=ON \
    -DCMAKE_INSTALL_PREFIX="${pkgdir}/usr" \
    -DRADIANT_ABOUTMSG="NetRadiant git build for Arch Linux" \
    -DDOWNLOAD_GAMEPACKS=ON \
    -DGAMEPACKS_LICENSE_LIST=free \
    -DGAMEPACKS_NAME_LIST=none

    cmake --build build
}

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

    cmake --install build
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm644 "../crunch/license.txt" "${pkgdir}/usr/share/licenses/${pkgname}/crunch/license.txt"
    
    # Running update-mime-database will erase the map mime type anyway
    rm -r "${pkgdir}/usr/share/mime/"
}