summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 90509f1dba94617171fe1860e408bc7209fde2f9 (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
_pkgname=ericw-tools
pkgname=${_pkgname}-git
pkgver=0.18.2.rc1.r2115.g9f7ba657
pkgrel=1
pkgdesc="Quake/Hexen 2 Map compiling tools"
arch=('x86_64')
url="https://ericwa.github.io/ericw-tools"
_giturl="https://github.com/ericwa/ericw-tools"
license=('GPL3')
depends=('embree3' 'groff' 'tbb')
makedepends=('cmake' 'git' 'python-sphinx' 'python-sphinx-furo')
provides=(${_pkgname})
conflicts=(${_pkgname})
source=("${_pkgname}::git+${_giturl}.git#branch=brushbsp"
    "fmt::git+https://github.com/fmtlib/fmt.git"
    "json::git+https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent.git"
    "nanobench::git+https://github.com/martinus/nanobench"
    "pareto::git+https://github.com/alandefreitas/pareto.git"
    "doctest::git+https://github.com/doctest/doctest"
)
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

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

prepare() {
    cd $_pkgname
    git config submodule.lib/fmt.url ../fmt
    git config submodule.3rdparty/json.url ../json
    git config submodule.3rdparty/nanobench.url ../nanobench
    git config submodule.3rdparty/pareto.url ../pareto
    git config submodule.3rdparty/doctest.url ../doctest
    git submodule update
}

build() {
    cmake -S ${_pkgname} -B build \
        -DCMAKE_BUILD_TYPE=None \
        -DCMAKE_INSTALL_PREFIX=/usr
    cmake --build build
}

package() {
    _files=(qbsp vis light bspinfo bsputil)
    for _i in "${_files[@]}"
    do
      install -Dm755 build/${_i}/${_i} "$pkgdir"/usr/bin/${_i}
    done
    
    cd build/docs/docs/sphinx/
    rm -r .doctrees/ .buildinfo
    find . -type f -exec install -Dm644 "{}" "${pkgdir}"/usr/share/doc/${_pkgname}/{} \;
}