Skip to content

Commit

Permalink
taler-wallet-core: use nixpkgs new pnpm support
Browse files Browse the repository at this point in the history
  • Loading branch information
Atemu committed Jun 10, 2024
1 parent 5d70eca commit e680d4d
Showing 1 changed file with 11 additions and 50 deletions.
61 changes: 11 additions & 50 deletions pkgs/by-name/taler-wallet-core/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
fetchgit,
git,
jq,
moreutils,
nodePackages,
cacert,
python3,
zip,
pnpm,
}: let
esbuild_0_19_9 = buildGoModule rec {
pname = "esbuild";
Expand Down Expand Up @@ -38,8 +37,9 @@
mainProgram = "esbuild";
};
};
taler-wallet-core-pnpm-deps = stdenv.mkDerivation rec {
pname = "taler-wallet-core-pnpm-deps";
in
stdenv.mkDerivation rec {
pname = "taler-wallet-core";
version = "0.11.2";

src = fetchgit {
Expand All @@ -48,60 +48,23 @@
hash = "sha256-GtR87XqmunYubh9EiY3bJIqXiXrT+re3KqWypYK3NCo=";
};

nativeBuildInputs = [
jq
moreutils
nodePackages.pnpm
cacert
];

dontBuild = true;

installPhase = ''
runHook preInstall
export HOME=$(mktemp -d)
pnpm config set store-dir $out
pnpm install --frozen-lockfile --ignore-script
rm -rf $out/v3/tmp
for f in $(find $out -name "*.json"); do
sed -i -E -e 's/"checkedAt":[0-9]+,//g' $f
jq --sort-keys . $f | sponge $f
done
runHook postInstall
'';

dontFixup = true;

outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash =
{
aarch64-linux = "sha256-8n/vM4RVyfbYf34i5CtlI/Hj9LGZtCpgYVnOvBZI7x4=";
x86_64-linux = "sha256-gsWbzFNy/bH+MLisiRms+sjF0fIdbChFbWjbhl8eA+Q=";
}
.${stdenv.system}
or (throw "Unsupported system: ${stdenv.system}");
};
in
stdenv.mkDerivation {
pname = "taler-wallet-core";
inherit (taler-wallet-core-pnpm-deps) version src;

nativeBuildInputs = [
git
jq
nodePackages.nodejs
nodePackages.pnpm
pnpm.configHook
python3
zip
];

pnpmDeps = pnpm.fetchDeps {
inherit pname version src;
hash = "sha256-RdG/QnZNIvQIMU7ScSFz2OfbctHBr65GWXLPvVaybfQ=";
};

buildInputs = [nodePackages.nodejs];

# Use a fake git?
postUnpack = ''
git init -b master
git config user.email "root@localhost"
Expand All @@ -122,8 +85,6 @@ in
preBuild = ''
export HOME=$(mktemp -d)
pnpm config set store-dir ${taler-wallet-core-pnpm-deps}
pnpm install --offline --frozen-lockfile --ignore-script
patchShebangs node_modules/{*,.*}
'';

Expand Down

0 comments on commit e680d4d

Please sign in to comment.