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

60 lines
2.2 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2018-present Frank Hartung (supervisedthinking (@) gmail.com)
PKG_NAME="amiberry"
PKG_ARCH="arm aarch64"
PKG_VERSION="d64358d725e27e7273f93ce290b31abf4ab3b4a9"
PKG_LICENSE="GPLv3"
PKG_SITE="https://github.com/midwan/amiberry"
PKG_URL="${PKG_SITE}.git"
PKG_DEPENDS_TARGET="toolchain linux glibc bzip2 zlib SDL2 SDL2_image SDL2_ttf capsimg freetype libxml2 flac libogg mpg123 libpng libmpeg2"
PKG_LONGDESC="Amiberry is an optimized Amiga emulator for ARM-based boards."
GET_HANDLER_SUPPORT="git"
PKG_TOOLCHAIN="make"
PKG_GIT_CLONE_BRANCH="master"
PKG_PATCH_DIRS+="${DEVICE}"
pre_configure_target() {
cd ${PKG_BUILD}
export SYSROOT_PREFIX=${SYSROOT_PREFIX}
if [[ "${DEVICE}" =~ RG351 ]]
then
AMIBERRY_PLATFORM="PLATFORM=RG351x"
elif [[ "${DEVICE}" =~ RG503 ]] || [[ "${DEVICE}" =~ RG353P ]]
then
AMIBERRY_PLATFORM="PLATFORM=RK3566"
else
AMIBERRY_PLATFORM="PLATFORM=${DEVICE}"
fi
sed -i "s|AS = as|AS \?= as|" Makefile
PKG_MAKE_OPTS_TARGET+="${AMIBERRY_PLATFORM} all SDL_CONFIG=${SYSROOT_PREFIX}/usr/bin/sdl2-config"
}
makeinstall_target() {
# Create directories
mkdir -p ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/usr/lib
mkdir -p ${INSTALL}/usr/config/amiberry
# mkdir -p ${INSTALL}/usr/config/amiberry/controller
# Copy ressources
cp -ra ${PKG_DIR}/config/* ${INSTALL}/usr/config/amiberry/
cp -a data ${INSTALL}/usr/config/amiberry/
cp -a savestates ${INSTALL}/usr/config/amiberry/
cp -a screenshots ${INSTALL}/usr/config/amiberry/
cp -a whdboot ${INSTALL}/usr/config/amiberry/
ln -s /storage/roms/bios ${INSTALL}/usr/config/amiberry/kickstarts
# Create links to Retroarch controller files
ln -s "/usr/share/libretro/autoconfig" "${INSTALL}/usr/config/amiberry/controller"
# Copy binary, scripts & link libcapsimg
cp -a amiberry* ${INSTALL}/usr/bin/amiberry
cp -a ${PKG_DIR}/scripts/* ${INSTALL}/usr/bin
ln -sf /usr/lib/libcapsimage.so.5.1 ${INSTALL}/usr/config/amiberry/capsimg.so
UAE="${INSTALL}/usr/config/amiberry/conf/*.uae"
for i in ${UAE}; do echo -e "gfx_center_vertical=smart\ngfx_center_horizontal=smart" >> $i; done
}