Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
adding nlopt (disable shared, swig)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Jun 26, 2018
1 parent aa1610f commit 7e49aae
Show file tree
Hide file tree
Showing 3 changed files with 3,355 additions and 0 deletions.
81 changes: 81 additions & 0 deletions mingw-w64-nlopt/PKGBUILD
@@ -0,0 +1,81 @@
# Maintainer: Ray Donnelly <mingw.android@gmail.com>

_realname=nlopt
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=2.4.2
pkgrel=9002
pkgdesc="A library for nonlinear optimization (mingw-w64)"
arch=('any')
#makedepends=("${MINGW_PACKAGE_PREFIX}-swig")
url='http://ab-initio.mit.edu/wiki/index.php/NLopt'
license=('LGPLv2.1+')

source=(#"https://github.com/stevengj/nlopt/archive/${_realname}-${pkgver}.tar.gz"
"http://ab-initio.mit.edu/${_realname}/${_realname}-${pkgver}.tar.gz"
"config.sub"
"config.guess")

sha256sums=('8099633de9d71cbc06cd435da993eb424bbcdbded8f803cdaa9fb8c6e09c8e89'
'75d5d255a2a273b6e651f82eecfabf6cbcd8eaeae70e86b417384c8f4a58d8d3'
'467e0886e3d4b06087e704dc9e22bbb8f93eb8c7b81aeae1ee0000d06aa4c45f')

prepare() {
cd "${srcdir}"/${_realname}-${pkgver}
#cp -f "${srcdir}"/config.{sub,guess} .
#./autogen.sh --no-configure
}

build() {
cd "$srcdir"/${_realname}-${pkgver}
[[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH}
mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}

# If switching back to the github 'release' tarballs, add this config flag.
# --enable-maintainer-mode

# Build static C++ library, on Linux you can get a shared C++ library
# but not so on Windows. We still ask for one anyway. The .pc files are
# incorrect on all systems. They never refer to nlopt_cxx.
../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--enable-static \
--disable-shared \
--with-cxx \
--without-python

# build system is a bit racy around the swig scm and scm.in file.
make -j1
cp "${srcdir}"/build-${CARCH}/.libs/libnlopt_cxx.a "${srcdir}"/build-${CARCH}/libnlopt_cxx.a

# without this call, the resulting libraries do not contain the functions
# pertaining to the Fortran API
make distclean

# Build static and shared C libraries.
../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--enable-static \
--disable-shared \
--without-python

# build system is a bit racy around the swig scm and scm.in file.
make -j1
}

check() {
cd "${srcdir}"/build-${CARCH}
make check
}

package() {
cd "${srcdir}"/build-${CARCH}
make install DESTDIR="${pkgdir}"
mv "${srcdir}"/build-${CARCH}/libnlopt_cxx.a "${pkgdir}"${MINGW_PREFIX}/lib
}

0 comments on commit 7e49aae

Please sign in to comment.