summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8c0786d180d5203d27b62913bfb22cca4df54dc8 (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: Darks <l.gatin@protonmail.com>
_basename="gint"
_branch="master"
pkgname="${_basename}-git"
pkgver=r222.589c25c
pkgrel=1
pkgdesc='Alternative library and kernel for add-in development on fx-9860G and fx-CG50'
url='https://gitea.planet-casio.com/Lephenixnoir/gint'
arch=('i686' 'x86_64')
depends=('fxsdk' 'sh-elf-gcc-casio' 'python-pillow')
makedepends=('git')
source=("${pkgname}::git+https://gitea.planet-casio.com/Lephenixnoir/${_basename}.git#branch=${_branch}")
options=("!strip")
sha256sums=("SKIP")

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

prepare() {
  cd "$srcdir/${pkgname}"
  #git checkout compat

  # Ensure clean builds
  [[ -d fx-build ]] && rm -rf fx-build
  mkdir fx-build
  [[ -d cg-build ]] && rm -rf cg-build
  mkdir cg-build
}

build() {
  # Build for fx9860g
  cd "$srcdir/${pkgname}/fx-build"
  ../configure --target=fx9860g
  make

  # Build for fx-cg50
  cd "$srcdir/${pkgname}/cg-build"
  ../configure --target=fxcg50
  make
}

package() {
  _prefix=$(sh-elf-gcc --print-search-dirs | sed -rn "s#install: (.+)/#\1#p")

  # Install for fx9860g
  cd "$srcdir/${pkgname}/fx-build"
  make PREFIX="$pkgdir${_prefix}" install
  
  # Install for fx-cg50
  cd "$srcdir/${pkgname}/cg-build"
  make PREFIX="$pkgdir${_prefix}" install
}