summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c5b5a5b454b5378017a0e829c1a5a8b4c7353084 (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
# Maintainer: Daniel Bermond < gmail-com: danielbermond >

pkgname=mupen64plus-extraplugins-git
pkgver=20180827.053244
pkgrel=2
pkgdesc='Additional plugins for Mupen64Plus (git version)'
arch=('i686' 'x86_64')
url='https://www.mupen64plus.org/'
license=('GPL' 'CC0-1.0')
depends=('mupen64plus' 'sdl2' 'glew')
makedepends=('git')
provides=('mupen64plus-extraplugins')
conflicts=('mupen64plus-extraplugins')
source=('git+https://github.com/mupen64plus/mupen64plus-rsp-z64.git'
        'git+https://github.com/mupen64plus/mupen64plus-rsp-cxd4.git'
        'git+https://github.com/mupen64plus/mupen64plus-video-arachnoid.git'
        'git+https://github.com/mupen64plus/mupen64plus-video-z64.git'
        'git+https://github.com/mupen64plus/mupen64plus-video-glide64.git')
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

_m64p_plugins='rsp-z64 rsp-cxd4 video-arachnoid video-z64 video-glide64'

pkgver() {
    local _date
    local _latest_date
    local _plugin
    
    for _plugin in $_m64p_plugins
    do
        cd "${srcdir}/mupen64plus-${_plugin}"
        
        _date="$(TZ='UTC' date -d "$(git log -1 --date='short' --pretty='format:%ci')" '+%Y%m%d.%H%M%S')"
        
        [ "$(vercmp "$_date" "$_latest_date")" -gt '0' ] && _latest_date="$_date"
    done
    
    printf '%s\n' "${_latest_date}"
}

build() {
    local _plugin
    
    for _plugin in $_m64p_plugins
    do
        printf '%s\n' "  -> Building plugin '${_plugin}'..."
        make -C "mupen64plus-${_plugin}/projects/unix" clean $@
        make -C "mupen64plus-${_plugin}/projects/unix" all $@
    done
}

package() {
    local _plugin
    
    for _plugin in $_m64p_plugins
    do
        printf '%s\n' "************************************ Installing ${_plugin} plugin"
        
        make -C "mupen64plus-${_plugin}/projects/unix" PREFIX='/usr' DESTDIR="$pkgdir" LDCONFIG='true' install $@
    done
}