summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dd6e8f441959e1f7cfb3ea127d1a17ad08a50133 (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
# Maintainer: Alexandre Bouvier <contact@amb.tf>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
_pkgname=libretro-dolphin
pkgname=$_pkgname-git
pkgver=r33044.89a4df725d
pkgrel=1
pkgdesc="Nintendo GameCube/Wii core"
arch=('x86_64')
url="https://github.com/libretro/dolphin"
license=('GPL-2.0-or-later')
groups=('libretro')
depends=(
	'enet'
	'gcc-libs'
	'glibc'
	'libretro-core-info'
	'libx11'
	'libxi'
	'libxrandr'
	'pugixml'
)
makedepends=(
	'bluez-libs'
	'bzip2'
	'cmake'
	'cubeb'
	'curl'
	'fmt'
	'git'
	'hidapi'
	'libegl'
	'libevdev'
	'libpng'
	'libsystemd'
	'libusb'
	'lzo'
	'mbedtls2'
	'python'
	'sfml'
	'xorgproto'
	'xxhash'
	'xz'
	'zlib'
	'zstd'
)
provides=("$_pkgname=${pkgver#r}")
conflicts=("$_pkgname")
source=(
	"$_pkgname::git+$url.git"
	'use-system-libs.patch'
)
b2sums=(
	'SKIP'
	'5c21d83d249ec4205aa75c4cef4d322c1c0c332496133b698ca08bd2a63eb1f2cce3968125924125ac44547b5db200a1228e77fe26862082632cd0c8ca37e01c'
)

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

prepare() {
	patch -d $_pkgname -Np1 < use-system-libs.patch
}

build() {
	cmake -S $_pkgname -B build \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
		-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
		-DENABLE_LTO=OFF \
		-DENABLE_TESTS=OFF \
		-DLIBRETRO=ON \
		-DUSE_SHARED_ENET=ON \
		-Wno-dev
	cmake --build build
}

package() {
	depends+=(
		'libbluetooth.so'
		'libbz2.so'
		'libcubeb.so'
		'libcurl.so'
		'libEGL.so'
		'libevdev.so'
		'libfmt.so'
		'libGLX.so'
		'libhidapi-hidraw.so'
		'liblzma.so'
		'liblzo2.so'
		'libmbedcrypto.so'
		'libmbedtls.so'
		'libmbedx509.so'
		'libpng16.so'
		'libsfml-network.so'
		'libsfml-system.so'
		'libudev.so'
		'libusb-1.0.so'
		'libxxhash.so'
		'libz.so'
		'libzstd.so'
	)
	# shellcheck disable=SC2154
	install -D -t "$pkgdir"/usr/lib/libretro build/dolphin_libretro.so
}