summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6da96546f674b701b8aa39f652041271f619ddf9 (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: Simon Eriksson <simon.eriksson.1187+aur AT gmail.com>

pkgname=('libdragon-git' 'libdragon-tools-git')
pkgver=r121.2889e4e
pkgrel=1
url="http://www.dragonminded.com/n64dev/libdragon"
arch=('x86_64')
license=('custom:UNLICENSE')
makedepends=('git' 'mips64-elf-gcc-stage1')
depends=('libpng' 'mips64-elf-newlib')
source=("git://github.com/DragonMinded/libdragon.git")
sha256sums=('SKIP')

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

build(){
  cd libdragon
  N64_INST=/usr make
  N64_INST=/usr make tools
}

package_libdragon-git(){
  pkgdesc="Open source library for Nintendo 64 game development"
  options=('!buildflags' '!strip' '!emptydirs')
  provides=('libdragon')
  conflicts=('libdragon')
  arch=('any')
  depends=('mips64-elf-newlib')
  install='libdragon.install'
  
  cd libdragon
  
  mkdir -p "${pkgdir}/etc/profile.d/"
  echo 'export N64_INST=/usr' > "${pkgdir}/etc/profile.d/libdragon.sh"
  chmod 755 "${pkgdir}/etc/profile.d/libdragon.sh"

  mkdir -p "${pkgdir}/usr/mips64-elf/"{include,lib}
  make INSTALLDIR="${pkgdir}/usr" install 

  # strip it manually
  find "${pkgdir}/usr/mips64-elf/lib" -type f -exec /usr/bin/mips64-elf-strip --strip-unneeded {} \; 2>/dev/null || true

  #install license
  install -D -m644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_libdragon-tools-git() {
  pkgdesc="Open source tools for Nintendo 64 development"
  options=()
  provides=('libdragon-tools')
  conflicts=('libdragon-tools')
  arch=('i686' 'x86_64')
  depends=('libpng')

  cd libdragon
  mkdir -p "${pkgdir}/usr/bin"
  make -j1 INSTALLDIR="${pkgdir}/usr" tools-install

  #install license
  install -D -m644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}