distribution/packages/games/emulators/retroarch/package.mk

127 lines
4.2 KiB
Makefile
Raw Normal View History

2022-02-05 14:23:32 +00:00
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2021-present 351ELEC (https://github.com/351ELEC)
PKG_NAME="retroarch"
2022-08-22 21:02:24 +00:00
PKG_VERSION="e1a139ec0f26aed87c1ff9042e733e2c4b1df39b"
2022-02-05 14:23:32 +00:00
PKG_SITE="https://github.com/libretro/RetroArch"
PKG_URL="${PKG_SITE}.git"
2022-02-05 14:23:32 +00:00
PKG_LICENSE="GPLv3"
PKG_DEPENDS_TARGET="toolchain SDL2 alsa-lib openssl freetype zlib retroarch-assets core-info ffmpeg libass joyutils empty nss-mdns openal-soft libogg libvorbisidec libvorbis libvpx libpng libdrm pulseaudio miniupnpc flac"
2022-02-05 14:23:32 +00:00
PKG_LONGDESC="Reference frontend for the libretro API."
GET_HANDLER_SUPPORT="git"
PKG_PATCH_DIRS+=" ${DEVICE}"
2022-02-05 14:23:32 +00:00
pre_configure_target() {
TARGET_CONFIGURE_OPTS=""
PKG_CONFIGURE_OPTS_TARGET=" --disable-qt \
--enable-alsa \
--enable-udev \
--disable-opengl1 \
--disable-opengl \
--disable-wayland \
--disable-x11 \
--enable-zlib \
--enable-freetype \
--disable-discord \
--disable-vg \
--disable-sdl \
--enable-sdl2 \
--enable-ffmpeg"
2022-07-03 14:45:21 +00:00
case ${ARCH} in
arm)
2022-08-30 00:32:44 +00:00
PKG_CONFIGURE_OPTS_TARGET+=" --enable-neon"
;;
aarch64)
2022-08-30 00:32:44 +00:00
PKG_CONFIGURE_OPTS_TARGET+=" --disable-neon"
;;
*)
esac
2022-02-05 14:23:32 +00:00
2022-08-30 00:38:12 +00:00
if [ "${DISPLAYSERVER}" = "wl" ]; then
2022-09-02 01:54:45 +00:00
PKG_DEPENDS_TARGET+=" wayland ${WINDOWMANAGER}"
2022-08-30 00:38:12 +00:00
PKG_CONFIGURE_OPTS_TARGET+=" --enable-wayland"
fi
2022-08-30 00:32:44 +00:00
if [ ! "${OPENGL}" = "no" ]; then
2022-09-03 00:15:55 +00:00
PKG_DEPENDS_TARGET+=" ${OPENGL} glu libglvnd"
2022-08-30 00:32:44 +00:00
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengl"
fi
if [ "${OPENGLES_SUPPORT}" = yes ]; then
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengles --enable-opengles3 --enable-opengles3_2 --enable-kms --disable-mali_fbdev"
fi
if [ "${VULKAN_SUPPORT}" = "yes" ]
then
PKG_DEPENDS_TARGET+=" vulkan-loader vulkan-headers"
PKG_CONFIGURE_OPTS_TARGET+=" --enable-vulkan --enable-vulkan_display"
fi
2022-08-13 10:45:38 +00:00
case ${DEVICE} in
2022-09-02 14:01:53 +00:00
RG351P)
2022-08-14 10:21:43 +00:00
PKG_DEPENDS_TARGET+=" librga libgo2"
PKG_CONFIGURE_OPTS_TARGET+=" --enable-odroidgo2"
;;
esac
2022-02-05 14:23:32 +00:00
cd ${PKG_BUILD}
2022-02-05 14:23:32 +00:00
}
make_target() {
make HAVE_UPDATE_ASSETS=0 HAVE_LIBRETRODB=1 HAVE_BLUETOOTH=0 HAVE_NETWORKING=1 HAVE_ZARCH=1 HAVE_QT=0 HAVE_LANGEXTRA=1
2022-02-05 14:23:32 +00:00
[ $? -eq 0 ] && echo "(retroarch ok)" || { echo "(retroarch failed)" ; exit 1 ; }
make -C gfx/video_filters compiler=$CC extra_flags="$CFLAGS"
[ $? -eq 0 ] && echo "(video filters ok)" || { echo "(video filters failed)" ; exit 1 ; }
make -C libretro-common/audio/dsp_filters compiler=$CC extra_flags="$CFLAGS"
[ $? -eq 0 ] && echo "(audio filters ok)" || { echo "(audio filters failed)" ; exit 1 ; }
}
makeinstall_target() {
mkdir -p ${INSTALL}/usr/bin
cp ${PKG_BUILD}/retroarch ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/usr/share/retroarch/filters
2022-02-05 14:23:32 +00:00
if [ "${ARCH}" == "aarch64" ]; then
cp -vP ${ROOT}/build.${DISTRO}-${DEVICE}.arm/retroarch-*/.install_pkg/usr/bin/retroarch ${INSTALL}/usr/bin/retroarch32
cp -rvP ${ROOT}/build.${DISTRO}-${DEVICE}.arm/retroarch-*/.install_pkg/usr/share/retroarch/filters/* ${INSTALL}/usr/share/retroarch/filters
fi
2022-02-05 14:23:32 +00:00
mkdir -p ${INSTALL}/etc
cp ${PKG_BUILD}/retroarch.cfg ${INSTALL}/etc
2022-02-05 14:23:32 +00:00
mkdir -p ${INSTALL}/usr/share/retroarch/filters/64bit/video
cp ${PKG_BUILD}/gfx/video_filters/*.so ${INSTALL}/usr/share/retroarch/filters/64bit/video
cp ${PKG_BUILD}/gfx/video_filters/*.filt ${INSTALL}/usr/share/retroarch/filters/64bit/video
2022-02-05 14:23:32 +00:00
mkdir -p ${INSTALL}/usr/share/retroarch/filters/64bit/audio
cp ${PKG_BUILD}/libretro-common/audio/dsp_filters/*.so ${INSTALL}/usr/share/retroarch/filters/64bit/audio
cp ${PKG_BUILD}/libretro-common/audio/dsp_filters/*.dsp ${INSTALL}/usr/share/retroarch/filters/64bit/audio
2022-02-05 14:23:32 +00:00
# General configuration
mkdir -p ${INSTALL}/usr/config/retroarch/
if [ -d "${PKG_DIR}/sources/${DEVICE}" ]; then
cp -rf ${PKG_DIR}/sources/${DEVICE}/* ${INSTALL}/usr/config/retroarch/
2022-02-05 14:23:32 +00:00
else
echo "Configure retroarch for ${DEVICE}"
exit 1
2022-02-05 14:23:32 +00:00
fi
}
post_install() {
mkdir -p ${INSTALL}/etc/retroarch-joypad-autoconfig
if [ -d "${PKG_DIR}/gamepads/device/${DEVICE}" ]
then
cp -r ${PKG_DIR}/gamepads/device/${DEVICE}/* ${INSTALL}/etc/retroarch-joypad-autoconfig ||:
fi
enable_service tmp-cores.mount
enable_service tmp-joypads.mount
enable_service tmp-database.mount
enable_service tmp-assets.mount
enable_service tmp-shaders.mount
enable_service tmp-overlays.mount
2022-02-05 14:23:32 +00:00
}