From d7fb3c54198f5755597bb3a01f7c7b278a4100f9 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 1 Nov 2024 10:04:22 -0400 Subject: [PATCH] backports/nlopt: upgrade to 2.8.0 --- backports/nlopt/APKBUILD | 59 +++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/backports/nlopt/APKBUILD b/backports/nlopt/APKBUILD index 0be29fe..49b6b8b 100644 --- a/backports/nlopt/APKBUILD +++ b/backports/nlopt/APKBUILD @@ -1,38 +1,71 @@ # Contributor: Anjandev Momi -# Maintainer: Anjandev Momi +# Maintainer: Celeste +maintainer="Celeste " pkgname=nlopt -pkgver=2.7.1 +pkgver=2.8.0 pkgrel=0 -pkgdesc="library for nonlinear optimization, wrapping many algorithms for global and local, constrained or unconstrained, optimization" -url="https://github.com/stevengj/nlopt/" +pkgdesc="Library for nonlinear optimization" +url="https://github.com/stevengj/nlopt" arch="all" license="LGPL-2.1-or-later" -makedepends="samurai cmake" -subpackages="$pkgname-dev $pkgname-doc" +makedepends=" + cmake + guile-dev + python3-dev + samurai + swig + " +subpackages=" + $pkgname-dev + $pkgname-doc + $pkgname-guile + " source="$pkgname-$pkgver.tar.gz::https://github.com/stevengj/nlopt/archive/refs/tags/v$pkgver.tar.gz" +case "$CARCH" in +# octave unavailable on these 3 archs +s390x|riscv64|ppc64le) ;; +*) + makedepends="$makedepends octave-dev" + subpackages="$subpackages $pkgname-octave" + ;; +esac + build() { if [ "$CBUILD" != "$CHOST" ]; then - CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" + local crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi cmake -B build -G Ninja \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ - -DBUILD_SHARED_LIBS=True \ - -DCMAKE_BUILD_TYPE=minsizerel \ - $CMAKE_CROSSOPTS . + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + $crossopts cmake --build build } check() { - cd build - CTEST_OUTPUT_ON_FAILURE=TRUE ctest + ctest --test-dir build --output-on-failure } package() { DESTDIR="$pkgdir" cmake --install build } +guile() { + pkgdesc="$pkgdesc (Guile bindings)" + depends="$pkgname=$pkgver-r$pkgrel guile" + + amove usr/lib/guile usr/share/guile +} + +octave() { + pkgdesc="$pkgdesc (Octave bindings)" + depends="$pkgname=$pkgver-r$pkgrel octave" + + amove usr/lib/octave usr/share/octave +} + sha512sums=" -e23cb522fc696010574c14b72be85acc0f8ccf0bf208bf2b8789c57d6c5a6e6d419ee10330581518b1c1567018ae909b626ce7761d4fbd5bf112916871e420e2 nlopt-2.7.1.tar.gz +cb294caa5532e11ae0d22ed849705920bbae79f712144c840a5ca865ef8e6a15c6c9540c81ced0c3c05b9f44c360d50f74e235e69d893be34b7e1c5599f07c71 nlopt-2.8.0.tar.gz "