distribution/packages/emulators/standalone/dolphin-sa/package.mk

102 lines
3.4 KiB
Makefile
Raw Normal View History

2022-08-05 14:08:26 +00:00
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2022-present JELOS (https://github.com/JustEnoughLinuxOS)
2022-08-05 14:08:26 +00:00
2023-03-17 16:40:00 +00:00
PKG_NAME="dolphin-sa"
2022-08-04 18:19:53 +00:00
PKG_LICENSE="GPLv2"
2023-03-06 21:53:18 +00:00
PKG_DEPENDS_TARGET="toolchain libevdev libdrm ffmpeg zlib libpng lzo libusb zstd ecm openal-soft pulseaudio alsa-lib"
2022-08-04 18:19:53 +00:00
PKG_LONGDESC="Dolphin is a GameCube / Wii emulator, allowing you to play games for these two platforms on PC with improvements. "
2023-01-06 17:25:51 +00:00
PKG_TOOLCHAIN="cmake"
2023-02-17 03:52:24 +00:00
case ${DEVICE} in
2023-06-23 03:14:11 +00:00
RK3588|AMD64|S922X|RK3399)
2023-02-17 03:52:24 +00:00
PKG_SITE="https://github.com/dolphin-emu/dolphin"
PKG_URL="${PKG_SITE}.git"
PKG_VERSION="e6583f8bec814d8f3748f1d7738457600ce0de56"
2023-02-17 03:52:24 +00:00
PKG_PATCH_DIRS+=" wayland"
;;
*)
PKG_SITE="https://github.com/rtissera/dolphin"
PKG_URL="${PKG_SITE}.git"
PKG_VERSION="0b160db48796f727311cea16072174d96b784f80"
PKG_GIT_CLONE_BRANCH="egldrm"
PKG_PATCH_DIRS+=" legacy"
;;
esac
2022-09-02 12:04:24 +00:00
2022-09-02 01:54:45 +00:00
if [ ! "${OPENGL}" = "no" ]; then
2022-09-03 00:15:55 +00:00
PKG_DEPENDS_TARGET+=" ${OPENGL} glu libglvnd"
2023-02-17 03:52:24 +00:00
PKG_CMAKE_OPTS_TARGET+=" -DENABLE_EGL=ON"
2022-09-02 01:54:45 +00:00
fi
if [ "${OPENGLES_SUPPORT}" = yes ]; then
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
2023-02-17 03:52:24 +00:00
PKG_CMAKE_OPTS_TARGET+=" -DENABLE_EGL=ON"
2022-09-02 01:54:45 +00:00
fi
if [ "${DISPLAYSERVER}" = "wl" ]; then
PKG_DEPENDS_TARGET+=" wayland ${WINDOWMANAGER} xwayland xrandr libXi"
2023-10-01 13:32:01 +00:00
PKG_CMAKE_OPTS_TARGET+=" -DENABLE_WAYLAND=ON \
-DENABLE_X11=ON"
else
PKG_CMAKE_OPTS_TARGET+=" -DENABLE_X11=OFF"
fi
if [ "${VULKAN_SUPPORT}" = "yes" ]
then
PKG_DEPENDS_TARGET+=" vulkan-loader vulkan-headers"
2022-10-31 12:44:39 +00:00
PKG_CMAKE_OPTS_TARGET+=" -DENABLE_VULKAN=ON"
else
PKG_CMAKE_OPTS_TARGET+=" -DENABLE_VULKAN=OFF"
2022-09-02 01:54:45 +00:00
fi
pre_configure_target() {
PKG_CMAKE_OPTS_TARGET+=" -DENABLE_HEADLESS=ON \
2022-09-02 12:04:24 +00:00
-DENABLE_EVDEV=ON \
-DUSE_DISCORD_PRESENCE=OFF \
-DBUILD_SHARED_LIBS=OFF \
2022-09-02 12:04:24 +00:00
-DLINUX_LOCAL_DEV=ON \
-DENABLE_PULSEAUDIO=ON \
-DENABLE_ALSA=ON \
2022-09-02 12:04:24 +00:00
-DENABLE_TESTS=OFF \
-DENABLE_LLVM=OFF \
-DENABLE_ANALYTICS=OFF \
-DENABLE_LTO=ON \
-DENABLE_QT=OFF \
2022-09-27 21:09:30 +00:00
-DENCODE_FRAMEDUMPS=OFF \
2023-10-01 13:32:01 +00:00
-DENABLE_CLI_TOOL=OFF"
sed -i 's~#include <cstdlib>~#include <cstdlib>\n#include <cstdint>~g' ${PKG_BUILD}/Externals/VulkanMemoryAllocator/include/vk_mem_alloc.h
sed -i 's~#include <cstdint>~#include <cstdint>\n#include <string>~g' ${PKG_BUILD}/Externals/VulkanMemoryAllocator/include/vk_mem_alloc.h
2022-08-04 18:19:53 +00:00
}
2022-10-31 12:44:39 +00:00
2022-08-04 18:19:53 +00:00
makeinstall_target() {
2022-09-02 12:04:24 +00:00
mkdir -p ${INSTALL}/usr/bin
cp -rf ${PKG_BUILD}/.${TARGET_NAME}/Binaries/dolphin* ${INSTALL}/usr/bin
cp -rf ${PKG_DIR}/scripts/* ${INSTALL}/usr/bin
2022-08-05 14:08:26 +00:00
2022-11-02 14:18:15 +00:00
chmod +x ${INSTALL}/usr/bin/start_dolphin_gc.sh
chmod +x ${INSTALL}/usr/bin/start_dolphin_wii.sh
2022-08-04 18:19:53 +00:00
2022-09-02 12:04:24 +00:00
mkdir -p ${INSTALL}/usr/config/dolphin-emu
cp -rf ${PKG_BUILD}/Data/Sys/* ${INSTALL}/usr/config/dolphin-emu
2022-09-03 00:33:59 +00:00
cp -rf ${PKG_DIR}/config/${DEVICE}/* ${INSTALL}/usr/config/dolphin-emu
2022-08-04 18:19:53 +00:00
}
2023-02-17 03:52:24 +00:00
post_install() {
case ${DEVICE} in
RK356*)
2023-02-17 03:52:24 +00:00
DOLPHIN_PLATFORM="drm"
;;
2023-09-27 05:07:31 +00:00
RK3588)
DOLPHIN_PLATFORM="x11"
;;
2023-02-17 03:52:24 +00:00
*)
DOLPHIN_PLATFORM="wayland"
;;
esac
sed -e "s/@DOLPHIN_PLATFORM@/${DOLPHIN_PLATFORM}/g" \
-i ${INSTALL}/usr/bin/start_dolphin_gc.sh
sed -e "s/@DOLPHIN_PLATFORM@/${DOLPHIN_PLATFORM}/g" \
-i ${INSTALL}/usr/bin/start_dolphin_wii.sh
}