Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-emulation/ppsspp/
Date: Tue, 04 Apr 2017 21:14:11
Message-Id: 1491340442.051286e08843fc07d1561486ad0fb2eabdf0472b.monsieurp@gentoo
1 commit: 051286e08843fc07d1561486ad0fb2eabdf0472b
2 Author: soredake <fdsfgs <AT> krutt <DOT> org>
3 AuthorDate: Tue Apr 4 13:11:03 2017 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 4 21:14:02 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=051286e0
7
8 games-emulation/ppsspp: update 9999 version.
9
10 Closes: https://github.com/gentoo/gentoo/pull/4342
11
12 games-emulation/ppsspp/ppsspp-9999.ebuild | 138 +++++++++---------------------
13 1 file changed, 42 insertions(+), 96 deletions(-)
14
15 diff --git a/games-emulation/ppsspp/ppsspp-9999.ebuild b/games-emulation/ppsspp/ppsspp-9999.ebuild
16 index 16ca5dd693f..ff8656b6a2d 100644
17 --- a/games-emulation/ppsspp/ppsspp-9999.ebuild
18 +++ b/games-emulation/ppsspp/ppsspp-9999.ebuild
19 @@ -1,127 +1,73 @@
20 -# Copyright 1999-2016 Gentoo Foundation
21 +# Copyright 1999-2017 Gentoo Foundation
22 # Distributed under the terms of the GNU General Public License v2
23
24 -EAPI=5
25 +EAPI=6
26
27 -inherit eutils cmake-utils qt4-r2 git-r3
28 +inherit eutils cmake-utils git-r3
29
30 DESCRIPTION="A PSP emulator written in C++."
31 -HOMEPAGE="http://www.ppsspp.org/"
32 -EGIT_REPO_URI="git://github.com/hrydgard/${PN}.git"
33 +HOMEPAGE="https://www.ppsspp.org/"
34 +EGIT_REPO_URI="https://github.com/hrydgard/${PN}.git"
35
36 LICENSE="GPL-2"
37 SLOT="0"
38 -KEYWORDS=""
39 -IUSE="qt4 qt5 +sdl"
40 +IUSE="+qt5 sdl headless libav"
41 REQUIRED_USE="
42 - ?? ( qt4 qt5 sdl )
43 + !headless? ( || ( qt5 sdl ) )
44 + ?? ( qt5 sdl )
45 "
46 +EGIT_SUBMODULES=( '*' '-ffmpeg' )
47
48 -RDEPEND=""
49 -
50 -DEPEND="
51 - sys-libs/zlib
52 +RDEPEND="sys-libs/zlib
53 + !libav? ( media-video/ffmpeg:= )
54 + libav? ( media-video/libav:= )
55 sdl? (
56 - dev-util/cmake
57 media-libs/libsdl
58 media-libs/libsdl2
59 )
60 - qt4? (
61 - dev-qt/qtsvg:4
62 - dev-qt/qtgui:4
63 - dev-qt/qtcore:4
64 - dev-qt/qtopengl:4
65 - dev-qt/qtmultimedia:4
66 - dev-qt/qt-mobility[multimedia]
67 - )
68 qt5? (
69 - dev-qt/qtsvg:5
70 - dev-qt/qtgui:5
71 + dev-db/sqlite
72 + dev-qt/assistant:5
73 dev-qt/qtcore:5
74 - dev-qt/qtopengl:5
75 + dev-qt/qtdeclarative:5
76 + dev-qt/qtgui:5
77 dev-qt/qtmultimedia:5
78 + dev-qt/qtopengl:5
79 + dev-qt/qtsvg:5
80 + dev-qt/qtwebkit:5
81 dev-qt/qtwidgets:5
82 - dev-qt/qt-mobility[multimedia]
83 - )
84 -"
85 + )"
86
87 -src_unpack() {
88 - git-r3_fetch
89 - git-r3_checkout
90 - if use qt4 ; then
91 - cd "${WORKDIR}"/"${P}"/Qt || die
92 - qt4-r2_src_unpack
93 - elif use qt5 ; then
94 - cd "${WORKDIR}"/"${P}"/Qt || die
95 - qt4-r2_src_unpack
96 - fi
97 -}
98 +DEPEND="${RDEPEND}"
99
100 src_prepare() {
101 - sed -i -e "s#-O3#-O2#g;" "${S}"/CMakeLists.txt || die
102 - sed -i -e "s#-O3#-O2#g;" "${S}"/Qt/Settings.pri || die
103 - sed -i -e "s#-O3#-O2#g;" "${S}"/ffmpeg/linux_*.sh || die
104 + # https://github.com/hrydgard/ppsspp/blob/150619c5a341f372266bec86fd874ac5a1343a43/UI/NativeApp.cpp#L318
105 + # patch ppsspp to use /usr/share instead of working dir to find the assets
106 + sed -i 's|VFSRegister("", new AssetsAssetReader());|VFSRegister("", new DirectoryAssetReader("/usr/share/ppsspp/assets/"));|g' UI/NativeApp.cpp || die "Patching qt assets path failed"
107
108 - if use qt4 ; then
109 - cd "${WORKDIR}"/"${P}"/Qt || die
110 - qt4-r2_src_prepare
111 - elif use qt5 ; then
112 - cd "${WORKDIR}"/"${P}"/Qt || die
113 - qt4-r2_src_prepare
114 - else
115 - cmake-utils_src_prepare
116 - fi
117 + sed -i -e "s#-O3#-O2#g;" "${S}"/CMakeLists.txt || die
118 + cmake-utils_src_prepare
119 }
120
121 src_configure() {
122 - if use qt4 ; then
123 - cd "${WORKDIR}"/"${P}"/Qt || die
124 - qt4-r2_src_configure
125 - eqmake4 "${WORKDIR}"/"${P}"/Qt/PPSSPPQt.pro
126 - elif use qt5 ; then
127 - cd "${WORKDIR}"/"${P}"/Qt || die
128 - qt4-r2_src_configure
129 - eqmake5 "${WORKDIR}"/"${P}"/Qt/PPSSPPQt.pro
130 - else
131 - cmake-utils_src_configure
132 - fi
133 -}
134 -
135 -src_compile() {
136 - if use qt4 ; then
137 - cd "${WORKDIR}"/"${P}"/Qt || die
138 - qt4-r2_src_compile
139 - elif use qt5 ; then
140 - cd "${WORKDIR}"/"${P}"/Qt || die
141 - qt4-r2_src_compile
142 - else
143 - cmake-utils_src_compile
144 - fi
145 + local mycmakeargs=(
146 + -DUSING_QT_UI=$(usex qt5)
147 + -DUSE_SYSTEM_FFMPEG=ON
148 + -DHEADLESS=$(usex headless)
149 + )
150 + cmake-utils_src_configure
151 }
152
153 src_install() {
154 - if use qt4 ; then
155 - exeinto /usr/games/bin
156 - newexe "${WORKDIR}"/"${P}"/Qt/ppsspp ppsspp
157 - elif use qt5 ; then
158 - exeinto /usr/games/bin
159 - newexe "${WORKDIR}"/"${P}"/Qt/ppsspp ppsspp
160 - else
161 - exeinto /usr/games
162 - dobin "${FILESDIR}"/ppsspp
163 - exeinto /usr/share/games/"${PN}"
164 - doexe "${WORKDIR}"/"${P}"_build/PPSSPPSDL
165 - insinto /usr/share/games/"${PN}"
166 - doins -r "${WORKDIR}"/"${P}"_build/assets
167 - doins -r "${WORKDIR}"/"${P}"/lang
168 + use headless && dobin "${BUILD_DIR}/PPSSPPHeadless"
169 + insinto /usr/share/"${PN}"
170 + doins -r "${BUILD_DIR}/assets"
171 + if use qt5 || use sdl ; then
172 + dobin "${BUILD_DIR}/PPSSPP$(usex qt5 Qt SDL)"
173 + local i
174 + for i in 16 24 32 48 64 96 128 256 512 ; do
175 + doicon -s ${i} "icons/hicolor/${i}x${i}/apps/${PN}.png"
176 + done
177 + make_desktop_entry "PPSSPP$(usex qt5 Qt SDL)" "PPSSPP ($(usex qt5 Qt SDL))" "${PN}" "Game"
178 fi
179 - insinto /usr/share/icons/
180 - newins "${WORKDIR}"/"${P}"/source_assets/image/icon_regular_72.png ppsspp-icon.png
181 - domenu "${FILESDIR}"/ppsspp.desktop
182 -}
183 -
184 -pkg_postinst() {
185 - elog "Remember, in order to play games, you have to "
186 - elog "be in the 'games' group. "
187 - elog "Just run 'gpasswd -a <USER> games', then have <USER> re-login. "
188 }