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-07-11 10:58:58 +00:00
|
|
|
PKG_VERSION="e275e9d64e5286a26c1c6c7648d67003388bfdfc"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_SITE="https://github.com/libretro/RetroArch"
|
2022-03-31 11:35:14 +00:00
|
|
|
PKG_URL="${PKG_SITE}.git"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_LICENSE="GPLv3"
|
2022-07-11 10:58:58 +00:00
|
|
|
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"
|
|
|
|
|
2022-03-31 11:35:14 +00:00
|
|
|
PKG_PATCH_DIRS+="${DEVICE}"
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
pre_configure_target() {
|
|
|
|
TARGET_CONFIGURE_OPTS=""
|
2022-07-11 10:58:58 +00:00
|
|
|
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
|
|
|
|
2022-07-15 10:18:39 +00:00
|
|
|
case ${ARCH} in
|
|
|
|
arm)
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-neon"
|
|
|
|
PKG_DEPENDS_TARGET+=" librga ${OPENGLES}"
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengles --enable-opengles3 --enable-opengles3_2 --enable-kms --disable-mali_fbdev"
|
|
|
|
;;
|
|
|
|
aarch64)
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-neon"
|
|
|
|
PKG_DEPENDS_TARGET+=" librga ${OPENGLES}"
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengles --enable-opengles3 --enable-opengles3_2 --enable-kms --disable-mali_fbdev"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
PKG_DEPENDS_TARGET+=" ${OPENGL} glu libglvnd vulkan-loader vulkan-headers"
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengl --enable-vulkan --enable-vulkan_display"
|
|
|
|
esac
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-07-15 10:18:39 +00:00
|
|
|
case ${DEVICE} in
|
|
|
|
RG351P)
|
|
|
|
PKG_DEPENDS_TARGET+=" libgo2"
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-odroidgo2"
|
|
|
|
;;
|
|
|
|
esac
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-03-31 11:35:14 +00:00
|
|
|
cd ${PKG_BUILD}
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
make_target() {
|
2022-02-27 03:14:27 +00:00
|
|
|
make HAVE_UPDATE_ASSETS=1 HAVE_LIBRETRODB=1 HAVE_BLUETOOTH=1 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() {
|
|
|
|
if [ "${ARCH}" == "aarch64" ]; then
|
2022-03-31 11:35:14 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/bin
|
|
|
|
cp ${PKG_BUILD}/retroarch ${INSTALL}/usr/bin
|
2022-07-13 21:59:42 +00:00
|
|
|
cp -vP ${ROOT}/build.${DISTRO}-${DEVICE}.arm/retroarch-*/.install_pkg/usr/bin/retroarch ${INSTALL}/usr/bin/retroarch32
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-03-31 11:35:14 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/share/retroarch/filters
|
2022-07-13 21:59:42 +00:00
|
|
|
cp -rvP ${ROOT}/build.${DISTRO}-${DEVICE}.arm/retroarch-*/.install_pkg/usr/share/retroarch/filters/* ${INSTALL}/usr/share/retroarch/filters
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-03-31 11:35:14 +00:00
|
|
|
mkdir -p ${INSTALL}/etc
|
|
|
|
cp ${PKG_BUILD}/retroarch.cfg ${INSTALL}/etc
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-03-31 11:35:14 +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
|
|
|
|
2022-03-31 11:35:14 +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
|
2022-03-31 11:35:14 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/config/retroarch/
|
2022-04-04 17:06:38 +00:00
|
|
|
if [ -d "${PKG_DIR}/sources/${DEVICE}" ]; then
|
2022-04-04 16:43:34 +00:00
|
|
|
cp -rf ${PKG_DIR}/sources/${DEVICE}/* ${INSTALL}/usr/config/retroarch/
|
|
|
|
else
|
|
|
|
cp -rf ${PKG_DIR}/sources/* ${INSTALL}/usr/config/retroarch/
|
|
|
|
fi
|
2022-02-05 14:23:32 +00:00
|
|
|
else
|
2022-03-31 11:35:14 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/bin
|
|
|
|
cp ${PKG_BUILD}/retroarch ${INSTALL}/usr/bin
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-03-31 11:35:14 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/share/retroarch/filters/32bit/video
|
|
|
|
cp ${PKG_BUILD}/gfx/video_filters/*.so ${INSTALL}/usr/share/retroarch/filters/32bit/video
|
|
|
|
cp ${PKG_BUILD}/gfx/video_filters/*.filt ${INSTALL}/usr/share/retroarch/filters/32bit/video
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-03-31 11:35:14 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/share/retroarch/filters/32bit/audio
|
|
|
|
cp ${PKG_BUILD}/libretro-common/audio/dsp_filters/*.so ${INSTALL}/usr/share/retroarch/filters/32bit/audio
|
|
|
|
cp ${PKG_BUILD}/libretro-common/audio/dsp_filters/*.dsp ${INSTALL}/usr/share/retroarch/filters/32bit/audio
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
post_install() {
|
2022-03-16 22:03:28 +00:00
|
|
|
mkdir -p ${INSTALL}/etc/retroarch-joypad-autoconfig
|
2022-05-27 22:33:28 +00:00
|
|
|
cp -r ${PKG_DIR}/gamepads/device/${DEVICE}/* ${INSTALL}/etc/retroarch-joypad-autoconfig
|
2022-03-16 22:03:28 +00:00
|
|
|
|
|
|
|
# Remove unnecesary Retroarch Assets and overlays
|
2022-03-31 11:35:14 +00:00
|
|
|
for i in FlatUX Automatic Systematic branding nuklear nxrgui pkg switch wallpapers zarch
|
|
|
|
do
|
2022-03-16 22:03:28 +00:00
|
|
|
rm -rf "${INSTALL}/usr/share/retroarch-assets/$i"
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in automatic dot-art flatui neoactive pixel retroactive retrosystem systematic convert.sh NPMApng2PMApng.py; do
|
|
|
|
rm -rf "${INSTALL}/usr/share/retroarch-assets/xmb/$i"
|
|
|
|
done
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|