2019-03-20 08:42:51 +03:00
|
|
|
# Copyright 1999-2019 Gentoo Authors
|
2012-02-14 20:59:39 +04:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2019-05-23 09:53:46 +03:00
|
|
|
EAPI=7
|
2012-02-14 20:59:39 +04:00
|
|
|
|
2017-11-24 18:33:18 +03:00
|
|
|
inherit flag-o-matic toolchain-funcs
|
2012-02-14 20:59:39 +04:00
|
|
|
|
|
|
|
if [[ ${PV} == "9999" ]] ; then
|
2018-02-15 09:28:43 +03:00
|
|
|
EGIT_REPO_URI="https://github.com/strace/strace.git"
|
2017-11-24 18:33:18 +03:00
|
|
|
inherit git-r3 autotools
|
2012-02-14 20:59:39 +04:00
|
|
|
else
|
2018-02-15 09:28:43 +03:00
|
|
|
SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz"
|
2019-05-23 09:53:46 +03:00
|
|
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
|
2012-02-14 20:59:39 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
DESCRIPTION="A useful diagnostic, instructional, and debugging tool"
|
2018-05-19 19:54:48 +03:00
|
|
|
HOMEPAGE="https://strace.io/"
|
2012-02-14 20:59:39 +04:00
|
|
|
|
|
|
|
LICENSE="BSD"
|
|
|
|
SLOT="0"
|
2018-06-19 15:56:56 +03:00
|
|
|
IUSE="aio perl static unwind elfutils"
|
2012-02-14 20:59:39 +04:00
|
|
|
|
2018-06-19 15:56:56 +03:00
|
|
|
REQUIRED_USE="?? ( unwind elfutils )"
|
|
|
|
|
|
|
|
LIB_DEPEND="
|
|
|
|
unwind? ( sys-libs/libunwind[static-libs(+)] )
|
|
|
|
elfutils? ( dev-libs/elfutils[static-libs(+)] )
|
|
|
|
"
|
2012-05-03 08:13:27 +04:00
|
|
|
# strace only uses the header from libaio to decode structs
|
2017-07-06 07:27:08 +03:00
|
|
|
DEPEND="
|
|
|
|
static? ( ${LIB_DEPEND} )
|
2015-09-30 14:26:26 +03:00
|
|
|
aio? ( >=dev-libs/libaio-0.3.106 )
|
2017-07-06 07:27:08 +03:00
|
|
|
sys-kernel/linux-headers
|
|
|
|
"
|
|
|
|
RDEPEND="
|
|
|
|
!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
|
|
|
|
perl? ( dev-lang/perl )
|
|
|
|
"
|
2012-02-14 20:59:39 +04:00
|
|
|
|
|
|
|
src_prepare() {
|
2017-11-24 18:33:18 +03:00
|
|
|
default
|
2017-11-18 20:52:58 +03:00
|
|
|
|
|
|
|
if [[ ! -e configure ]] ; then
|
2012-02-14 20:59:39 +04:00
|
|
|
# git generation
|
2018-02-15 09:28:43 +03:00
|
|
|
sed /autoreconf/d -i bootstrap || die
|
|
|
|
./bootstrap || die
|
2012-02-14 20:59:39 +04:00
|
|
|
eautoreconf
|
|
|
|
[[ ! -e CREDITS ]] && cp CREDITS{.in,}
|
|
|
|
fi
|
|
|
|
|
|
|
|
filter-lfs-flags # configure handles this sanely
|
2018-05-19 19:54:48 +03:00
|
|
|
# Add -pthread since strace wants -lrt for timer_create, and -lrt uses -lpthread.
|
|
|
|
use static && append-ldflags -static -pthread
|
2012-02-14 20:59:39 +04:00
|
|
|
|
|
|
|
export ac_cv_header_libaio_h=$(usex aio)
|
2017-06-07 11:43:44 +03:00
|
|
|
use elibc_musl && export ac_cv_header_stdc=no
|
2015-09-30 14:26:26 +03:00
|
|
|
|
|
|
|
# Stub out the -k test since it's known to be flaky. #545812
|
|
|
|
sed -i '1iexit 77' tests*/strace-k.test || die
|
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
2017-01-18 08:40:19 +03:00
|
|
|
# Set up the default build settings, and then use the names strace expects.
|
2016-12-24 17:54:45 +03:00
|
|
|
tc-export_build_env BUILD_{CC,CPP}
|
|
|
|
local v bv
|
|
|
|
for v in CC CPP {C,CPP,LD}FLAGS ; do
|
|
|
|
bv="BUILD_${v}"
|
|
|
|
export "${v}_FOR_BUILD=${!bv}"
|
|
|
|
done
|
|
|
|
|
2018-05-19 19:54:48 +03:00
|
|
|
# Don't require mpers support on non-multilib systems. #649560
|
2019-03-20 08:42:51 +03:00
|
|
|
local myeconfargs=(
|
|
|
|
--enable-mpers=check
|
|
|
|
$(use_with unwind libunwind)
|
2018-06-19 15:56:56 +03:00
|
|
|
$(use_with elfutils libdw)
|
2019-03-20 08:42:51 +03:00
|
|
|
)
|
|
|
|
econf "${myeconfargs[@]}"
|
2012-02-14 20:59:39 +04:00
|
|
|
}
|
|
|
|
|
2018-01-02 13:52:00 +03:00
|
|
|
src_test() {
|
2019-05-23 09:53:46 +03:00
|
|
|
if has usersandbox ${FEATURES} ; then
|
2018-01-02 13:52:00 +03:00
|
|
|
ewarn "Test suite is known to fail with FEATURES=usersandbox -- skipping ..." #643044
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
default
|
|
|
|
}
|
|
|
|
|
2012-02-14 20:59:39 +04:00
|
|
|
src_install() {
|
|
|
|
default
|
2019-05-23 09:53:46 +03:00
|
|
|
if ! use perl ; then
|
|
|
|
rm "${ED}"/usr/bin/strace-graph || die
|
|
|
|
fi
|
2012-05-03 08:13:27 +04:00
|
|
|
dodoc CREDITS
|
2012-02-14 20:59:39 +04:00
|
|
|
}
|