summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 36be9cf284e00d877505dfeba46e09ff11d8663c (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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# Maintainer: Severin Kaderli <severin@kaderli.dev>
# Contributor: aimileus < $(echo YWltaWxpdXNAcHJvdG9ubWFpbC5jb20K | base64 -d)
_pkgname=vita3k
pkgname=${_pkgname}-git
pkgver=r1293.164267bb
pkgrel=1
pkgdesc="Experimental PlayStation Vita emulator"
arch=('x86_64')
url="https://vita3k.org/"
license=('GPL2')
makedepends=(
	'clang'
	'cmake'
	'git'
	'python'
	'vulkan-headers'
	'glslang'
	'gtest'
)
depends=(
	'boost'
	'gtk3'
	'sdl2'
	'capstone'
	'spdlog'
	'unicorn'
	'yaml-cpp'
	'pugixml'
	'ffmpeg'
	'vulkan-icd-loader'
	'elfio'
	'stb'
	'discord-rpc-api'
)
provides=('vita3k')
conflicts=('vita3k')
source=(
	"git+https://github.com/vita3k/vita3k.git"
	"git+https://github.com/serge1/ELFIO.git"
	"git+https://github.com/aquynh/capstone.git"
	"git+https://github.com/vitasdk/vita-headers.git"
	"git+https://github.com/jbeder/yaml-cpp.git"
	"git+https://github.com/Vita3K/vita-toolchain.git"
	"git+https://github.com/jonasmr/microprofile.git"
	"git+https://github.com/tcbrindle/sdl2-cmake-scripts.git"
	"git+https://github.com/gabime/spdlog.git"
	"git+https://github.com/nothings/stb.git"
	"git+https://github.com/tronkko/dirent.git"
	"git+https://github.com/B-Con/crypto-algorithms.git"
	"git+https://github.com/ocornut/imgui.git"
	"git+https://github.com/google/googletest.git"
	"git+https://github.com/Vita3K/shaders-db.git"
	"git+https://github.com/KhronosGroup/glslang.git"
	"git+https://github.com/vita3k/SPIRV-Cross.git"
	"git+https://github.com/Vita3K/ext-boost.git"
	"git+https://github.com/Vita3K/dlmalloc.git"
	"git+https://github.com/vita3k/printf.git"
	"git+https://github.com/ocornut/imgui_club.git"
	"git+https://github.com/unicorn-engine/unicorn.git"
	"git+https://github.com/discordapp/discord-rpc.git"
	"git+https://github.com/zeux/pugixml.git"
	"git+https://github.com/aantron/better-enums.git"
	"git+https://github.com/illusionman1212/nativefiledialog-cmake.git"
	"git+https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git"
	"git+https://github.com/Vita3K/sdl.git"
	"git+https://github.com/Vita3K/libfat16.git"
)
md5sums=(
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
	'SKIP'
)

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

prepare() {
	cd "${_pkgname}"
	git submodule init
	git config submodule.src/external/elfio.url "${srcdir}/ELFIO"
	git config submodule.src/external/capstone.url "${srcdir}/capstone"
	git config submodule.src/external/vita-headers.url "${srcdir}/vita-headers"
	git config submodule.src/external/yaml-cpp.url "${srcdir}/yaml-cpp"
	git config submodule.src/external/vita-toolchain.url "${srcdir}/vita-toolchain"
	git config submodule.src/external/microprofile.url "${srcdir}/microprofile"
	git config submodule.src/external/sdl2-cmake-scripts.url "${srcdir}/sdl2-cmake-scripts"
	git config submodule.src/external/spdlogs.url "${srcdir}/spdlog"
	git config submodule.src/external/stb.url "${srcdir}/stb"
	git config submodule.src/external/dirent.url "${srcdir}/dirent"
	git config submodule.src/external/crypto-algorithms.url "${srcdir}/crypto-algorithms"
	git config submodule.src/external/imgui.url "${srcdir}/imgui"
	git config submodule.src/external/googletest.url "${srcdir}/googletest"
	git config submodule.src/external/shaders-db.url "${srcdir}/shaders-db"
	git config submodule.src/external/glslang.url "${srcdir}/glslang"
	git config submodule.src/external/SPIRV-Cross.url "${srcdir}/SPIRV-Cross"
	git config submodule.src/external/boost.url "${srcdir}/ext-boost"
	git config submodule.src/external/dlmalloc.url "${srcdir}/dlmalloc"
	git config submodule.src/external/printf.url "${srcdir}/printf"
	git config submodule.src/external/imgui_club.url "${srcdir}/imgui_club"
	git config submodule.src/external/unicorn-src.url "${srcdir}/unicorn"
	git config submodule.src/external/discord-rpc.url "${srcdir}/discord-rpc"
	git config submodule.src/external/pugixml.url "${srcdir}/pugixml"
	git config submodule.src/external/better-enums.url "${srcdir}/better-enums"
	git config submodule.src/external/nativefiledialog-cmake.url "${srcdir}/nativefiledialog-cmake"
	git config submodule.src/external/VulkanMemoryAllocator.url "${srcdir}/VulkanMemoryAllocator"
	git config submodule.src/external/libfat16.url "${srcdir}/libfat16"
	git submodule update
}

build() {
	cd "${_pkgname}"

	# Clang is needed for the build to work for now
	export CC="/usr/bin/clang"
	export CXX="/usr/bin/clang++"

	# Set the python
	PYTHON_INCLUDE_PATH="$(python -c "from sysconfig import get_paths as gp; print(gp()['include'])")"
	export CPATH="${PYTHON_INCLUDE_PATH}"
	./gen-linux.sh

	# Workaround for linking problem with discord-rpc
	rm -rf build-linux
	mkdir -p build-linux
	cd build-linux
	cmake .. -DUSE_DISCORD_RICH_PRESENCE=OFF

	make UNICORN_QEMU_FLAGS="--python=/usr/bin/python2"
}

package() {
	cd "${_pkgname}"

	install -d -m 755 "${pkgdir}/usr/bin/"
	install -d -m 755 "${pkgdir}/opt/vita3k/"

	cp -r "build-linux/bin/"* "${pkgdir}/opt/vita3k/"
	ln -s "/opt/vita3k/Vita3K" "${pkgdir}/usr/bin/vita3k"

	# This folder needs 777 permissions because vita3k creates a log file
	chmod 777 "${pkgdir}/opt/vita3k/"

	install -Dm644 "README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}