Merge pull request #10218 from MehdiChinoune/dsdp-clang

dsdp: Fix build on clang64
This commit is contained in:
Christoph Reiter
2021-12-01 09:48:24 +01:00
committed by GitHub

View File

@@ -6,37 +6,41 @@ _realname=dsdp
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=5.8
pkgrel=1
pkgrel=2
pkgdesc="A free open source implementation of an interior-point method for semidefinite programming (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
url="https://www.mcs.anl.gov/hs/software/DSDP"
license=('custom')
depends=("${MINGW_PACKAGE_PREFIX}-openblas")
depends=($([[ ${MINGW_PACKAGE_PREFIX} != *-clang-* ]] && \
echo "${MINGW_PACKAGE_PREFIX}-openblas" || \
echo "${MINGW_PACKAGE_PREFIX}-f2cblaslapack"))
source=("https://www.mcs.anl.gov/hs/software/${_realname^^}/${_realname^^}${pkgver}.tar.gz")
# "make.include.patch")
sha256sums=('26aa624525a636de272c0b329e2dfd01a0d5b7827f1c1c76f393d71e37dead70')
prepare () {
cd "${srcdir}"
cd "${srcdir}"/${_realname^^}${pkgver}
[[ -d build-${CARCH} ]] && rm -rf build-${CARCH}
cp -rf ${_realname^^}${pkgver} build-${CARCH}
cd build-${CARCH}
sed -i 's|-llapack||g' make.include
sed -i 's|-lblas|-lopenblas|g' make.include
sed -i 's|-lg2c|-lgfortran|g' make.include
if [[ ${MINGW_PACKAGE_PREFIX} != *-clang-* ]]; then
sed -i 's|-llapack||g' make.include
sed -i 's|-lblas|-lopenblas|g' make.include
sed -i 's|-lg2c|-lgfortran|g' make.include
else
sed -i 's|-lg2c||g' make.include
fi
# patch -p1 -i "${srcdir}"/make.include.patch
}
build() {
cd "${srcdir}"/build-${CARCH}
[[ -d build-${MSYSTEM} ]] && rm -rf build-${MSYSTEM}
cp -rf ${_realname^^}${pkgver} build-${MSYSTEM} && cd build-${MSYSTEM}
make DSDPROOT="${PWD}" dsdpapi
}
package() {
cd "${srcdir}"/build-${CARCH}
cd "${srcdir}"/build-${MSYSTEM}
install -d "${pkgdir}"${MINGW_PREFIX}/{lib,include/dsdp}
install -Dm755 bin/dsdp5 "${pkgdir}"${MINGW_PREFIX}/bin/dsdp5