Skip to content

Commit d1fa204

Browse files
Add missing includes to fix gcc 13 compile error
1 parent 24cbbbc commit d1fa204

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

default.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
, doCheck ? (doFunctionalTests || withCoverage)
77
, withTests ? doCheck
88
, withWallet ? true
9+
, withGCC13Patches ? true
910
, gitDir ? null
1011
, qaAssetsDir ?
1112
nixpkgs.fetchFromGitHub {
@@ -24,7 +25,7 @@
2425
, fuzzSeedCorpusDir ? if qaAssetsDir != null then "${qaAssetsDir}/fuzz_seed_corpus" else null
2526
}:
2627
nixpkgs.callPackage ./elements.nix {
27-
inherit doCheck doFunctionalTests withBench withCoverage withFuzz withTests withWallet
28+
inherit doCheck doFunctionalTests withBench withCoverage withFuzz withTests withWallet withGCC13Patches
2829
qaAssetsDir unitTestDataDir fuzzSeedCorpusDir;
2930
miniupnpc = nixpkgs.callPackage ./miniupnpc-2.2.7.nix { };
3031
lcov = nixpkgs.callPackage ./lcov-1.16.nix { };

elements.nix

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
args@
2-
{ stdenv, fetchFromGitHub ? null, pkg-config, autoreconfHook, db48, boost, zeromq
2+
{ stdenv, fetchFromGitHub ? null, fetchpatch, pkg-config, autoreconfHook, db48, boost, zeromq
33
, zlib, miniupnpc, qtbase ? null, qttools ? null, util-linux ? null, hexdump ? null, protobuf, python3, qrencode, libevent
44
, lcov ? null
55
, lib, writeText
@@ -14,6 +14,7 @@ args@
1414
, qaAssetsDir ? null
1515
, unitTestDataDir ? if qaAssetsDir != null then "${qaAssetsDir}/unit_test_data" else null
1616
, fuzzSeedCorpusDir ? if qaAssetsDir != null then "${qaAssetsDir}/fuzz_seed_corpus" else null
17+
, withGCC13Patches ? true
1718
}:
1819

1920
assert withFuzz -> stdenv.cc.isClang;
@@ -33,7 +34,19 @@ stdenv.mkDerivation rec {
3334
sha256 = "sha256-UNjYkEZBjGuhkwBxSkNXjBBcLQqoan/afCLhoR2lOY4=";
3435
};
3536

36-
patches = [ ./elements-lcov.patch ];
37+
patches = optionals withCoverage [ ./elements-lcov.patch ]
38+
++ optionals withGCC13Patches [
39+
(fetchpatch {
40+
name = "Add-missing-includes-to-fix-gcc-13-compile-error.patch";
41+
url = "https://github.com/bitcoin/bitcoin/commit/398768769f85cc1b6ff212ed931646b59fa1acd6.patch";
42+
hash = "sha256-4nnE4W0Z5HzVaJ6tB8QmyohXmt6UHUGgDH+s9bQaxhg=";
43+
})
44+
(fetchpatch {
45+
name = "23-x-Add-missing-includes-to-fix-gcc-13-compile-error.patch";
46+
url = "https://github.com/bitcoin/bitcoin/commit/af862661654966d5de614755ab9bd1b5913e0959.patch";
47+
hash = "sha256-4hcJIje3VAdEEpn2tetgvgZ8nVft+A64bfWLspQtbVw=";
48+
})
49+
];
3750

3851
postPatch = optionals (doCheck)
3952
''

0 commit comments

Comments
 (0)