Skip to content
Permalink
Browse files

add an example daedalus-bridge

  • Loading branch information...
cleverca22 committed Oct 10, 2019
1 parent 6c724be commit 1922fc723f2006d3b1bc373da9271f022d2eaaee
Showing with 52 additions and 8 deletions.
  1. +31 −0 daedalus-bridge.nix
  2. +21 −8 default.nix
@@ -0,0 +1,31 @@
{ target, pkgs, haskellPackages, system, crossSystem, jormungandr }:

let
commonLib = import ./nix/iohk-common.nix {};
pkgsCross = commonLib.getPkgs { crossSystem = pkgs.lib.systems.examples.mingwW64; };
cardano-shell-src = pkgs.fetchFromGitHub {
owner = "input-output-hk";
repo = "cardano-shell";
rev = "efba204c14a83b9e1af9bb138c2d551fe3d7a43e";
sha256 = "0cr260b1drj4yal91fxcai9007jgbi2i2mh3mjnkq2rzjz6rvh8s";
};
cardano-shell = import cardano-shell-src { inherit system crossSystem; }; # todo, shell should accept target
in pkgs.runCommandCC "daedalus-bridge" {} ''
mkdir -pv $out
cd $out
cp ${haskellPackages.cardano-wallet-jormungandr.components.exes.cardano-wallet-jormungandr}/bin/cardano-wallet-jormungandr* .
cp ${cardano-shell.nix-tools.cexes.cardano-launcher.cardano-launcher}/bin/cardano-launcher* .
#cp {nix-tools.cexes.cardano-node.cardano-node}/bin/cardano-node* .
${pkgs.lib.optionalString (target == "x86_64-windows") ''
echo ${jormungandr}
cp ${pkgsCross.libffi}/bin/libffi-6.dll .
cp ${pkgsCross.openssl.out}/lib/libeay32.dll .
''}
${pkgs.lib.optionalString (target == "x86_64-linux") ''
chmod +w -R .
for bin in cardano-launcher; do
strip $bin
patchelf --shrink-rpath $bin
done
''}
''
@@ -1,14 +1,25 @@
{ system ? builtins.currentSystem
, crossSystem ? null
, config ? {}
# Import IOHK common nix lib
, iohkLib ? import ./nix/iohk-common.nix { inherit system crossSystem config; }
# Use nixpkgs pin from iohkLib
, pkgs ? iohkLib.pkgs
{ config ? {}
, target ? builtins.currentSystem
}:

with import ./nix/util.nix { inherit pkgs; };

let
commonLib = import ./nix/iohk-common.nix {};
lib = commonLib.pkgs.lib;
systemTable = {
x86_64-windows = builtins.currentSystem;
};
crossSystemTable = {
x86_64-windows = lib.systems.examples.mingwW64;
};
system = systemTable.${target} or target;
crossSystem = crossSystemTable.${target} or null;
# Import IOHK common nix lib
iohkLib = import ./nix/iohk-common.nix { inherit system crossSystem config; };
# Use nixpkgs pin from iohkLib
pkgs = iohkLib.pkgs;
in
with import ./nix/util.nix { inherit pkgs; };
let
haskell = iohkLib.nix-tools.haskell { inherit pkgs; };
src = iohkLib.cleanSourceHaskell ./.;
@@ -39,6 +50,8 @@ in {
tests = collectComponents "tests" isCardanoWallet haskellPackages;
benchmarks = collectComponents "benchmarks" isCardanoWallet haskellPackages;

daedalus-bridge = import ./daedalus-bridge.nix { inherit target pkgs haskellPackages system crossSystem jormungandr; };

shell = haskellPackages.shellFor {
name = "cardano-wallet-shell";
packages = ps: with ps; [

0 comments on commit 1922fc7

Please sign in to comment.
You can’t perform that action at this time.