void-packages/srcpkgs/ppsspp/template

86 lines
3.5 KiB
Bash

# Template file for 'ppsspp'
pkgname=ppsspp
version=1.13.2
revision=1
_glslang_commit=dc11adde23c455a24e13dd54de9b4ede8bdd7db8
_SPIRV_Cross_commit=9acb9ec31f5a8ef80ea6b994bb77be787b08d3d1
_armips_commit=7885552b208493a6a0f21663770c446c3ba65576
_discord_rpc_commit=963aa9f3e5ce81a4682c6ca3d136cddda614db33
_miniupnp_commit=3a87be33e797ba947b2b2a5f8d087f6c3ff4d93e
create_wrksrc=yes
build_style=cmake
configure_args="-DHEADLESS=1 -DUSE_SYSTEM_FFMPEG=1 -DUNITTEST=ON
-DUSING_QT_UI=$(vopt_if qt ON OFF) -DUSE_SYSTEM_ZSTD=ON"
hostmakedepends="pkg-config python3 $(vopt_if qt qt5-host-tools)"
makedepends="zlib-devel glew-devel ffmpeg-devel libzip-devel
snappy-devel rapidjson libpng-devel libzstd-devel
$(vopt_if sdl2 SDL2-devel) $(vopt_if wayland wayland-devel)
$(vopt_if qt 'qt5-devel qt5-multimedia-devel')"
depends="desktop-file-utils"
short_desc="Fast and portable PSP emulator"
maintainer="John <me@johnnynator.dev>"
license="GPL-2.0-or-later"
homepage="https://www.ppsspp.org/"
distfiles="
https://github.com/hrydgard/ppsspp/archive/v${version}.tar.gz
https://github.com/hrydgard/glslang/archive/${_glslang_commit}.tar.gz
https://github.com/KhronosGroup/SPIRV-Cross/archive/${_SPIRV_Cross_commit}.tar.gz
https://github.com/Kingcom/armips/archive/${_armips_commit}.tar.gz
https://github.com/discordapp/discord-rpc/archive/${_discord_rpc_commit}.tar.gz
https://github.com/hrydgard/miniupnp/archive/${_miniupnp_commit}.tar.gz"
checksum="1a7d9962ac47feb2bf2866fee9aea7883352a6334a14436d8e02d37a6fa68943
32edc362238d5b1136b2b40b0abdeef5a832e599554d2fcf75d7b08e4b0ed0bb
9423aebd6ea4251c6ea736f0291066eb2b99b6f923151edd1a78ce9c29b46757
f8a03906135fb6f2932b80b7ef5991f39ccac46b36ec3690776fb38c69775c3d
8f4115999391f95f443615fc5b13cb2398926ac4c418d3d34ff5735f71c6faea
1b1d2897f66835ea5eeec5851fe8757aca5afd86984107dcdc0e4b1ce2f2f8be"
# ppsspp always tries to compile x86 unittest
# https://gist.github.com/Johnnynator/e18d59274451cff890b7235009d2e93d
case $XBPS_TARGET_MACHINE in
x86_64* | i686*) configure_args+=" -DUNITTEST=ON";;
armv[67]*) broken="SDL2 is not build against x11";;
ppc*) broken="No JIT support";;
*) configure_args+=" -DUNITTEST=OFF";;
esac
build_options="wayland qt sdl2"
build_options_default="sdl2"
post_extract() {
mv ppsspp-${version}/* .
rmdir -v ${wrksrc}/ext/armips
mv ${wrksrc}/armips-${_armips_commit} ${wrksrc}/ext/armips
rmdir -v ${wrksrc}/ext/glslang
mv ${wrksrc}/glslang-${_glslang_commit} ${wrksrc}/ext/glslang
rmdir -v ${wrksrc}/ext/SPIRV-Cross
mv ${wrksrc}/SPIRV-Cross-${_SPIRV_Cross_commit} ${wrksrc}/ext/SPIRV-Cross
rmdir -v ${wrksrc}/ext/discord-rpc
mv ${wrksrc}/discord-rpc-${_discord_rpc_commit} ${wrksrc}/ext/discord-rpc
rmdir -v ${wrksrc}/ext/miniupnp
mv ${wrksrc}/miniupnp-${_miniupnp_commit} ${wrksrc}/ext/miniupnp
}
post_patch(){
# disable git versioning
vsed -e 's|find_package(Git)|# &|' -i git-version.cmake
}
do_install() {
vlicense LICENSE.TXT
vinstall icons/icon.svg 644 usr/share/pixmaps ppsspp.svg
vinstall Qt/PPSSPP.desktop 644 usr/share/applications
vbin build/PPSSPPHeadless ppsspp-headless
vmkdir usr/share/ppsspp
vcopy build/assets usr/share/ppsspp/
if [ $build_option_sdl2 ]; then
vbin build/PPSSPPSDL ppsspp-sdl
sed -e 's,^Exec=.*,Exec=/usr/bin/ppsspp-sdl,' -i $DESTDIR/usr/share/applications/PPSSPP.desktop
elif [ $build_option_qt ] ;then
vbin build/PPSSPPQt ppsspp-qt
sed -e 's,^Exec=.*,Exec=/usr/bin/ppsspp-qt,' -i $DESTDIR/usr/share/applications/PPSSPP.desktop
fi
sed -e 's,^Icon=.*,Icon=/usr/share/pixmaps/ppsspp.svg,' -i $DESTDIR/usr/share/applications/PPSSPP.desktop
}