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:
@@ -80,19 +80,26 @@ in rec {
|
|||||||
pname = "mempool-backend";
|
pname = "mempool-backend";
|
||||||
inherit version src;
|
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
|
# Placeholder: build once, then replace with the hash from the
|
||||||
# "hash mismatch" error output.
|
# "hash mismatch" error output.
|
||||||
npmDepsHash = lib.fakeHash;
|
npmDepsHash = lib.fakeHash;
|
||||||
|
|
||||||
patches = [ ./0001-allow-disabling-mining-pool-fetching.patch ];
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
makeWrapper
|
makeWrapper
|
||||||
rsync
|
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;
|
dontNpmBuild = true;
|
||||||
dontNpmInstall = true;
|
dontNpmInstall = true;
|
||||||
|
|
||||||
@@ -141,7 +148,11 @@ in rec {
|
|||||||
pname = "mempool-frontend";
|
pname = "mempool-frontend";
|
||||||
inherit version src;
|
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
|
# Placeholder: build once, then replace with the hash from the
|
||||||
# "hash mismatch" error output.
|
# "hash mismatch" error output.
|
||||||
|
|||||||
Reference in New Issue
Block a user