distribution/packages/emulators/standalone/mednafen/package.mk

57 lines
1.4 KiB
Makefile
Raw Normal View History

# SPDX-License-Identifier: GPL-2.0-or-later
2023-11-05 14:17:52 +00:00
# Copyright (C) 2023-present sydarn (https://github.com/asoderq)
PKG_NAME="mednafen"
PKG_VERSION="1.31.0-UNSTABLE"
PKG_LICENSE="mixed"
PKG_SITE="https://mednafen.github.io/"
PKG_URL="${PKG_SITE}/releases/files/${PKG_NAME}-${PKG_VERSION}.tar.xz"
PKG_DEPENDS_TARGET="toolchain SDL2 libegl"
PKG_TOOLCHAIN="configure"
pre_configure_target() {
# unsupported modules
DISABLED_MODULES+=" --disable-apple2 \
2023-11-05 14:17:52 +00:00
--disable-sasplay \
--disable-ssfplay"
case ${DEVICE} in
2023-11-05 14:17:52 +00:00
RK3326|RK3566)
DISABLED_MODULES+=" --disable-snes \
--disable-ss \
--disable-psx"
;;
2023-11-05 14:17:52 +00:00
S922X|RK3399|RK3588)
DISABLED_MODULES+=" --disable-ss"
;;
esac
PKG_CONFIGURE_OPTS_TARGET="${DISABLED_MODULES}"
}
makeinstall_target() {
mkdir -p ${INSTALL}/usr/bin
cp -rf ${PKG_BUILD}/.${TARGET_NAME}/src/mednafen ${INSTALL}/usr/bin
cp -rf ${PKG_DIR}/scripts/* ${INSTALL}/usr/bin
chmod +x ${INSTALL}/usr/bin/start_mednafen.sh
2023-11-05 14:17:52 +00:00
chmod +x ${INSTALL}/usr/bin/mednafen_gen_config.sh
mkdir -p ${INSTALL}/usr/config/${PKG_NAME}
2023-11-05 14:17:52 +00:00
cp ${PKG_DIR}/config/common/* ${INSTALL}/usr/config/${PKG_NAME}
}
post_install() {
case ${DEVICE} in
S922X)
LIBEGL="export SDL_VIDEO_GL_DRIVER=\/usr\/lib\/egl\/libGL.so.1 SDL_VIDEO_EGL_DRIVER=\/usr\/lib\/egl\/libEGL.so.1"
;;
*)
LIBEGL=""
;;
esac
sed -e "s/@LIBEGL@/${LIBEGL}/g" \
-i ${INSTALL}/usr/bin/start_mednafen.sh
}