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)
|
2023-10-24 16:00:57 +00:00
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
PKG_NAME="retroarch"
|
2023-11-25 14:53:55 +00:00
|
|
|
PKG_VERSION="f091b5a9e9475255e5efaded5f95c9750fdfe15e"
|
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"
|
2023-10-11 19:58:23 +00:00
|
|
|
PKG_DEPENDS_TARGET="toolchain SDL2 alsa-lib libass 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"
|
|
|
|
|
2023-10-11 19:58:23 +00:00
|
|
|
if [ "${PIPEWIRE_SUPPORT}" = "yes" ]; then
|
|
|
|
PKG_DEPENDS_TARGET+=" pipewire"
|
|
|
|
fi
|
|
|
|
|
2022-07-31 01:16:59 +00:00
|
|
|
PKG_PATCH_DIRS+=" ${DEVICE}"
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2023-08-13 10:37:18 +00:00
|
|
|
PKG_CONFIGURE_OPTS_TARGET=" --disable-qt \
|
|
|
|
--enable-alsa \
|
|
|
|
--enable-udev \
|
|
|
|
--disable-opengl1 \
|
|
|
|
--disable-opengl \
|
|
|
|
--disable-opengles \
|
|
|
|
--disable-opengles3 \
|
|
|
|
--disable-opengles3_2 \
|
|
|
|
--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
|
|
|
|
2023-08-29 12:43:12 +00:00
|
|
|
case ${PROJECT} in
|
|
|
|
Rockchip)
|
|
|
|
PKG_DEPENDS_TARGET+=" librga"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2023-08-13 10:37:18 +00:00
|
|
|
case ${DEVICE} in
|
|
|
|
RK3566-X55)
|
2023-08-29 12:43:12 +00:00
|
|
|
PKG_DEPENDS_TARGET+=" libgo2"
|
2023-08-13 10:37:18 +00:00
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-odroidgo2"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --disable-odroidgo2"
|
|
|
|
;;
|
|
|
|
esac
|
2023-04-25 23:32:51 +00:00
|
|
|
|
2023-08-13 10:37:18 +00:00
|
|
|
case ${ARCH} in
|
|
|
|
arm)
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-neon"
|
|
|
|
;;
|
2022-07-15 10:18:39 +00:00
|
|
|
aarch64)
|
2023-08-13 10:37:18 +00:00
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --disable-neon"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ "${DISPLAYSERVER}" = "wl" ]; then
|
|
|
|
PKG_DEPENDS_TARGET+=" wayland ${WINDOWMANAGER}"
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-wayland"
|
|
|
|
fi
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2023-08-13 10:37:18 +00:00
|
|
|
if [ ! "${OPENGL}" = "no" ]; then
|
|
|
|
PKG_DEPENDS_TARGET+=" ${OPENGL} glu libglvnd"
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengl"
|
|
|
|
else
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --disable-opengl"
|
|
|
|
fi
|
2022-08-30 00:38:12 +00:00
|
|
|
|
2023-08-13 10:37:18 +00:00
|
|
|
if [ "${OPENGLES_SUPPORT}" = yes ] && \
|
|
|
|
[[ ! "${ARCH}" =~ i*86|x86_64 ]]; then
|
|
|
|
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-opengles --enable-opengles3 --enable-opengles3_2 --enable-kms"
|
|
|
|
else
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --disable-opengles --disable-opengles3 --disable-opengles3_2"
|
|
|
|
fi
|
2022-08-30 00:32:44 +00:00
|
|
|
|
2023-08-13 10:37:18 +00:00
|
|
|
if [ "${VULKAN_SUPPORT}" = "yes" ]
|
|
|
|
then
|
|
|
|
PKG_DEPENDS_TARGET+=" vulkan-loader vulkan-headers"
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET+=" --enable-vulkan --enable-vulkan_display"
|
|
|
|
fi
|
2022-08-30 00:32:44 +00:00
|
|
|
|
2023-08-13 10:37:18 +00:00
|
|
|
pre_configure_target() {
|
|
|
|
CFLAGS+=" -DUDEV_TOUCH_SUPPORT"
|
|
|
|
CXXFLAGS+=" -DUDEV_TOUCH_SUPPORT"
|
|
|
|
TARGET_CONFIGURE_OPTS=""
|
2022-08-30 00:32:44 +00:00
|
|
|
|
2022-03-31 11:35:14 +00:00
|
|
|
cd ${PKG_BUILD}
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
make_target() {
|
2022-07-30 23:34:43 +00:00
|
|
|
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 ; }
|
2023-03-01 23:49:56 +00:00
|
|
|
make -C gfx/video_filters compiler=$CC extra_flags="$CFLAGS"
|
2022-02-05 14:23:32 +00:00
|
|
|
[ $? -eq 0 ] && echo "(video filters ok)" || { echo "(video filters failed)" ; exit 1 ; }
|
2023-03-01 23:49:56 +00:00
|
|
|
make -C libretro-common/audio/dsp_filters compiler=$CC extra_flags="$CFLAGS"
|
2022-02-05 14:23:32 +00:00
|
|
|
[ $? -eq 0 ] && echo "(audio filters ok)" || { echo "(audio filters failed)" ; exit 1 ; }
|
|
|
|
}
|
|
|
|
|
|
|
|
makeinstall_target() {
|
2022-09-01 12:19:58 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/bin
|
|
|
|
cp ${PKG_BUILD}/retroarch ${INSTALL}/usr/bin
|
|
|
|
mkdir -p ${INSTALL}/usr/share/retroarch/filters
|
|
|
|
|
2023-02-21 05:31:19 +00:00
|
|
|
case ${ARCH} in
|
|
|
|
aarch64)
|
2023-04-04 19:19:27 +00:00
|
|
|
if [ -f ${ROOT}/build.${DISTRO}-${DEVICE}.arm/retroarch-*/.install_pkg/usr/bin/retroarch ]; then
|
|
|
|
cp -vP ${ROOT}/build.${DISTRO}-${DEVICE}.arm/retroarch-*/.install_pkg/usr/bin/retroarch ${INSTALL}/usr/bin/retroarch32
|
|
|
|
mkdir -p ${INSTALL}/usr/share/retroarch/filters/32bit/
|
|
|
|
cp -rvP ${ROOT}/build.${DISTRO}-${DEVICE}.arm/retroarch-*/.install_pkg/usr/share/retroarch/filters/64bit/* ${INSTALL}/usr/share/retroarch/filters/32bit/
|
|
|
|
fi
|
2023-02-21 05:31:19 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2022-09-01 12:19:58 +00:00
|
|
|
mkdir -p ${INSTALL}/etc
|
|
|
|
cp ${PKG_BUILD}/retroarch.cfg ${INSTALL}/etc
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-09-01 12:19:58 +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-09-01 12:19:58 +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
|
|
|
|
2022-09-01 12:19:58 +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
|
2022-09-01 12:19:58 +00:00
|
|
|
echo "Configure retroarch for ${DEVICE}"
|
|
|
|
exit 1
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
2022-10-01 00:40:33 +00:00
|
|
|
|
|
|
|
# Make sure the shader directories exist for overlayfs.
|
|
|
|
for dir in common-shaders glsl-shaders slang-shaders
|
|
|
|
do
|
|
|
|
mkdir -p ${INSTALL}/usr/share/${dir}
|
|
|
|
touch ${INSTALL}/usr/share/${dir}/.overlay
|
|
|
|
done
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
post_install() {
|
2022-07-30 23:34:43 +00:00
|
|
|
enable_service tmp-cores.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
|
|
|
}
|