cpptrace: init at 0.6.2
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
cmake,
|
||||
cpptrace,
|
||||
src,
|
||||
checkOutput,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
name = "cpptrace-findpackage-integration-test";
|
||||
|
||||
inherit src;
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ cpptrace ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
install main $out/bin
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
installCheckPhase = lib.strings.concatLines (
|
||||
[ "$out/bin/main" ]
|
||||
# Check that the backtrace contains the path to the executable.
|
||||
++ lib.optionals (checkOutput) [
|
||||
''
|
||||
if [[ !(`$out/bin/main 2>&1` =~ "${finalAttrs.name}") ]]; then
|
||||
echo "ERROR: $out/bin/main does not output '${finalAttrs.name}'"
|
||||
exit 1
|
||||
fi
|
||||
''
|
||||
]
|
||||
);
|
||||
})
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
pkg-config,
|
||||
libdwarf,
|
||||
gtest,
|
||||
callPackage,
|
||||
zstd,
|
||||
static ? stdenv.hostPlatform.isStatic,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "cpptrace";
|
||||
version = "0.6.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jeremy-rifkin";
|
||||
repo = "cpptrace";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-zjPxPtq+OQ104sJoeBD3jpMV9gV57FSHEJS4W6SF8GM=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [ libdwarf ];
|
||||
propagatedBuildInputs = [ zstd ];
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_LIBDWARF" true)
|
||||
(lib.cmakeBool "CPPTRACE_FIND_LIBDWARF_WITH_PKGCONFIG" true)
|
||||
(lib.cmakeBool "BUILD_SHARED_LIBS" (!static))
|
||||
(lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck)
|
||||
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_GTEST" true)
|
||||
];
|
||||
|
||||
checkInputs = [ gtest ];
|
||||
|
||||
# Unit tests are flaky and hard to get right.
|
||||
doCheck = false;
|
||||
|
||||
passthru.tests = {
|
||||
findpackage-integration = callPackage ./findpackage-integration.nix {
|
||||
src = "${finalAttrs.src}/test/findpackage-integration";
|
||||
checkOutput = finalAttrs.finalPackage.doCheck;
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/jeremy-rifkin/cpptrace/releases/tag/v${finalAttrs.version}";
|
||||
description = "Simple, portable, and self-contained stacktrace library for C++11 and newer";
|
||||
homepage = "https://github.com/jeremy-rifkin/cpptrace";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ xokdvium ];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user