-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: Make bundling of dependencies separate from Haskell.nix build
- Loading branch information
Showing
5 changed files
with
74 additions
and
42 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