102 lines
3.7 KiB
Bash
102 lines
3.7 KiB
Bash
# Maintainer: Jannick <thirdedition@gmx.net>
|
|
|
|
_realname=igraph
|
|
pkgbase=mingw-w64-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
|
|
pkgver=0.10.8
|
|
pkgrel=2
|
|
pkgdesc="Library for the analysis of networks (mingw-w64)"
|
|
arch=('any')
|
|
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
msys2_references=(
|
|
'archlinux: igraph'
|
|
)
|
|
msys2_repository_url='https://github.com/igraph/igraph/'
|
|
msys2_documentation_url='https://igraph.org/c/#docs'
|
|
msys2_issue_tracker_url='https://github.com/igraph/igraph/issues/'
|
|
url='https://igraph.org/c/'
|
|
license=('spdx:GPL-2.0-or-later')
|
|
source=("https://github.com/igraph/igraph/releases/download/${pkgver}/igraph-${pkgver}.tar.gz"
|
|
'0001-igraph-add-cflags-private-pkgconfig.patch'
|
|
'0002-igraph-fix-function-pointer-error.patch')
|
|
sha256sums=('ac5fa94ae6fd1eace651e4b235e99c056479a5c5d0d641aed30240ac33b19403'
|
|
'07a1303781723b1e449899492431cb75156ac2b7450b48c8d28bd064b0703d35'
|
|
'bbdcfab5d077dd53dd9c887c0532d2145dd858621488efa2b85064da1257539f')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-glpk"
|
|
"${MINGW_PACKAGE_PREFIX}-gmp"
|
|
"${MINGW_PACKAGE_PREFIX}-libxml2"
|
|
"${MINGW_PACKAGE_PREFIX}-plfit"
|
|
"${MINGW_PACKAGE_PREFIX}-omp"
|
|
"${MINGW_PACKAGE_PREFIX}-openblas"
|
|
$([[ ${MINGW_PACKAGE_PREFIX} == *-clang-i686* ]] || echo "${MINGW_PACKAGE_PREFIX}-arpack"))
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
|
|
"${MINGW_PACKAGE_PREFIX}-cmake"
|
|
"${MINGW_PACKAGE_PREFIX}-ninja")
|
|
|
|
prepare() {
|
|
cd "${srcdir}"/${_realname}-${pkgver}
|
|
patch -p1 -i "${srcdir}/0001-igraph-add-cflags-private-pkgconfig.patch"
|
|
|
|
# https://github.com/igraph/igraph/commit/b5922352e77efd74c80a730a27f811106d5e7eaa
|
|
patch -p1 -i "${srcdir}/0002-igraph-fix-function-pointer-error.patch"
|
|
}
|
|
|
|
build() {
|
|
declare -a _extra_config
|
|
if check_option "debug" "n"; then
|
|
_extra_config+=("-DCMAKE_BUILD_TYPE=Release")
|
|
else
|
|
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
|
|
fi
|
|
|
|
for libtype in 'static' 'shared'; do
|
|
case $libtype in
|
|
(static) _BUILD_SHARED_LIBS=OFF;;
|
|
(shared) _BUILD_SHARED_LIBS=ON;;
|
|
(*) exit 1
|
|
esac
|
|
|
|
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
|
${MINGW_PREFIX}/bin/cmake.exe \
|
|
-GNinja \
|
|
-DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \
|
|
-DBUILD_SHARED_LIBS=${_BUILD_SHARED_LIBS} \
|
|
${_extra_config[@]} \
|
|
-DBUILD_TESTING=OFF \
|
|
-DIGRAPH_ENABLE_TLS=ON \
|
|
-DIGRAPH_GLPK_SUPPORT=ON \
|
|
-DIGRAPH_GRAPHML_SUPPORT=ON \
|
|
-DIGRAPH_WARNINGS_AS_ERRORS=OFF \
|
|
-S "${_realname}-${pkgver}" \
|
|
-B "build-${MSYSTEM}-${libtype}"
|
|
|
|
${MINGW_PREFIX}/bin/cmake --build "build-${MSYSTEM}-${libtype}"
|
|
done
|
|
}
|
|
|
|
check() {
|
|
# igraph 0.9.4: All tests succeeded.
|
|
for libtype in 'static' 'shared'; do
|
|
${MINGW_PREFIX}/bin/cmake -S "${_realname}-${pkgver}" -B "build-${MSYSTEM}-${libtype}" -DBUILD_TESTING=ON
|
|
${MINGW_PREFIX}/bin/cmake --build build-${MSYSTEM}-${libtype} --target build_tests
|
|
${MINGW_PREFIX}/bin/ctest --test-dir build-${MSYSTEM}-${libtype} --output-on-failure
|
|
done
|
|
}
|
|
|
|
package() {
|
|
# Install the libtypes one over another (until the simultaneous build of
|
|
# shared and static libraries is implemented). :(
|
|
for libtype in 'static' 'shared'; do
|
|
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install "build-${MSYSTEM}-${libtype}"
|
|
done
|
|
|
|
# Remove path reference in cmake
|
|
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
|
|
for _f in "${pkgdir}${MINGW_PREFIX}"/lib/cmake/${_realname}/*.cmake; do
|
|
sed -e "s|${PREFIX_WIN}|\$\{_IMPORT_PREFIX\}|g" -i ${_f}
|
|
sed -e "s|${MINGW_PREFIX}|\$\{_IMPORT_PREFIX\}|g" -i ${_f}
|
|
done
|
|
|
|
install -D -m644 "${srcdir}"/${_realname}-${pkgver}/COPYING "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/COPYING
|
|
}
|