scummvm: fix aarch64 build

- fix aarch64 detection to properly enable neon
- add msys2 refs
- install license file
This commit is contained in:
Raed Rizqie 2025-07-28 00:58:38 +08:00 committed by Maksim Bondarenkov
parent 048102b116
commit 771f142584
2 changed files with 71 additions and 11 deletions

View File

@ -0,0 +1,29 @@
--- a/configure
+++ b/configure
@@ -325,12 +325,15 @@
#localedir='${datarootdir}/locale'
# For cross compiling
-_host=""
-_host_cpu=""
+_host="$host"
+_host_cpu="$host_cpu"
_host_vendor=""
_host_os=""
_host_alias=""
+_build="$build"
+_build_cpu="$build_cpu"
+
_port_mk="ports.mk"
# Use temp files in the build directory
@@ -3480,7 +3483,7 @@
;;
esac
-if test -n "$_host"; then
+if test "$_host" != "$_build" ; then
# Cross-compiling mode - add your target here if needed
echo "Cross-compiling to $_host"
case "$_host" in

View File

@ -4,14 +4,16 @@ _realname=scummvm
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.9.1
pkgrel=1
pkgdesc="A 'virtual machine' for several classic graphical point-and-click adventure games. (mingw-w64)"
pkgrel=2
pkgdesc="A 'virtual machine' for several classic graphical point-and-click adventure games (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://www.scummvm.org/'
msys2_repository_url='https://github.com/scummvm/scummvm'
msys2_documentation_url='https://docs.scummvm.org/'
license=("spdx:GPL-3.0-or-later")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-autotools")
"${MINGW_PACKAGE_PREFIX}-pkgconf")
depends=("${MINGW_PACKAGE_PREFIX}-cc-libs"
"${MINGW_PACKAGE_PREFIX}-a52dec"
"${MINGW_PACKAGE_PREFIX}-curl"
@ -22,22 +24,42 @@ depends=("${MINGW_PACKAGE_PREFIX}-cc-libs"
"${MINGW_PACKAGE_PREFIX}-fribidi"
"${MINGW_PACKAGE_PREFIX}-glew"
"${MINGW_PACKAGE_PREFIX}-libjpeg-turbo"
"${MINGW_PACKAGE_PREFIX}-libmpcdec"
"${MINGW_PACKAGE_PREFIX}-libogg"
"${MINGW_PACKAGE_PREFIX}-libopenmpt"
"${MINGW_PACKAGE_PREFIX}-libvorbis"
"${MINGW_PACKAGE_PREFIX}-libmad"
"${MINGW_PACKAGE_PREFIX}-libmpeg2-git"
"${MINGW_PACKAGE_PREFIX}-libmpeg2"
"${MINGW_PACKAGE_PREFIX}-libtheora"
"${MINGW_PACKAGE_PREFIX}-libpng"
"${MINGW_PACKAGE_PREFIX}-libvpx"
$([[ ${CARCH} == aarch64 ]] || echo "${MINGW_PACKAGE_PREFIX}-nasm")
"${MINGW_PACKAGE_PREFIX}-readline"
"${MINGW_PACKAGE_PREFIX}-SDL2"
"${MINGW_PACKAGE_PREFIX}-SDL2_net"
"${MINGW_PACKAGE_PREFIX}-zlib")
source=("https://downloads.scummvm.org/frs/scummvm/${pkgver}/scummvm-${pkgver}.tar.xz")
sha256sums=('6a82f36afa9de758ab1dd377101a26a53f12417cbfd350bb8e5d7fd5b8c257e3')
source=("https://downloads.scummvm.org/frs/scummvm/${pkgver}/${_realname}-${pkgver}.tar.xz"
001-fix-host-cpu-detection.patch)
sha256sums=('6a82f36afa9de758ab1dd377101a26a53f12417cbfd350bb8e5d7fd5b8c257e3'
'7b669440a03b26eb638746f65b9f454028bf2593e116af0ccc68fe17dbae87cf')
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -p1 -i "${srcdir}/${_patch}"
done
}
prepare() {
cd ${_realname}-${pkgver}
apply_patch_with_msg \
001-fix-host-cpu-detection.patch
}
build() {
mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"
mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM}
declare -a _extra_config
if check_option "debug" "n"; then
@ -46,9 +68,16 @@ build() {
_extra_config+=("--disable-release" "--disable-optimizations" "--enable-debug")
fi
# because of MSYS emulation, host_cpu detected as AMD64
if [[ ${CARCH} == aarch64 ]]; then
_extra_config+=("--enable-ext-neon" "--disable-ext-sse2" "--disable-ext-avx2")
export host=${MINGW_CHOST}
export host_cpu=${CARCH}
export build=${MINGW_CHOST}
# Suppress some annoying warnings
CXXFLAGS+=" -Wno-deprecated-declarations -Wno-strict-aliasing"
if [[ ${MSYSTEM} == CLANG* ]]; then
CXXFLAGS+=" -Wno-nontrivial-memcall -Wno-unused-but-set-variable"
else
CXXFLAGS+=" -Wno-cast-user-defined -Wno-class-memaccess -Wno-maybe-uninitialized -Wno-stringop-truncation"
fi
../${_realname}-${pkgver}/configure \
@ -59,6 +88,8 @@ build() {
}
package() {
cd "${srcdir}/build-${MSYSTEM}"
cd build-${MSYSTEM}
make DESTDIR="${pkgdir}" install
install -Dm644 "${srcdir}"/${_realname}-${pkgver}/COPYING "${pkgdir}"${MINGW_PREFIX}/share/licenses/scummvm/LICENSE
}