1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit linux-mod bash-completion-r1 cmake-utils
9 DESCRIPTION="A system exploration and troubleshooting tool"
10 HOMEPAGE="http://www.sysdig.org/"
11 # mirrored from https://github.com/draios/sysdig/archive/${PV}.tar.gz
12 SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz"
16 KEYWORDS="~amd64 ~x86"
19 RDEPEND="dev-lang/luajit:2=
26 # needed for the kernel module
27 CONFIG_CHECK="HAVE_SYSCALL_TRACEPOINTS TRACEPOINTS"
30 use modules && linux-mod_pkg_setup
34 use modules && linux-mod_pkg_setup
38 sed -i -e 's:-ggdb::' CMakeLists.txt || die
40 cmake-utils_src_prepare
45 # we will use linux-mod for that
47 # libscap examples are not installed or really useful
48 -DBUILD_LIBSCAP_EXAMPLES=OFF
51 -DUSE_BUNDLED_LUAJIT=OFF
52 -DLUAJIT_PREFIX="${EPREFIX}"/usr
53 -DLUAJIT_INCLUDE="${EPREFIX}"/usr/include/luajit-2.0
54 -DUSE_BUNDLED_JSONCPP=OFF
55 -DJSONCPP_PREFIX="${EPREFIX}"/usr
56 -DJSONCPP_INCLUDE="${EPREFIX}"/usr/include/jsoncpp
57 -DUSE_BUNDLED_ZLIB=OFF
58 -DZLIB_PREFIX="${EPREFIX}"/usr
61 cmake-utils_src_configure
63 # setup linux-mod ugliness
64 MODULE_NAMES="sysdig-probe(extra:${BUILD_DIR}/driver:)"
65 BUILD_TARGETS="driver"
69 cmake-utils_src_compile
71 use modules && linux-mod_src_compile
75 cmake-utils_src_install
77 use modules && linux-mod_src_install
80 rm -r "${ED%/}"/usr/src || die
82 # move bashcomp to the proper location
83 dobashcomp "${ED%/}"/usr/etc/bash_completion.d/sysdig || die
84 rm -r "${ED%/}"/usr/etc || die