|
54 | 54 | (pkgs.lib.hasSuffix ".json" path); |
55 | 55 | }; |
56 | 56 |
|
57 | | - # Build inputs |
58 | 57 | buildInputs = with pkgs; [ |
59 | 58 | openssl |
60 | 59 | libclang.lib |
|
65 | 64 | pkgs.darwin.apple_sdk.frameworks.Security |
66 | 65 | ]; |
67 | 66 |
|
68 | | - # Native build inputs |
69 | 67 | nativeBuildInputs = with pkgs; [ |
70 | 68 | pkg-config |
71 | 69 | protobuf |
|
74 | 72 |
|
75 | 73 | # Environment variables |
76 | 74 | CC_ENABLE_DEBUG_OUTPUT = "1"; |
| 75 | + CRATE_CC_NO_DEFAULTS = 1; |
77 | 76 | LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ |
78 | 77 | rustToolchain |
79 | 78 | pkgs.stdenv.cc.cc |
80 | 79 | pkgs.libz |
81 | 80 | pkgs.clang |
82 | 81 | ]; |
83 | 82 |
|
84 | | - # Bindgen configuration |
85 | | - BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang.cc.lib}/lib/clang/19/include"; |
| 83 | + BINDGEN_EXTRA_CLANG_ARGS = if pkgs.lib.hasSuffix "linux" system then "-I${pkgs.glibc.dev}/include -I${pkgs.clang.cc.lib}/lib/clang/19/include" else ""; |
86 | 84 | LIBCLANG_PATH = "${pkgs.clang.cc.lib}/lib"; |
87 | 85 |
|
88 | 86 | # Platform-specific flags |
|
102 | 100 | OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include"; |
103 | 101 | OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib"; |
104 | 102 |
|
105 | | - # Platform-specific RUSTFLAGS |
106 | 103 | RUSTFLAGS = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isDarwin |
107 | 104 | "--cfg unwinding_backport --cfg unwinding_apple"; |
108 | 105 |
|
109 | | - # Git commit hash for Substrate CLI |
110 | | - SUBSTRATE_CLI_GIT_COMMIT_HASH = self.dirtyShortRev or self.shortRev; |
111 | 106 | }; |
112 | 107 |
|
113 | 108 | # Build the workspace dependencies |
|
121 | 116 | version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version; |
122 | 117 |
|
123 | 118 | inherit cargoArtifacts; |
| 119 | + |
| 120 | + # Git commit hash for Substrate CLI |
| 121 | + SUBSTRATE_CLI_GIT_COMMIT_HASH = self.dirtyShortRev or self.shortRev; |
124 | 122 |
|
125 | | - # Post-fixup for Linux |
126 | 123 | postFixup = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux '' |
127 | 124 | patchelf --set-rpath "${pkgs.rocksdb}/lib:${pkgs.stdenv.cc.cc.lib}/lib" $out/bin/partner-chains-demo-node |
128 | 125 | ''; |
|
0 commit comments