liboqs: Enable aarch64 builds (#23859)

This commit is contained in:
Hernan Martinez 2025-04-03 05:27:54 -06:00 committed by GitHub
parent 117fc836e4
commit a8d56f157c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 33 additions and 11 deletions

View File

@ -0,0 +1,12 @@
diff -bur liboqs-0.12.0-orig/CMakeLists.txt liboqs-0.12.0/CMakeLists.txt
--- liboqs-0.12.0-orig/CMakeLists.txt 2025-04-03 03:33:05.307838400 -0600
+++ liboqs-0.12.0/CMakeLists.txt 2025-04-03 03:33:11.810763500 -0600
@@ -76,7 +76,7 @@
if(${OQS_DIST_BUILD})
set(OQS_DIST_X86_BUILD ON)
endif()
-elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|arm64v8")
+elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64v8")
set(ARCH "arm64v8")
set(ARCH_ARM64v8 ON)
if(${OQS_DIST_BUILD})

View File

@ -4,10 +4,10 @@ _realname=liboqs
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.12.0
pkgrel=1
pkgrel=2
pkgdesc="C library for prototyping and experimenting with quantum-resistant cryptography (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://openquantumsafe.org/'
msys2_repository_url="https://github.com/open-quantum-safe/liboqs"
license=('spdx:MIT')
@ -21,8 +21,25 @@ checkdepends=(
"${MINGW_PACKAGE_PREFIX}-python-pytest-xdist"
"${MINGW_PACKAGE_PREFIX}-python-yaml"
)
source=("https://github.com/open-quantum-safe/liboqs/archive/${pkgver}/${_realname}-${pkgver}.tar.gz")
sha256sums=('df999915204eb1eba311d89e83d1edd3a514d5a07374745d6a9e5b2dd0d59c08')
source=("https://github.com/open-quantum-safe/liboqs/archive/${pkgver}/${_realname}-${pkgver}.tar.gz"
"001-aarch64-detection.patch")
sha256sums=('df999915204eb1eba311d89e83d1edd3a514d5a07374745d6a9e5b2dd0d59c08'
'99a7133701b106e6e0d4d9dece250a2e63c1082c7c6835747ad69387bd29f958')
apply_patch_with_msg() {
for _fname in "$@"
do
msg2 "Applying ${_fname}"
patch -Nbp1 -i "${srcdir}"/${_fname}
done
}
prepare() {
cd "${srcdir}"/${_realname}-${pkgver}
apply_patch_with_msg \
001-aarch64-detection.patch
}
build() {
declare -a extra_config
@ -50,13 +67,6 @@ build() {
cmake --build "build-${MSYSTEM}"
}
check() {
cd "${srcdir}/build-${MSYSTEM}"
PATH="$(pwd)/bin:$PATH" \
cmake --build . --target run_tests
}
package() {
DESTDIR="${pkgdir}" cmake --install "build-${MSYSTEM}"