summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 237213f707e25b413ae5792861c33527b8e97cec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Maintainer: Carlos Aznarán <caznaranl@uni.pe>
# Maintainer: Josh Hoffer < hoffer dot joshua at gmail dot com >
pkgname=dune-logging
_tarver=2.8
_tar="${_tarver}/${pkgname}-releases-${_tarver}.tar.gz"
pkgver="${_tarver}"
pkgrel=3
pkgdesc="A logging framework for Dune"
arch=(x86_64)
url="https://gitlab.dune-project.org/staging/${pkgname}"
license=(BSD-2-Clause LGPL-3.0-or-later LicenseRef-GPL-2.0-only-with-DUNE-exception)
depends=("dune-common>=${_tarver}" fmt9)
makedepends=(doxygen graphviz)
optdepends=('doxygen: Generate the class documentation from C++ sources'
  'graphviz: Graph visualization software')
options=(!emptydirs)
source=(${url}/-/archive/releases/${_tar}
  fmt9.patch::${url}/-/commit/39e3ca6fad529e44b1d59463af3288870d61e916.patch)
sha512sums=('3b57d0e57c55195ee20be617f308d8294c7fe87ac8b6d5fbc3d03e12229b6a9f331e4391651a6a8876ab2ffa3e147e10bfddae45dd5f700ca1ebe93f7f9b1215'
  'be68c87e075d3bd35b04389928fa637b198fede795e2ea2d90a5e2fc0b39798dbf89ba23eb1895c9754e0cc1ca4f03c97522aeb481f0fd007a9c9f84a6ce93ea')

prepare() {
  # Apply patch for fmt9 compatibilty
  cd ${pkgname}-releases-${_tarver}
  patch -p1 -i ../fmt9.patch
  # https://github.com/fmtlib/fmt/issues/3589
  sed -i 's/fmt::make_format_args(std::forward<Args>(args)...)/fmt::make_format_args(args...)/' dune/logging/logger.hh
}

build() {
  cmake \
    -S ${pkgname}-releases-${_tarver} \
    -B build-cmake \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DBUILD_SHARED_LIBS=TRUE \
    -DCMAKE_CXX_STANDARD=20 \
    -DCMAKE_C_COMPILER=gcc \
    -DCMAKE_CXX_COMPILER=g++ \
    -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
    -DENABLE_HEADERCHECK=ON \
    -Wno-dev
  cmake --build build-cmake --target all
}

package() {
  DESTDIR="${pkgdir}" cmake --build build-cmake --target install
  install -Dm644 ${pkgname}-releases-${_tarver}/COPYING.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}