summaryrefslogtreecommitdiff
path: root/games-emulation/ppsspp/ppsspp-1.20.4-r1.ebuild
blob: 2ca538e7c049f8f3d81ab35e4a30328332422444 (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
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{13..14} )

inherit flag-o-matic python-any-r1 xdg cmake

DESCRIPTION="A PSP emulator written in C++"
HOMEPAGE="https://www.ppsspp.org/
	https://github.com/hrydgard/ppsspp/"

if [[ "${PV}" == *9999* ]] ; then
	inherit git-r3

	EGIT_REPO_URI="https://github.com/hrydgard/${PN}"
else
	SRC_URI="https://github.com/hrydgard/${PN}/releases/download/v${PV}/${P}.tar.xz"

	KEYWORDS="amd64"
fi

LICENSE="Apache-2.0 BSD BSD-2 GPL-2 JSON MIT"
SLOT="0"
IUSE="discord test wayland"
RESTRICT="!test? ( test )"

RDEPEND="
	>=media-libs/sdl2-ttf-2.24.0
	>=media-video/ffmpeg-5:=
	app-arch/snappy:=
	app-arch/zstd:=
	dev-libs/libzip:=
	media-libs/glew:=
	media-libs/libpng:=
	media-libs/libsdl2[X,opengl,sound,video,wayland?]
	media-libs/libsdl2[joystick]
	virtual/opengl
	virtual/zlib:=
"
DEPEND="
	${RDEPEND}
"
BDEPEND="
	${PYTHON_DEPS}
"

PATCHES=(
	"${FILESDIR}/${PN}-1.17.1-SpvBuilder-cstdint.patch"
	"${FILESDIR}/${PN}-1.17.1-cmake-cxx.patch"
)

pkg_setup() {
	python-any-r1_pkg_setup
}

src_prepare() {
	find . -type f \
		\( -iname "*CMakeLists.txt*" -or -iname "*-config.cmake" \) \
		-exec \
		sed -e "/^cmake_minimum_required/I s|(.*)|(VERSION 3.20)|g" -i {} \; \
		|| die

	# rm -f -r ext/freetype || die

	cmake_src_prepare
}

src_configure() {
	# bug https://bugs.gentoo.org/926079
	filter-lto

	local -a mycmakeargs=(
		-DBUILD_SHARED_LIBS="OFF"
		-DCMAKE_SKIP_RPATH="ON"
		-DUSE_CCACHE="OFF"

		-DUSE_SYSTEM_FFMPEG="ON"
		-DUSE_SYSTEM_LIBZIP="ON"
		-DUSE_SYSTEM_SNAPPY="ON"
		-DUSE_SYSTEM_ZSTD="ON"

		-DATLAS_TOOL="OFF"
		-DHEADLESS="OFF"
		-DUSING_QT_UI="OFF"
		-DUSE_DISCORD="$(usex discord)"
		-DUSE_WAYLAND_WSI="$(usex wayland)"
		-DUNITTEST="$(usex test)"
	)
	cmake_src_configure
}

src_test() {
	cmake_src_test -E "glslang-testsuite|matrix_transpose"
}

src_install(){
	cmake_src_install

	# > /usr/lib64/libfreetype.a and other trash
	rm -f -r "${ED}/usr/include" || die
	rm -f -r "${ED}/usr/lib64" || die
}