Skip to content

Commit 123fad9

Browse files
committed
[DDW-1189] Just expose windowsPackages instead
1 parent 743aa30 commit 123fad9

File tree

4 files changed

+31
-61
lines changed

4 files changed

+31
-61
lines changed

default.nix

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,18 @@ let
4141
chmod -R +w $out
4242
cd $out
4343
patch -p1 -i ${./nix/cardano-wallet--enable-aarch64-darwin.patch}
44-
patch -p1 -i ${./nix/cardano-wallet--expose-local-cluster.patch}
44+
patch -p1 -i ${./nix/cardano-wallet--expose-windowsPackages.patch}
4545
'';
4646
};
4747
haskell-nix = walletFlake.inputs.haskellNix.legacyPackages.${system}.haskell-nix;
4848
flake-compat = import sources.flake-compat;
4949
walletFlake = (flake-compat { src = sources.cardano-wallet; }).defaultNix;
50-
walletRelease = {
51-
x86_64-windows = walletFlake.packages.x86_64-linux.ci.artifacts.win64.release;
52-
x86_64-linux = walletFlake.packages.x86_64-linux.ci.artifacts.linux64.release;
53-
x86_64-darwin = walletFlake.packages.x86_64-darwin.ci.artifacts.macos-intel.release;
54-
aarch64-darwin = walletFlake.packages.aarch64-darwin.ci.artifacts.macos-silicon.release;
50+
walletPackages = {
51+
x86_64-windows = walletFlake.packages.x86_64-linux.windowsPackages;
52+
x86_64-linux = walletFlake.packages.x86_64-linux;
53+
x86_64-darwin = walletFlake.packages.x86_64-darwin;
54+
aarch64-darwin = walletFlake.packages.aarch64-darwin;
5555
}.${target};
56-
walletUnpacked = pkgs.runCommand "wallet-unpacked" {} ''
57-
mkdir -p $out/bin
58-
${if target == "x86_64-windows" then "${pkgs.unzip}/bin/unzip" else "tar -xf"} ${walletRelease}/*.*
59-
cp cardano-wallet-*/cardano-{address,cli,node,wallet} $out/bin/
60-
'';
6156
walletPkgs = walletFlake.legacyPackages.${system}.pkgs;
6257
cardanoWorldFlake = (flake-compat { src = sources.cardano-world; }).defaultNix.outputs;
6358
# only used for CLI, to be removed when upgraded to next node version
@@ -114,11 +109,11 @@ let
114109
bridgeTable = {
115110
cardano = self.callPackage ./nix/cardano-bridge.nix {};
116111
};
117-
cardano-wallet = walletUnpacked // { version = localLib.sources.cardano-wallet.branch + "-" + builtins.substring 0 9 localLib.sources.cardano-wallet.rev; };
118-
cardano-address = walletUnpacked;
119-
mock-token-metadata-server = throw "FIXME: no mock-token-metadata-server now, patch";
112+
inherit (walletPackages) cardano-wallet;
113+
inherit (walletPackages) cardano-address;
114+
inherit (walletPackages) mock-token-metadata-server;
120115
cardano-shell = import self.sources.cardano-shell { inherit system; crossSystem = crossSystem shellPkgs.lib; };
121-
local-cluster = if cluster == "selfnode" then throw "FIXME: no local-cluster now, patch" else null;
116+
local-cluster = if cluster == "selfnode" then walletPackages.local-cluster else null;
122117
cardano-node-cluster = let
123118
# Test wallets with known mnemonics
124119
walletTestGenesisYaml = (self.sources.cardano-wallet + "/lib/shelley/test/data/cardano-node-shelley/genesis.yaml");
@@ -134,10 +129,10 @@ let
134129
in (import self.sources.cardano-node { inherit system customConfig; crossSystem = crossSystem nodePkgs.lib; }).cluster;
135130
cardano-node = if useLocalNode
136131
then (import self.sources.cardano-node { inherit system; crossSystem = crossSystem nodePkgs.lib; }).cardano-node
137-
else walletUnpacked;
132+
else walletPackages.cardano-node;
138133
cardano-cli = if useLocalNode
139134
then (import self.sources.cardano-node { inherit system; crossSystem = crossSystem nodePkgs.lib; }).haskellPackages.cardano-cli
140-
else walletUnpacked;
135+
else walletPackages.cardano-cli;
141136
darwin-launcher = self.callPackage ./nix/darwin-launcher.nix {};
142137

143138
# a cross-compiled fastlist for the ps-list package

nix/cardano-bridge.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ runCommandCC "daedalus-cardano-bridge" {
3838
cp -f ${mock-token-metadata-server}/bin/* . || true
3939
cp -f ${./../utils/cardano/selfnode}/token-metadata.json .
4040
''}
41+
${lib.optionalString (target == "x86_64-linux") ''
42+
chmod +w -R .
43+
for x in cardano-address cardano-node cardano-launcher cardano-cli cardano-wallet; do
44+
$STRIP $x
45+
patchelf --shrink-rpath $x
46+
done
47+
''}
4148
${lib.optionalString (target == "aarch64-darwin") ''
4249
chmod +w -R .
4350
for x in cardano-address cardano-node cardano-launcher cardano-cli cardano-wallet; do

nix/cardano-wallet--expose-local-cluster.patch

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/flake.nix b/flake.nix
2+
index af206a740e..ef05414b85 100644
3+
--- a/flake.nix
4+
+++ b/flake.nix
5+
@@ -432,6 +432,7 @@
6+
nixosTests = import ./nix/nixos/tests {
7+
inherit pkgs project;
8+
};
9+
+ windowsPackages = mkPackages project.projectCross.mingwW64;
10+
}) // {
11+
# Continuous integration builds
12+
ci.tests.all = pkgs.releaseTools.aggregate {

0 commit comments

Comments
 (0)