Skip to content

Commit

Permalink
taler-wallet-core: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrosame committed Dec 30, 2023
1 parent 8d5507c commit d517ceb
Show file tree
Hide file tree
Showing 6 changed files with 17,814 additions and 1 deletion.
24 changes: 24 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
inputs.rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
inputs.dream2nix.url = "github:nix-community/dream2nix";
inputs.dream2nix.inputs.nixpkgs.follows = "nixpkgs";
# nix-community/pnpm2nix is unmaintained
inputs.pnpm2nix-nzbr.url = "github:nzbr/pnpm2nix-nzbr";
inputs.pnpm2nix-nzbr.inputs.flake-utils.follows = "flake-utils";
inputs.pnpm2nix-nzbr.inputs.nixpkgs.follows = "nixpkgs";

outputs = {
self,
Expand All @@ -26,6 +30,7 @@
sops-nix,
rust-overlay,
dream2nix,
pnpm2nix-nzbr,
...
}: let
inherit
Expand Down Expand Up @@ -105,7 +110,7 @@
rawNixosConfigs;

eachDefaultSystemOutputs = flake-utils.lib.eachDefaultSystem (system: let
pkgs = importNixpkgs system [rust-overlay.overlays.default];
pkgs = importNixpkgs system [rust-overlay.overlays.default pnpm2nix-nzbr.overlays.default];
treefmtEval = loadTreefmt pkgs;
toplevel = name: config: nameValuePair "${name}-toplevel" config.config.system.build.toplevel;
in {
Expand Down
25 changes: 25 additions & 0 deletions pkgs/by-name/wallet-core/fix-broken-esbuild.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e7dd4448a..d0068dab8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -5108,7 +5108,7 @@ packages:
dependencies:
'@babel/core': 7.22.1
'@linaria/babel-preset': 3.0.0-beta.23
- esbuild: 0.12.29
+ esbuild: 0.17.19
transitivePeerDependencies:
- supports-color
dev: true
@@ -9192,11 +9192,6 @@ packages:
resolution: {integrity: sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==}
dev: true

- /[email protected]:
- resolution: {integrity: sha512-w/XuoBCSwepyiZtIRsKsetiLDUVGPVw1E/R3VTFSecIy8UR7Cq3SOtwKHJMFoVqqVG36aGkzh4e8BvpO1Fdc7g==}
- requiresBuild: true
- dev: true
-
/[email protected]:
resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==}
engines: {node: '>=12'}
18 changes: 18 additions & 0 deletions pkgs/by-name/wallet-core/no-git-bootstrap.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/bootstrap b/bootstrap
index 217bba297..143674d11 100755
--- a/bootstrap
+++ b/bootstrap
@@ -5,13 +5,6 @@

set -eu

-if ! git --version >/dev/null; then
- echo "git not installed"
- exit 1
-fi
-
-git submodule update --init
-
copy_configure() {
src=$1
dst=$2
46 changes: 46 additions & 0 deletions pkgs/by-name/wallet-core/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
fetchgit,
lib,
jq,
nodejs_18,
python3,
zip,
callPackage,
mkPnpmPackage,
}: let
pname = "wallet-core";
version = "0.9.3";

patches = [
./no-git-bootstrap.patch
./fix-broken-esbuild.patch
];

src = fetchgit {
url = "https://git.taler.net/wallet-core.git";
rev = "v${version}";
hash = "sha256-9skF2jPkODnREFM9FOMroCjlkbVQ2V9SfiqGvhUbgvc=";
fetchSubmodules = true;
leaveDotGit = true; # Required for correct submodule fetching
# Delete .git folder for reproducibility (otherwise, the hash changes unexpectedly after fetching submodules)
postFetch = ''
(
cd $out
rm -rf .git
)
'';
};

nodejs = nodejs_18;
in
mkPnpmPackage {
inherit nodejs patches pname src version;

pnpm = nodejs.pkgs.pnpm;

# This is the lockfile with './fix-broken-esbuild.patch' applied
# mkPnpmPackage does not apply the patch even if we pass the patches.
pnpmLockYaml = ./. + "/pnpm-lock.yaml";

script = "compile --offline";
}
Loading

0 comments on commit d517ceb

Please sign in to comment.