Skip to content

Commit 09fdeb3

Browse files
committed
fmt
1 parent 9395a08 commit 09fdeb3

File tree

1 file changed

+40
-36
lines changed

1 file changed

+40
-36
lines changed

patches.nix

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,40 @@
1616
];
1717

1818
# Picks whichever Darwin SDK (new apple-sdk or legacy apple_sdk) is available.
19-
resolveDarwinFrameworks =
20-
let
21-
appleFrameworks =
22-
if (pkgs ? "apple-sdk") && (pkgs."apple-sdk" ? frameworks)
23-
then pkgs."apple-sdk".frameworks
24-
else null;
25-
26-
legacyFrameworks =
27-
if (pkgs ? darwin) && (pkgs.darwin ? apple_sdk)
28-
then
29-
let
30-
legacyEval = builtins.tryEval pkgs.darwin.apple_sdk;
31-
in
32-
if legacyEval.success && legacyEval.value ? frameworks
33-
then legacyEval.value.frameworks
34-
else null
35-
else null;
36-
in
37-
if appleFrameworks != null then appleFrameworks
38-
else if legacyFrameworks != null then legacyFrameworks
39-
else {};
19+
resolveDarwinFrameworks = let
20+
appleFrameworks =
21+
if (pkgs ? "apple-sdk") && (pkgs."apple-sdk" ? frameworks)
22+
then pkgs."apple-sdk".frameworks
23+
else null;
24+
25+
legacyFrameworks =
26+
if (pkgs ? darwin) && (pkgs.darwin ? apple_sdk)
27+
then let
28+
legacyEval = builtins.tryEval pkgs.darwin.apple_sdk;
29+
in
30+
if legacyEval.success && legacyEval.value ? frameworks
31+
then legacyEval.value.frameworks
32+
else null
33+
else null;
34+
in
35+
if appleFrameworks != null
36+
then appleFrameworks
37+
else if legacyFrameworks != null
38+
then legacyFrameworks
39+
else {};
4040

4141
# Returns the resolved Darwin frameworks matching the requested names.
42-
addDarwinFrameworks = names:
43-
let
44-
frameworks = resolveDarwinFrameworks;
45-
in
46-
pkgs.lib.concatMap
47-
(name:
48-
if builtins.hasAttr name frameworks then [frameworks.${name}] else []
49-
)
50-
names;
42+
addDarwinFrameworks = names: let
43+
frameworks = resolveDarwinFrameworks;
44+
in
45+
pkgs.lib.concatMap
46+
(
47+
name:
48+
if builtins.hasAttr name frameworks
49+
then [frameworks.${name}]
50+
else []
51+
)
52+
names;
5153
in [
5254
# By default, most packages have their `Cargo.lock` file in the repo root.
5355
# We also specify a base, minimum Rust version. This version should never
@@ -160,12 +162,14 @@ in [
160162
# `fuel-core` vendors a build script that shells out to `cargo install`
161163
# for the WASM executor. During a Nix build we have no network, so we
162164
# rewrite the script to force cargo offline mode.
163-
postPatch = (m.postPatch or "") + ''
164-
find . -path '*/fuel-core-*/crates/services/upgradable-executor/build.rs' -print0 | while IFS= read -r -d '\0' f; do
165-
perl -0pi -e 's/let mut args = vec!\[\n/let mut args = vec![\n "--offline".to_owned(),\n/' "$f"
166-
perl -0pi -e 's/cargo.env\("CARGO_PROFILE_RELEASE_DEBUG", "false"\);\n/cargo.env("CARGO_PROFILE_RELEASE_DEBUG", "false");\n cargo.env("CARGO_NET_OFFLINE", "true");\n/' "$f"
167-
done
168-
'';
165+
postPatch =
166+
(m.postPatch or "")
167+
+ ''
168+
find . -path '*/fuel-core-*/crates/services/upgradable-executor/build.rs' -print0 | while IFS= read -r -d '\0' f; do
169+
perl -0pi -e 's/let mut args = vec!\[\n/let mut args = vec![\n "--offline".to_owned(),\n/' "$f"
170+
perl -0pi -e 's/cargo.env\("CARGO_PROFILE_RELEASE_DEBUG", "false"\);\n/cargo.env("CARGO_PROFILE_RELEASE_DEBUG", "false");\n cargo.env("CARGO_NET_OFFLINE", "true");\n/' "$f"
171+
done
172+
'';
169173
};
170174
}
171175

0 commit comments

Comments
 (0)