Mempool: fix npmDeps fetcher — postUnpack instead of sourceRoot, postPatch instead of patches

The `patches` attribute was being applied inside the npmDeps
fixed-output derivation where patch runs interactively and fails.
sourceRoot also caused the deps fetcher to hash a different tree than
expected. Now:

- postUnpack cds into the subdir for both the fetcher and main build
- postPatch applies the mining-pool patch only in the main build
- npmDepsHash values remain placeholders (lib.fakeHash)
This commit is contained in:
Sovran Systems
2026-08-10 17:11:30 -05:00
parent 4d8bb06d41
commit 6021691b3f
+15 -4
View File
@@ -80,19 +80,26 @@ in rec {
pname = "mempool-backend";
inherit version src;
sourceRoot = "source/backend";
# Use postUnpack (not sourceRoot) so the npmDeps fixed-output
# derivation hashes the same unpacked tree as the main build.
postUnpack = ''
cd source/backend
'';
# Placeholder: build once, then replace with the hash from the
# "hash mismatch" error output.
npmDepsHash = lib.fakeHash;
patches = [ ./0001-allow-disabling-mining-pool-fetching.patch ];
nativeBuildInputs = [
makeWrapper
rsync
];
# Apply patches only in the main build, not in the npmDeps fetcher.
postPatch = ''
patch -p1 < ${./0001-allow-disabling-mining-pool-fetching.patch}
'';
dontNpmBuild = true;
dontNpmInstall = true;
@@ -141,7 +148,11 @@ in rec {
pname = "mempool-frontend";
inherit version src;
sourceRoot = "source/frontend";
# Use postUnpack (not sourceRoot) so the npmDeps fixed-output
# derivation hashes the same unpacked tree as the main build.
postUnpack = ''
cd source/frontend
'';
# Placeholder: build once, then replace with the hash from the
# "hash mismatch" error output.