backports/nlopt: upgrade to 2.8.0

This commit is contained in:
Antoine Martin 2024-11-01 10:04:22 -04:00 committed by Antoine Martin
parent f2e1f14f99
commit d7fb3c5419

View file

@ -1,38 +1,71 @@
# Contributor: Anjandev Momi <anjan@momi.ca>
# Maintainer: Anjandev Momi <anjan@momi.ca>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
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
"