2022-02-05 14:23:32 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2019 Trond Haugland (trondah@gmail.com)
|
|
|
|
|
2023-03-17 21:06:43 +00:00
|
|
|
PKG_NAME="mame-lr"
|
2024-02-18 02:19:44 +00:00
|
|
|
PKG_VERSION="8ebaec4073703f5050dac3f6c8da408943e15938"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_ARCH="any"
|
|
|
|
PKG_LICENSE="GPLv2"
|
|
|
|
PKG_SITE="https://github.com/libretro/mame"
|
2023-02-24 13:53:43 +00:00
|
|
|
PKG_URL="https://github.com/libretro/mame/archive/${PKG_VERSION}.tar.gz"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_DEPENDS_TARGET="toolchain zlib flac sqlite expat"
|
|
|
|
PKG_SECTION="libretro"
|
|
|
|
PKG_SHORTDESC="MAME - Multiple Arcade Machine Emulator"
|
|
|
|
PKG_TOOLCHAIN="make"
|
2022-12-28 02:10:32 +00:00
|
|
|
PKG_BUILD_FLAGS="-lto +pic"
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-11-03 10:28:20 +00:00
|
|
|
case ${TARGET_ARCH} in
|
|
|
|
arm|aarch64)
|
2022-11-05 11:43:45 +00:00
|
|
|
MAME_PLATFORM="PLATFORM=arm64"
|
|
|
|
CROSS_BUILD="1"
|
|
|
|
PTR64=0
|
2022-11-03 10:28:20 +00:00
|
|
|
;;
|
2022-11-05 11:43:45 +00:00
|
|
|
*)
|
|
|
|
CROSS_BUILD="0"
|
|
|
|
PTR64=1
|
2022-11-03 10:28:20 +00:00
|
|
|
;;
|
|
|
|
esac
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
PKG_MAKE_OPTS_TARGET="REGENIE=1 \
|
|
|
|
VERBOSE=1 \
|
|
|
|
NOWERROR=1 \
|
|
|
|
OPENMP=1 \
|
2022-11-05 11:43:45 +00:00
|
|
|
CROSS_BUILD=${CROSS_BUILD} \
|
2022-02-05 14:23:32 +00:00
|
|
|
TOOLS=0 \
|
|
|
|
RETRO=1 \
|
2022-11-05 11:43:45 +00:00
|
|
|
PTR64=${PTR64} \
|
2022-02-05 14:23:32 +00:00
|
|
|
NOASM=0 \
|
|
|
|
PYTHON_EXECUTABLE=python3 \
|
|
|
|
CONFIG=libretro \
|
|
|
|
LIBRETRO_OS=unix \
|
|
|
|
LIBRETRO_CPU= \
|
2022-11-05 11:43:45 +00:00
|
|
|
${MAME_PLATFORM} \
|
2022-02-05 14:23:32 +00:00
|
|
|
ARCH= \
|
|
|
|
TARGET=mame \
|
|
|
|
SUBTARGET=mame \
|
|
|
|
OSD=retro \
|
|
|
|
USE_SYSTEM_LIB_EXPAT=1 \
|
|
|
|
USE_SYSTEM_LIB_ZLIB=1 \
|
|
|
|
USE_SYSTEM_LIB_FLAC=1 \
|
|
|
|
USE_SYSTEM_LIB_SQLITE3=1"
|
|
|
|
|
|
|
|
pre_configure_target() {
|
|
|
|
sed -i "s/-static-libstdc++//g" scripts/genie.lua
|
|
|
|
}
|
|
|
|
|
|
|
|
make_target() {
|
|
|
|
unset ARCH
|
|
|
|
unset DISTRO
|
|
|
|
unset PROJECT
|
2022-11-03 10:28:20 +00:00
|
|
|
if [ "${PLATFORM}" = "arm64" ]
|
|
|
|
then
|
|
|
|
export ARCHOPTS="-D__aarch64__ -DASMJIT_BUILD_X86"
|
|
|
|
fi
|
2023-02-27 02:56:16 +00:00
|
|
|
make ${PKG_MAKE_OPTS_TARGET} OVERRIDE_CC=${CC} OVERRIDE_CXX=${CXX} OVERRIDE_LD=$LD AR=${AR} ${MAKEFLAGS}
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
makeinstall_target() {
|
2023-02-24 13:53:43 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/lib/libretro
|
|
|
|
cp *.so ${INSTALL}/usr/lib/libretro/mame_libretro.so
|
|
|
|
mkdir -p ${INSTALL}/usr/config/retroarch/savefiles/mame/hi
|
|
|
|
cp plugins/hiscore/hiscore.dat ${INSTALL}/usr/config/retroarch/savefiles/mame/hi
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|