summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 507e3668e9f323006ef4c99c1a797e3fdf581895 (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
# Maintainer: Alexandre Bouvier <contact@amb.tf>
_pkgname=libretro-melondsds
pkgname=$_pkgname-git
pkgver=1.2.0.r1.g5d2ece5
pkgrel=1
pkgdesc="Nintendo DS core"
arch=('aarch64' 'armv7h' 'i486' 'i686' 'pentium4' 'x86_64')
url="https://github.com/JesseTG/melonds-ds"
license=('GPL-3.0-or-later')
groups=('libretro')
depends=('gcc-libs' 'glibc' 'libretro-core-info>=1.17')
makedepends=('cmake>=3.19' 'git' 'libgl')
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
source=(
	"$_pkgname::git+$url.git"
	"date::git+https://github.com/HowardHinnant/date.git"
	"embed-binaries::git+https://github.com/andoalon/embed-binaries.git"
	"fmt::git+https://github.com/fmtlib/fmt.git"
	"glm::git+https://github.com/g-truc/glm.git"
	"jessetg-libretro-common::git+https://github.com/JesseTG/libretro-common.git"
	"jessetg-libslirp::git+https://github.com/JesseTG/libslirp-mirror.git"
	"jessetg-melonds::git+https://github.com/JesseTG/melonDS.git"
	"pntr::git+https://github.com/RobLoach/pntr.git"
	"span-lite::git+https://github.com/martinmoene/span-lite.git"
	"yamc::git+https://github.com/yohhoy/yamc.git"
	"zlib::git+https://github.com/madler/zlib.git"
)
b2sums=(
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
)

pkgver() {
	cd $_pkgname
	git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	local options=(
		-D CMAKE_BUILD_TYPE=Release
		-D CMAKE_C_FLAGS_RELEASE="-DNDEBUG"
		-D CMAKE_CXX_FLAGS_RELEASE="-DNDEBUG"
		-D CMAKE_POLICY_VERSION_MINIMUM=3.5
		-D DATE_REPOSITORY_URL="$srcdir"/date
		-D EMBED_BINARIES_REPOSITORY_URL="$srcdir"/embed-binaries
		-D FMT_REPOSITORY_URL="$srcdir"/fmt
		-D GLM_REPOSITORY_URL="$srcdir"/glm
		-D LIBRETRO_COMMON_REPOSITORY_URL="$srcdir"/jessetg-libretro-common
		-D LIBSLIRP_REPOSITORY_URL="$srcdir"/jessetg-libslirp
		-D MELONDS_REPOSITORY_URL="$srcdir"/jessetg-melonds
		-D PNTR_REPOSITORY_URL="$srcdir"/pntr
		-D SPAN_LITE_REPOSITORY_URL="$srcdir"/span-lite
		-D YAMC_REPOSITORY_URL="$srcdir"/yamc
		-D ZLIB_REPOSITORY_URL="$srcdir"/zlib
		-Wno-dev
	)
	cmake "${options[@]}" -B build -S $_pkgname
	cmake --build build
}

package() {
	depends+=('libOpenGL.so')
	# shellcheck disable=SC2154
	install -D -t "$pkgdir"/usr/lib/libretro build/src/libretro/melondsds_libretro.so
	install -Dm644 build/melondsds-LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}