-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
864: nix: Provide derivations for Daedalus installer r=KtorZ a=rvl Relates to #863. Based on #828. # Overview - @disassembler @cleverca22 It's not exactly the same as before but should work ok I think. - Adds source filtering to avoid unnecessary rebuilds. # Comments To build: ``` nix-build -A cardano-wallet-jormungandr nix-build release.nix -A daedalus-jormungandr.windows -o daedalus-jormungandr-windows nix-build release.nix -A daedalus-jormungandr.macos -o daedalus-jormungandr-macos nix-build release.nix -A daedalus-jormungandr.linux -o daedalus-jormungandr-linux ``` Note that `daedalus-jormungandr.{windows,macos,linux}` from `release.nix` reference the same `cardano-wallet-jormungandr` derivation, only with different `system` or `crossSystem` arguments. So Daedalus may also import from `default.nix` rather than `release.nix`. Co-authored-by: Rodney Lorrimar <[email protected]>
- Loading branch information
Showing
6 changed files
with
158 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
############################################################################ | ||
# Release package for cardano-wallet-jormungandr | ||
# | ||
# This makes release builds of cardano-wallet-jormungandr and bundles | ||
# dependencies as required for different systems. | ||
# | ||
############################################################################ | ||
|
||
{ pkgs | ||
, version | ||
, cardano-wallet-jormungandr | ||
, jmPkgs ? import ./jormungandr.nix { inherit pkgs; } | ||
, jormungandr ? jmPkgs.jormungandr | ||
, jormungandr-win64 ? jmPkgs.jormungandr-win64 | ||
}: | ||
|
||
with pkgs.lib; | ||
|
||
let | ||
name = "cardano-wallet-jormungandr-${version}"; | ||
|
||
deps = { | ||
nix = '' | ||
strip $out/bin/cardano-wallet-jormungandr | ||
wrapProgram $out/bin/cardano-wallet-jormungandr \ | ||
--prefix PATH : ${jormungandr}/bin | ||
''; | ||
darwin = '' | ||
cp ${jormungandr}/bin/* $out/bin | ||
''; | ||
windows = '' | ||
cp -v ${pkgs.libffi}/bin/libffi-6.dll $out/bin | ||
cp ${jormungandr-win64}/* $out/bin | ||
''; | ||
}; | ||
provideDeps = { nix, darwin ? "", windows ? "" }: | ||
with pkgs.stdenv.hostPlatform; | ||
if isWindows then windows else (if isDarwin then darwin else nix); | ||
|
||
in pkgs.runCommand name { | ||
inherit version; | ||
nativeBuildInputs = [ pkgs.makeWrapper pkgs.binutils ]; | ||
} '' | ||
cp -R ${cardano-wallet-jormungandr} $out | ||
chmod -R +w $out | ||
${provideDeps deps} | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
############################################################################ | ||
# Windows release CARDAN~1.ZIP | ||
# | ||
# This bundles up the windows build and its dependencies, adds an | ||
# example self-node configuration, and some .BAT files for launching, | ||
# and sets up the Hydra build artifact. | ||
# | ||
############################################################################ | ||
|
||
{ pkgs | ||
, cardano-wallet-jormungandr | ||
, project | ||
}: | ||
|
||
let | ||
testData = ../lib/jormungandr/test/data/jormungandr; | ||
name = "cardano-wallet-jormungandr-${project.version}-win64"; | ||
jm-bat = pkgs.writeText "jm.bat" '' | ||
jormungandr.exe --config config.yaml --genesis-block block0.bin --secret secret.yaml | ||
''; | ||
cw-bat = pkgs.writeText "cw.bat" '' | ||
cardano-wallet-jormungandr.exe serve --node-port 8081 --genesis-hash HASH --database c:\\cardano-wallet-jormungandr\\wallet.db | ||
''; | ||
in pkgs.runCommand name { | ||
nativeBuildInputs = [ pkgs.zip pkgs.jq pkgs.gnused project.jormungandr-cli ]; | ||
} '' | ||
mkdir -pv jm $out/nix-support | ||
cd jm | ||
cp -v ${cardano-wallet-jormungandr}/bin/* . | ||
cp -v ${testData}/block0.bin ${testData}/secret.yaml . | ||
cp -v ${jm-bat} jm.bat | ||
hash="$(jcli genesis hash --input block0.bin)" | ||
sed -e "s/HASH/$hash/" ${cw-bat} > cw.bat | ||
sed -e 's/storage:.*/storage: "c:\\\\cardano-wallet-jormungandr\\\\storage"/' \ | ||
${testData}/config.yaml > config.yaml | ||
chmod -R +w . | ||
zip -r $out/${name}.zip . | ||
echo "file binary-dist $out/${name}.zip" > $out/nix-support/hydra-build-products | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters