Skip to content

Commit bf46279

Browse files
spago 0.93.45
1 parent d7ed2f4 commit bf46279

File tree

4 files changed

+32
-14
lines changed

4 files changed

+32
-14
lines changed

generate/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ in
2525
stdenv.mkDerivation rec {
2626
name = "bin";
2727
src = ./.;
28+
29+
meta.description = "Generate and verify purescript-overlay manifests";
30+
2831
nativeBuildInputs = [
2932
purs-backend-es
3033
purs-tidy

manifests/build-support/mkDerivation.nix

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
stdenv,
99
fetchurl,
1010
nodejs,
11-
nodejs_20,
11+
nodejs_20 ? null,
1212
python3,
1313
darwin,
1414
nodePackages,
@@ -22,6 +22,13 @@ let
2222
commonMeta = meta lib // {
2323
mainProgram = name;
2424
};
25+
26+
isSpago = name == "spago";
27+
28+
# Legacy spago versions (< 0.93.45) require Node.js 20 due to better-sqlite3
29+
# build issues with Node 22+. Spago 0.93.45+ works with the standard nodejs.
30+
# See: https://github.com/purescript/registry-dev/blob/87c5900ff6fb7090cf2b085b7eb3f75371560522/nix/overlay.nix#L152
31+
isLegacySpago = isSpago && builtins.compareVersions version "0.93.45" < 0;
2532
in
2633
# Simple tarball without dependencies - just extract and link
2734
if isSimpleTarball then
@@ -55,31 +62,25 @@ if isSimpleTarball then
5562
# Package with npm dependencies - use buildNpmPackage
5663
else
5764
let
58-
# Use Node.js 20 for spago to avoid better-sqlite3 build issues with Node 22+
59-
# Same approach as registry-dev: https://github.com/purescript/registry-dev/blob/87c5900ff6fb7090cf2b085b7eb3f75371560522/nix/overlay.nix#L152
60-
isSpago = name == "spago";
61-
selectedNodejs = if isSpago then nodejs_20 else nodejs;
65+
selectedNodejs = if isLegacySpago then nodejs_20 else nodejs;
6266

6367
packageJson =
64-
if (builtins.hasAttr "lockfile" source) then
68+
if builtins.hasAttr "lockfile" source then
6569
fetchurl source.lockfile
6670
else
6771
"${./. + ("/" + source.path)}";
6872

69-
baseNativeBuildInputs = [ selectedNodejs ];
70-
71-
# Spago needs additional native build tools for better-sqlite3
73+
# Spago needs native build tools for better-sqlite3
7274
spagoNativeBuildInputs = [
7375
nodePackages.node-gyp
7476
python3
7577
]
7678
++ lib.optionals stdenv.isDarwin [ darwin.cctools ];
77-
78-
allNativeBuildInputs = baseNativeBuildInputs ++ lib.optionals isSpago spagoNativeBuildInputs;
7979
in
8080
(buildNpmPackage.override { nodejs = selectedNodejs; }) {
8181
pname = name;
8282
inherit version;
83+
8384
src = fetchurl source.tarball;
8485

8586
postPatch = ''
@@ -88,14 +89,17 @@ else
8889

8990
npmDepsHash = source.depsHash;
9091

91-
nativeBuildInputs = allNativeBuildInputs;
92+
nativeBuildInputs = [ selectedNodejs ] ++ lib.optionals isSpago spagoNativeBuildInputs;
9293

9394
# The prepack script runs the build script, but (so far) all derivations
9495
# are pre-built.
9596
npmPackFlags = [ "--ignore-scripts" ];
9697
dontNpmBuild = true;
9798

98-
npmInstallFlags = [ "--loglevel=verbose" ] ++ lib.optionals isSpago [ "--omit=optional" ];
99+
npmInstallFlags = [
100+
"--logs-max=0"
101+
"--omit=optional"
102+
];
99103

100104
meta = commonMeta;
101105
}

manifests/named.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"purs-stable": "purs-0_15_15",
33
"purs-unstable": "purs-0_15_16-8",
44
"spago-stable": "spago-0_21_0",
5-
"spago-unstable": "spago-0_93_44",
5+
"spago-unstable": "spago-0_93_45",
66
"purs-tidy-stable": "purs-tidy-0_11_1",
77
"purs-tidy-unstable": "purs-tidy-0_11_1",
88
"purs-backend-es-stable": "purs-backend-es-1_4_3",

manifests/spago.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,5 +503,16 @@
503503
"hash": "sha256-vVWBh9swDO95o9Uq3hVe8sisncDg2/lMX8oasMQnmTo=",
504504
"url": "https://registry.npmjs.org/spago/-/spago-0.93.44.tgz"
505505
}
506+
},
507+
"0.93.45": {
508+
"depsHash": "sha256-fkloxeiFLgMtkN+UuwT+6J0p7uFkVKcKDPu2QaA0GIY=",
509+
"lockfile": {
510+
"hash": "sha256-EX5LPflx9eiP/tRqT3s+Lk7rZ37MPJ8H9uJFi1oiTwE=",
511+
"url": "https://raw.githubusercontent.com/purescript/spago/b24967344cbc2547cf593b05ccb8d169692a8589/package-lock.json"
512+
},
513+
"tarball": {
514+
"hash": "sha256-HObabcu18qVQbgg+HwRe64wPTCywJfMzlQqBLww5xfI=",
515+
"url": "https://registry.npmjs.org/spago/-/spago-0.93.45.tgz"
516+
}
506517
}
507518
}

0 commit comments

Comments
 (0)