Skip to content

Commit

Permalink
ucl: Enable aarch64 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
hmartinez82 authored and MehdiChinoune committed Feb 25, 2025
1 parent 343eeab commit 9700bd4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
34 changes: 22 additions & 12 deletions mingw-w64-ucl/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,46 @@ _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}

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
}
Expand All @@ -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

Expand Down
13 changes: 13 additions & 0 deletions mingw-w64-ucl/ucl-1.03-aarch64.patch
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 9700bd4

Please sign in to comment.