2024-01-19 04:48:03 +00:00
|
|
|
# Contributor: Anjandev Momi <anjan@momi.ca>
|
2024-11-01 14:04:22 +00:00
|
|
|
# Maintainer: Celeste <cielesti@protonmail.com>
|
|
|
|
maintainer="Celeste <cielesti@protonmail.com>"
|
2024-01-19 04:48:03 +00:00
|
|
|
pkgname=nlopt
|
2024-11-01 14:04:22 +00:00
|
|
|
pkgver=2.8.0
|
2024-01-19 04:48:03 +00:00
|
|
|
pkgrel=0
|
2024-11-01 14:04:22 +00:00
|
|
|
pkgdesc="Library for nonlinear optimization"
|
|
|
|
url="https://github.com/stevengj/nlopt"
|
2024-01-19 04:48:03 +00:00
|
|
|
arch="all"
|
|
|
|
license="LGPL-2.1-or-later"
|
2024-11-01 14:04:22 +00:00
|
|
|
makedepends="
|
|
|
|
cmake
|
|
|
|
guile-dev
|
|
|
|
python3-dev
|
|
|
|
samurai
|
|
|
|
swig
|
|
|
|
"
|
|
|
|
subpackages="
|
|
|
|
$pkgname-dev
|
|
|
|
$pkgname-doc
|
|
|
|
$pkgname-guile
|
|
|
|
"
|
2024-01-19 04:48:03 +00:00
|
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/stevengj/nlopt/archive/refs/tags/v$pkgver.tar.gz"
|
|
|
|
|
2024-11-01 14:04:22 +00:00
|
|
|
case "$CARCH" in
|
|
|
|
# octave unavailable on these 3 archs
|
|
|
|
s390x|riscv64|ppc64le) ;;
|
|
|
|
*)
|
|
|
|
makedepends="$makedepends octave-dev"
|
|
|
|
subpackages="$subpackages $pkgname-octave"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2024-01-19 04:48:03 +00:00
|
|
|
build() {
|
|
|
|
if [ "$CBUILD" != "$CHOST" ]; then
|
2024-11-01 14:04:22 +00:00
|
|
|
local crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
|
2024-01-19 04:48:03 +00:00
|
|
|
fi
|
|
|
|
cmake -B build -G Ninja \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
2024-11-01 14:04:22 +00:00
|
|
|
-DBUILD_SHARED_LIBS=ON \
|
|
|
|
-DCMAKE_BUILD_TYPE=MinSizeRel \
|
|
|
|
$crossopts
|
2024-01-19 04:48:03 +00:00
|
|
|
cmake --build build
|
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2024-11-01 14:04:22 +00:00
|
|
|
ctest --test-dir build --output-on-failure
|
2024-01-19 04:48:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
DESTDIR="$pkgdir" cmake --install build
|
|
|
|
}
|
|
|
|
|
2024-11-01 14:04:22 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2024-01-19 04:48:03 +00:00
|
|
|
sha512sums="
|
2024-11-01 14:04:22 +00:00
|
|
|
cb294caa5532e11ae0d22ed849705920bbae79f712144c840a5ca865ef8e6a15c6c9540c81ced0c3c05b9f44c360d50f74e235e69d893be34b7e1c5599f07c71 nlopt-2.8.0.tar.gz
|
2024-01-19 04:48:03 +00:00
|
|
|
"
|