summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b0a208c21880047c61a7077c650c99ef53f2adae (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Maintainer: Dobroslaw Kijowski <dobo90_at_gmail.com>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Duck Hunt <vaporeon@tfwno.gf>

_pkgname=libretro-ppsspp
pkgname=libretro-ppsspp-rbp
pkgver=30123
pkgrel=1
pkgdesc='Sony PlayStation Portable core (build for Raspberry Pi)'
arch=(armv7h)
url=https://github.com/libretro/ppsspp
license=(GPL2)
groups=(libretro)
provides=("${_pkgname}=${pkgver}")
conflicts=("${_pkgname}")
depends=(
  ffmpeg
  libegl
  libretro-core-info
  libzip
  snappy
  zstd
)
makedepends=(
  cmake
  git
  mesa
  ninja
  python
)
_commit=8d7f57c4721e450a94c04238c8db3b39ca8f6a72
source=(
  libretro-ppsspp::git+https://github.com/hrydgard/ppsspp.git#commit=${_commit}
  git+https://github.com/Kingcom/armips.git
  git+https://github.com/discordapp/discord-rpc.git
  ppsspp-glslang::git+https://github.com/hrydgard/glslang.git
  git+https://github.com/hrydgard/ppsspp-lang.git
  ppsspp-miniupnp::git+https://github.com/hrydgard/miniupnp.git
  git+https://github.com/Tencent/rapidjson.git
  git+https://github.com/KhronosGroup/SPIRV-Cross.git
  armips-tinyformat::git+https://github.com/Kingcom/tinyformat.git
  libretro-ppsspp-assets-path.patch
  libretro-ppsspp-system-zstd.patch
)
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'c00fabec601ebf3e209871fe409d047ab47040c199e9e8e5f9ba0abdd9086ce6'
            'c65ae3f20976a573b1a74600b02515e3f665513864a49e10db57c2fd170819e7')

pkgver() {
  cd libretro-ppsspp

  git rev-list --count HEAD
}

prepare() {
  cd libretro-ppsspp

  #patch -Np1 -i ../libretro-ppsspp-assets-path.patch
  patch -Np1 -i ../libretro-ppsspp-system-zstd.patch

  for submodule in assets/lang ext/glslang ext/miniupnp; do
    git submodule init ${submodule}
    git config submodule.${submodule}.url ../ppsspp-${submodule#*/}
    git submodule update ${submodule}
  done
  for submodule in ext/{armips,rapidjson,SPIRV-Cross}; do
    git submodule init ${submodule}
    git config submodule.${submodule}.url ../${submodule#*/}
    git submodule update ${submodule}
  done

  cd ext/armips

  for submodule in ext/tinyformat; do
    git submodule init ${submodule}
    git config submodule.${submodule}.url ../../../armips-${submodule#*/}
    git submodule update ${submodule}
  done
}

build() {
  cmake -S libretro-ppsspp -B build -G Ninja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_SKIP_RPATH=ON \
    -DUSING_GLES2=yes \
    -DHEADLESS=OFF \
    -DLIBRETRO=ON \
    -DMOBILE_DEVICE=OFF \
    -DSIMULATOR=OFF \
    -DUNITTEST=OFF \
    -DUSE_SYSTEM_LIBZIP=ON \
    -DUSE_SYSTEM_SNAPPY=ON \
    -DUSE_SYSTEM_ZSTD=ON \
    -DUSING_QT_UI=OFF \
    -Wno-dev \
    -DUSE_FFMPEG=yes \
    -DUSE_SYSTEM_FFMPEG=yes
  cmake --build build
}

package() {
  install -Dm 644 build/lib/ppsspp_libretro.so -t "${pkgdir}"/usr/lib/libretro/
  install -Dm 644 libretro-ppsspp/LICENSE.TXT -t "${pkgdir}"/usr/share/licenses/libretro-ppsspp/
  install -dm 755 "${pkgdir}"/usr/share/libretro/ppsspp
  cp -dr --no-preserve=ownership build/assets "${pkgdir}"/usr/share/libretro/ppsspp/
}

# vim: ts=2 sw=2 et: