diff --git a/mingw-w64-cubature/0001-Fix-installation.patch b/mingw-w64-cubature/0001-Fix-installation.patch new file mode 100644 index 0000000000..5ef0f00dbb --- /dev/null +++ b/mingw-w64-cubature/0001-Fix-installation.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ a/CMakeLists.txt +@@ -17,5 +17,7 @@ + target_compile_definitions( ptest PRIVATE PCUBATURE=1 ) + + include(GNUInstallDirs) +-install( TARGETS cubature DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ++install( TARGETS cubature RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) + install( FILES cubature.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) diff --git a/mingw-w64-cubature/PKGBUILD b/mingw-w64-cubature/PKGBUILD new file mode 100644 index 0000000000..5370e925d9 --- /dev/null +++ b/mingw-w64-cubature/PKGBUILD @@ -0,0 +1,59 @@ +# Contributor: Mehdi Chinoune + +_realname=cubature +pkgbase=mingw-w64-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") +pkgver=1.0.4 +pkgrel=1 +pkgdesc="Multi-dimensional adaptive integration (cubature) in C (mingw-w64)" +arch=('any') +mingw_arch=('ucrt64' 'clang64' 'clangarm64') +url='https://github.com/stevengj/cubature' +license=('spdx:GPL-2.0-or-later') +depends=("${MINGW_PACKAGE_PREFIX}-cc-libs") +makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-cc") +source=("https://github.com/stevengj/cubature/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz" + "0001-Fix-installation.patch") +sha256sums=('cd4899de0b047a9d220cfb751a8bdbb8fd0c97c1c894d07523b75168e6426f60' + '519898941051a9ce973a867c425a38ff19280cc9117e89604c8ea01b8a183dca') + +prepare() { + cd "${_realname}-${pkgver}" + + patch -Np1 -i "${srcdir}"/0001-Fix-installation.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 + + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ + cmake \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + "${extra_config[@]}" \ + -S "${_realname}-${pkgver}" \ + -B "build-${MSYSTEM}" + + cmake --build "build-${MSYSTEM}" +} + +check() { + cd "build-${MSYSTEM}" + # ./htest + # ./ptest +} + +package() { + DESTDIR="${pkgdir}" cmake --install "build-${MSYSTEM}" + + install -Dm644 "${srcdir}"/${_realname}-${pkgver}/COPYING.md \ + "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE +}