Skip to content

Commit 38f4d3e

Browse files
authored
bitcoind: static build should work again on linux (#406294)
2 parents a571f7b + 0d4dde0 commit 38f4d3e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkgs/applications/blockchains/bitcoin/default.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
nixosTests,
2323
withGui,
2424
withWallet ? true,
25+
enableTracing ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isStatic,
2526
}:
2627

2728
let
@@ -61,7 +62,7 @@ stdenv.mkDerivation (finalAttrs: {
6162
zeromq
6263
zlib
6364
]
64-
++ lib.optionals (stdenv.hostPlatform.isLinux) [ libsystemtap ]
65+
++ lib.optionals enableTracing [ libsystemtap ]
6566
++ lib.optionals withWallet [ sqlite ]
6667
# building with db48 (for legacy descriptor wallet support) is broken on Darwin
6768
++ lib.optionals (withWallet && !stdenv.hostPlatform.isDarwin) [ db48 ]
@@ -98,7 +99,7 @@ stdenv.mkDerivation (finalAttrs: {
9899
(lib.cmakeBool "WITH_ZMQ" true)
99100
# building with db48 (for legacy wallet support) is broken on Darwin
100101
(lib.cmakeBool "WITH_BDB" (withWallet && !stdenv.hostPlatform.isDarwin))
101-
(lib.cmakeBool "WITH_USDT" (stdenv.hostPlatform.isLinux))
102+
(lib.cmakeBool "WITH_USDT" enableTracing)
102103
]
103104
++ lib.optionals (!finalAttrs.doCheck) [
104105
(lib.cmakeBool "BUILD_TESTS" false)
@@ -112,6 +113,10 @@ stdenv.mkDerivation (finalAttrs: {
112113
(lib.cmakeBool "BUILD_GUI" true)
113114
];
114115

116+
NIX_LDFLAGS = lib.optionals (
117+
stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic
118+
) "-levent_core";
119+
115120
nativeCheckInputs = [ python3 ];
116121

117122
doCheck = true;

0 commit comments

Comments
 (0)