archrelease: copy trunk to community-any
[ArchLinux/community.git] / sysdig / repos / community-x86_64 / PKGBUILD
blobaa2e5785c53c87f40d4c520d169e81f6e39b9941
1 # Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
2 # Contribuitor: Alfredo Palhares <masterkorp@masterkorp.net>
3 # Contribuitor: Christian Babeux <christian.babeux@0x80.ca>
5 pkgbase=sysdig
6 pkgname=(sysdig sysdig-dkms)
7 pkgver=0.31.5
8 pkgrel=1
10 # from src/sysdig-*/cmake/modules/falcosecurity-libs.cmake
11 _falcover=0.10.5
13 pkgdesc="Open source system-level exploration and troubleshooting tool"
14 arch=('x86_64')
15 url="https://www.sysdig.com/"
16 license=('GPL2' 'Apache' 'MIT')
17 makedepends=('cmake' 'pandoc' 'gtest' 'jsoncpp' 'libjsoncpp.so' 'luajit' 'curl' 'libcurl.so' 'jq' 'libb64' 'intel-tbb' 'grpc' 'yaml-cpp' 're2')
18 source=("https://github.com/draios/sysdig/archive/$pkgver/$pkgbase-$pkgver.tar.gz"
19         "falcosecurity-libs-$_falcover.tar.gz::https://github.com/falcosecurity/libs/archive/$_falcover.tar.gz"
20         "bashcomp-location.patch"
21         "falcosecurity-libs-nodownload.patch"
22         "libsinsp-zstd.patch")
23 sha256sums=('9af98cae7c38273f7429ba0df628c9745bd92c949f444e180b9dd800af14c6dd'
24             '2a4b37c08bec4ba81326314831f341385aff267062e8d4483437958689662936'
25             '3b659326176c314eee9115adac39a249dc4b9530511b344ea6a2b23236bb8386'
26             '3392204c265ef46c2a1378fc2acbb74b2b440585de4c9127a007f97ce10f0cfa'
27             'bb29a1dd7a854019e2408b98fd954e73263a47f6da637556a83885175a729034')
29 prepare() {
30   cd "$srcdir/libs-$_falcover"
31   patch -p1 -i "$srcdir"/libsinsp-zstd.patch
33   cd "$srcdir/$pkgbase-$pkgver"
34   patch -p1 -i "$srcdir"/bashcomp-location.patch
35   patch -p1 -i "$srcdir"/falcosecurity-libs-nodownload.patch
37   sed s/USE_BUNDLED_DEPS/USE_BUNDLED_NJSON/ -i cmake/modules/nlohmann-json.cmake
38 # Fix build with abseil-cpp 2023
39   sed -e 's|-std=c++0x||' -i CMakeLists.txt -i ../libs-${_falcover}/cmake/modules/CompilerFlags.cmake
42 build() {
43   cd "$srcdir"/$pkgbase-$pkgver
44   rm -rf build
45   mkdir build
46   cd build
48   cmake .. \
49         -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
50         -DCMAKE_BUILD_TYPE=Release \
51         -DCMAKE_CXX_FLAGS="${CXXFLAGS} ${CPPFLAGS} -Wno-deprecated-declarations" \
52         -DCMAKE_C_FLAGS="${CFLAGS} ${CPPFLAGS} -Wno-deprecated-declarations" \
53         -DCMAKE_CXX_STANDARD=17 \
54         -DCMAKE_CXX_EXTENSIONS=OFF \
55         -DCMAKE_INSTALL_PREFIX=/usr \
56         -DSYSDIG_VERSION=$pkgver \
57         -DDRIVER_VERSION=$_falcover \
58         -DUSE_BUNDLED_DEPS=OFF \
59         -DUSE_BUNDLED_TBB=OFF \
60         -DUSE_BUNDLED_B64=OFF \
61         -DUSE_BUNDLED_JSONCPP=OFF \
62         -DUSE_BUNDLED_RE2=OFF \
63         -DUSE_BUNDLED_VALIJSON=ON \
64         -DUSE_BUNDLED_NJSON=ON \
65         -DBUILD_DRIVER=OFF \
66         -DBUILD_LIBSCAP_EXAMPLES=OFF
67   make
70 package_sysdig() {
71   optdepends=('sysdig-dkms: kernel module for live inspection')
72   depends=('jsoncpp' 'libjsoncpp.so' 'luajit' 'curl' 'libcurl.so' 'jq' 'libb64' 'intel-tbb' 'grpc' 'libgrpc++.so' 'yaml-cpp' 'zstd')
74   cd "$srcdir"/$pkgbase-$pkgver/build
75   make install DESTDIR="$pkgdir"
76   rm -rf "$pkgdir"/usr/src "$pkgdir"/sysdig
78   install -dm755 "$pkgdir"/usr/share/licenses/$pkgname
79   install -m644 "$srcdir"/$pkgbase-$pkgver/{NOTICES,COPYING} "$pkgdir"/usr/share/licenses/$pkgname
82 package_sysdig-dkms() {
83   pkgdesc="DKMS kernel module for sysdig"
84   depends=('sysdig' 'dkms')
86   cd "$srcdir"/$pkgbase-$pkgver/build
87   make install DESTDIR="$pkgdir"
88   rm -rf "$pkgdir"/usr/{share,bin} "$pkgdir"/sysdig
90   install -dm755 "$pkgdir"/usr/share/licenses/$pkgname
91   install -m644 "$srcdir"/$pkgbase-$pkgver/{NOTICES,COPYING} "$pkgdir"/usr/share/licenses/$pkgname