mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
cpptrace: propagate libdwarf for static builds
This commit is contained in:
parent
986c08a671
commit
5fe5e9ea77
2 changed files with 19 additions and 8 deletions
|
@ -5,6 +5,7 @@
|
||||||
cpptrace,
|
cpptrace,
|
||||||
src,
|
src,
|
||||||
checkOutput,
|
checkOutput,
|
||||||
|
static,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
@ -13,7 +14,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ];
|
||||||
buildInputs = [ cpptrace ];
|
buildInputs = [
|
||||||
|
(cpptrace.override { inherit static; })
|
||||||
|
];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
@ -27,7 +30,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
installCheckPhase = lib.strings.concatLines (
|
installCheckPhase = lib.strings.concatLines (
|
||||||
[ "$out/bin/main" ]
|
[ "$out/bin/main" ]
|
||||||
# Check that the backtrace contains the path to the executable.
|
# Check that the backtrace contains the path to the executable.
|
||||||
++ lib.optionals (checkOutput) [
|
++ lib.optionals checkOutput [
|
||||||
''
|
''
|
||||||
if [[ !(`$out/bin/main 2>&1` =~ "${finalAttrs.name}") ]]; then
|
if [[ !(`$out/bin/main 2>&1` =~ "${finalAttrs.name}") ]]; then
|
||||||
echo "ERROR: $out/bin/main does not output '${finalAttrs.name}'"
|
echo "ERROR: $out/bin/main does not output '${finalAttrs.name}'"
|
||||||
|
|
|
@ -36,7 +36,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [ libdwarf ];
|
buildInputs = [ libdwarf ];
|
||||||
propagatedBuildInputs = [ zstd ];
|
propagatedBuildInputs = [ zstd ] ++ (lib.optionals static [ libdwarf ]);
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_LIBDWARF" true)
|
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_LIBDWARF" true)
|
||||||
|
@ -51,12 +51,20 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
updateScript = nix-update-script { };
|
updateScript = nix-update-script { };
|
||||||
tests = {
|
tests =
|
||||||
findpackage-integration = callPackage ./findpackage-integration.nix {
|
let
|
||||||
src = "${finalAttrs.src}/test/findpackage-integration";
|
mkIntegrationTest =
|
||||||
checkOutput = finalAttrs.finalPackage.doCheck;
|
{ static }:
|
||||||
|
callPackage ./findpackage-integration.nix {
|
||||||
|
src = "${finalAttrs.src}/test/findpackage-integration";
|
||||||
|
checkOutput = finalAttrs.finalPackage.doCheck;
|
||||||
|
inherit static;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
findpackage-integration-shared = mkIntegrationTest { static = false; };
|
||||||
|
findpackage-integration-static = mkIntegrationTest { static = true; };
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue