summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 12a34cd89fc6840054831d3befc41859dcf328bb (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
65
# Maintainer: Pellegrino Prevete <pellegrinoprevete@gmail.com>

# shellcheck disable=SC2034
_pkg="psdevkit"
_target="arm-none-eabi"
_platform="pocket-station"
pkgbase="${_platform}-devkit"
pkgname=("${_platform}-tools"
         "${_platform}-example-app")
pkgver=v
pkgrel=1
pkgdesc='A Sony PocketStation development kit.'
arch=('any')
license=('custom')
_license="mixed"
_gitlab="https://gitlab.com/tallero"
_local="ssh://git@127.0.0.1:/home/git"
url="${_gitlab}/${_pkg}"
depends=("psx-mc-cli")
_gccver="55"
_include="/usr/${_target}/include"
makedepends=("${_target}-gcc${_gccver}"
             "${_target}-newlib")
checkdepends=('shellcheck')
optdepends=()
_commit="09f9caa59bdc257a254824bcdb4065bbfaa864af"
source=( # "${_pkg}::git+${_local}/${_pkg}#commit=${_commit}"
         "${_pkg}::git+${_gitlab}/${_pkg}#commit=${_commit}")
sha256sums=('SKIP')

pkgver() {
  cd "${_pkg}" || exit
  echo "v$(git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')"
}

# shellcheck disable=SC2154
package_pocket-station-tools() {
  local _bin="${pkgdir}/usr/bin" _dir
  local _pin="${srcdir}/bin"
  mkdir -p "${_pin}"
  mkdir -p "${_bin}"
  cd "${_pkg}/tools" || exit
  for _dir in $(ls .); do
    cd "${_dir}"
    # arm-none-eabi-gcc -o "./${_dir}" \
    #                        --specs=nosys.specs \
    #                        -I"${_include}" \
    #                        "main.c"
    gcc -o "./${_dir}" "main.c"
    mv "${_dir}" "${_pin}"
    cd ..
  done
  cp "${_pin}/"* "${_bin}"
}

# shellcheck disable=SC2154
package_pocket-station-example-app() {
  local _pin="${srcdir}/bin"
  cd "${_pkg}/Example" || exit
  ls
  PATH="${PATH}:${_pin}" make
  "${_pin}/bin2mcs" "BESNESP00000GAMETEST" test.bin test.mcs
  ls
  # make DESTDIR="${pkgdir}" PREFIX='/usr' install
}