summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4d93d7bed1c66a229e32017ec2d606099830f481 (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
51
52
53
54
55
56
57
58
59
60
# Maintainer: Carlos Aznarán <caznaranl@uni.pe>
# Contributor: Sebastian Gsänger <sebastian_gsaenger@web.de>
# Contributor: chn <g897331845@gmail.com>
# Contributor: Gregor Kaelin <kaelingre at gmail dot com>

pkgname=xeus-cling
pkgver=0.15.3
pkgrel=2
pkgdesc="A C++ jupyter kernel based on xeus and cling"
arch=(x86_64)
url="https://github.com/jupyter-xeus/${pkgname}"
license=('custom:BSD-3-clause')
depends=(xtl xproperty xeus nlohmann-json jupyterlab cling pugixml argparse xeus-zmq)
makedepends=(cmake cppzmq)
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz"
  "0001-Rename-kernels.patch"
  "0002-Use-llvm-from-cling.patch"
  "0003-put-config-file-at-etc.patch"
  "0004-argparse-compatibility.patch::${url}/pull/512.patch")
sha512sums=('bb1f3414f88d49363d65b1a8b8c2be7d9c98cdd08172c8a5f8c5490d97cd07e7d55b0ebc7f622f42838314ce20a5f3f42186df358c668f2110665f4abd008926'
  '4c770adb7542473b467d73c0c724ed3665f02abaef1a85aebb3a9a36f4ee6d5485cb4a429c88c863b1f53b8024e5feaa0cbdcac8f01bbc678f8a06e510e3b814'
  '33040a9045c8c2f100c245ff3dffe41a3185d3ca94f332256bc6cd557c61282775023400a6a044825b664181e27b1e1cda1270491de41f65657c4a69d692784d'
  'b672c421b0efc96e93063c399f75133016dfe3c4b33bf44c089ce451394435fa59c2b562e86f6fd7c546f1a562249f0a5c48f7446312f65426533c8c39b62382'
  '2eb25d271baa5a1eaf304f3fe61108a398759cdc0fc2be8384b27e48841e67b2c595fc1ae70cb458374eec8dd3aeb92d295f3b1aec58cf783a5cbb3b35e6f91d')

prepare() {
  cd ${pkgname}-${pkgver}

  local src
  for src in "${source[@]}"; do
    src="${src%%::*}"
    src="${src##*/}"
    [[ $src = *.patch ]] || continue
    echo "Applying patch $src..."
    patch -Np1 <"../$src"
  done
}

build() {
  if [ -z $CPLUS_INCLUDE_PATH ]; then
    export CPLUS_INCLUDE_PATH=/opt/cling/include
  else
    export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/opt/cling/include
  fi

  cmake \
    -S ${pkgname}-${pkgver} \
    -B build \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_SHARED_LIBS=TRUE \
    -DCMAKE_CXX_STANDARD=17 \
    -DClang_DIR=/opt/cling/lib/cmake/clang
  cmake --build build --target all
}

package() {
  DESTDIR="${pkgdir}" cmake --build build --target install
  install -Dm 644 ${pkgname}-${pkgver}/LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}