summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e88753e6c35d2298cd365c86a4b7164b8d86150a (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
# Maintainer: Claudia Pellegrino <aur ├Ąt cpellegrino.de>
# Contributor: Julien Savard <juju@juju2143.ca>
pkgname=x16-emulator
pkgver=r47
pkgrel=1
pkgdesc="An emulator for The 8-Bit Guy's Commander X16"
arch=('x86_64')
url="http://commanderx16.com/"
license=('BSD-2-Clause')
groups=('commander-x16')
depends=('sdl2' "x16-rom=${pkgver}")
makedepends=('clang' 'gendesk' 'pandoc')

source=(
    "$pkgname-$pkgver.tar.gz::https://github.com/X16Community/$pkgname/archive/$pkgver.tar.gz"
    "fix-git-rev.patch"
    "modify-base-path.patch"
)

md5sums=(
    'cc8f7dfee465748ac38152cbb9b7aa37'
    '26c41ecd2e2676eaa7237334c8cb4bd7'
    '0e76560b039fb58a85b4448ff6b64eb6'
)

prepare() {
    cd "$pkgname-$pkgver"
    patch -uN -p1 < ../fix-git-rev.patch
    patch -uN -p1 < ../modify-base-path.patch
    sed -i -e 's/^\(LDFLAGS=.*\)/\1 '"${LDFLAGS}/" Makefile
    gendesk -f -n --pkgname "$pkgname" --pkgdesc "$pkgdesc" --name "X16 Emulator" --icon "$pkgname" --exec "x16emu" --categories "Game;Emulator"
}

build() {
    cd "$pkgname-$pkgver"
    # https://aur.archlinux.org/packages/x16-emulator#comment-827725
    export CC="clang ${CFLAGS} -Wno-macro-redefined"
    export CXX="clang++ ${CXXFLAGS}"
    make
    pandoc --from gfm --to html -c github-pandoc.css --standalone --metadata pagetitle="X16 Emulator" README.md --output README.html
}

package() {
    cd "$pkgname-$pkgver"
    install -Dm755 x16emu "$pkgdir/usr/bin/x16emu"
    install -Dm755 makecart "$pkgdir/usr/bin/makecart"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    install -Dm644 github-pandoc.css "$pkgdir/usr/share/doc/$pkgname/github-pandoc.css"
    install -Dm644 README.html "$pkgdir/usr/share/doc/$pkgname/README.html"
    install -Dm644 RELEASES.md "$pkgdir/usr/share/doc/$pkgname/RELEASES.md"
    install -Dm644 quickstart-linux.md "$pkgdir/usr/share/doc/$pkgname/quickstart-linux.md"
    install -Dm644 .gh/logo.png "$pkgdir/usr/share/pixmaps/$pkgname.png"
    install -Dm644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
}