summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cebad336589015629035687d29e8a8830b6449e5 (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
# Maintainer: Claudia Pellegrino <aur ├Ąt cpellegrino.de>
# Contributor: Julien Savard <juju@juju2143.ca>
pkgname=x16-emulator
pkgver=r43
pkgrel=1
pkgdesc="An emulator for The 8-Bit Guy's Commander X16"
arch=('x86_64')
url="http://commanderx16.com/"
license=('BSD')
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=(
    '4b4f8f2aa02d074b4c7f1686dca65ea5'
    'c0b5ba5190ef5ee4dd8e58433f261e35'
    '5cd0550d2af1b4267c9b9f30eed9691e'
)

prepare() {
    cd "$pkgname-$pkgver"
    patch -uN < ../fix-git-rev.patch
    patch -uN src/main.c ../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
    CC="clang ${CFLAGS} -Wno-macro-redefined" 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"
}