From 26804dbd1536f5fb08b0fb80f15647d4ef23bee7 Mon Sep 17 00:00:00 2001 From: Hernan Martinez Date: Tue, 25 Feb 2025 08:23:58 -0700 Subject: [PATCH] ucl: Enable aarch64 builds (#23509) --- mingw-w64-ucl/PKGBUILD | 34 ++++++++++++++++++---------- mingw-w64-ucl/ucl-1.03-aarch64.patch | 13 +++++++++++ 2 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 mingw-w64-ucl/ucl-1.03-aarch64.patch diff --git a/mingw-w64-ucl/PKGBUILD b/mingw-w64-ucl/PKGBUILD index ecbc8ceedc..ac2df55bcc 100644 --- a/mingw-w64-ucl/PKGBUILD +++ b/mingw-w64-ucl/PKGBUILD @@ -4,22 +4,33 @@ _realname=ucl pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=1.03 -pkgrel=2 +pkgrel=3 pkgdesc="Portable lossless data compression library written in ANSI C (mingw-w64)" arch=('any') -mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64') +mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') url="https://www.oberhumer.com/opensource/ucl/" -license=('GPL') +msys2_repository_url="https://github.com/korczis/ucl" +license=('spdx:GPL-2.0') makedepends=("${MINGW_PACKAGE_PREFIX}-autotools" "${MINGW_PACKAGE_PREFIX}-cc") source=("https://www.oberhumer.com/opensource/${_realname}/download/${_realname}-${pkgver}.tar.gz" "ucl-1.03-autoconf-compat.patch" "ucl-1.03-missing-macros.patch" - "ucl-1.03-no-undefined.patch") + "ucl-1.03-no-undefined.patch" + "ucl-1.03-aarch64.patch") sha256sums=('b865299ffd45d73412293369c9754b07637680e5c826915f097577cd27350348' '0cbd00a8383c098f98d5b022fcb4fa8d1448501e00221a223be04be0383bafc0' 'ed5425536d98e2097488001e6e73d2ed93da65050a6fded62435bec077bc594b' - '56a110aedab800c0a06cf4fd4dcef8f78691a0d091e2f143a2a8f02cfbb4c172') + '56a110aedab800c0a06cf4fd4dcef8f78691a0d091e2f143a2a8f02cfbb4c172' + 'f94c63c8cfc30d7c8555462564cd1cc82205e1925dd87d83bdf4e8ed4d6b3d05') + +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying ${_patch}" + patch -Nbp1 --binary -i "${srcdir}/${_patch}" + done +} prepare() { cd "${srcdir}"/${_realname}-${pkgver} @@ -27,10 +38,12 @@ prepare() { rm -f acinclude.m4 rm -f m4/local.m4 - patch -Np1 -i "${srcdir}/ucl-1.03-autoconf-compat.patch" - patch -Np1 -i "${srcdir}/ucl-1.03-missing-macros.patch" - patch -Np1 -i "${srcdir}/ucl-1.03-no-undefined.patch" - + apply_patch_with_msg \ + ucl-1.03-autoconf-compat.patch \ + ucl-1.03-missing-macros.patch \ + ucl-1.03-no-undefined.patch \ + ucl-1.03-aarch64.patch + touch ChangeLog WANT_AUTOMAKE=latest autoreconf -fiv } @@ -41,9 +54,6 @@ build() { CFLAGS+=" -std=gnu90" ../${_realname}-${pkgver}/configure \ --prefix=${MINGW_PREFIX} \ - --build=${MINGW_CHOST} \ - --host=${MINGW_CHOST} \ - --target=${MINGW_CHOST} \ --enable-static \ --enable-shared diff --git a/mingw-w64-ucl/ucl-1.03-aarch64.patch b/mingw-w64-ucl/ucl-1.03-aarch64.patch new file mode 100644 index 0000000000..4cb7984fed --- /dev/null +++ b/mingw-w64-ucl/ucl-1.03-aarch64.patch @@ -0,0 +1,13 @@ +diff -bur ucl-1.03-orig/acc/acc_arch.h ucl-1.03/acc/acc_arch.h +--- ucl-1.03-orig/acc/acc_arch.h 2025-02-25 05:25:26 -0700 ++++ ucl-1.03/acc/acc_arch.h 2025-02-25 05:37:23 -0700 +@@ -74,6 +74,9 @@ + # error "missing define for CPU architecture" + #elif (ACC_OS_WIN64) + /* # error "missing define for CPU architecture" */ ++ #if defined(__aarch64__) || defined(_M_ARM64) ++ # define ACC_INFO_ARCH "arm64" ++ #endif + #elif (ACC_OS_TOS) || defined(__m68000__) + # define ACC_ARCH_M68K 1 + # define ACC_INFO_ARCH "m68k"