2018-07-26 21:34:09 +00:00
|
|
|
{ stdenv, makeWrapper, fetchurl, unzip, atomEnv, makeDesktopItem, buildFHSUserEnv, gtk2 }:
|
2018-04-09 21:41:25 +00:00
|
|
|
|
|
|
|
let
|
2018-07-26 21:34:09 +00:00
|
|
|
version = "0.11.1";
|
2018-11-04 23:32:52 +00:00
|
|
|
pname = "mist";
|
2018-04-09 21:41:25 +00:00
|
|
|
|
2018-08-20 19:11:29 +00:00
|
|
|
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
2018-04-09 21:41:25 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Browse and use Ðapps on the Ethereum network";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/ethereum/mist";
|
2018-04-09 21:41:25 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [];
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
urlVersion = builtins.replaceStrings ["."] ["-"] version;
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem rec {
|
|
|
|
name = "Mist";
|
|
|
|
exec = "mist";
|
|
|
|
icon = "mist";
|
|
|
|
desktopName = name;
|
|
|
|
genericName = "Mist Browser";
|
|
|
|
categories = "Network;";
|
|
|
|
};
|
|
|
|
|
2018-05-24 04:37:33 +00:00
|
|
|
mist = stdenv.lib.appendToName "unwrapped" (stdenv.mkDerivation {
|
2018-11-04 23:32:52 +00:00
|
|
|
inherit pname version meta;
|
2018-04-09 21:41:25 +00:00
|
|
|
|
|
|
|
src = {
|
|
|
|
i686-linux = fetchurl {
|
|
|
|
url = "https://github.com/ethereum/mist/releases/download/v${version}/Mist-linux32-${urlVersion}.zip";
|
2018-07-26 21:34:09 +00:00
|
|
|
sha256 = "1ffzp9aa0g6w3d5pzp69fljk3sd51cbqdgxa1x16vj106sqm0gj7";
|
2018-04-09 21:41:25 +00:00
|
|
|
};
|
|
|
|
x86_64-linux = fetchurl {
|
|
|
|
url = "https://github.com/ethereum/mist/releases/download/v${version}/Mist-linux64-${urlVersion}.zip";
|
2018-07-26 21:34:09 +00:00
|
|
|
sha256 = "0yx4x72l8gk68yh9saki48zgqx8k92xnkm79dc651wdpd5c25cz3";
|
2018-04-09 21:41:25 +00:00
|
|
|
};
|
2018-08-20 19:11:29 +00:00
|
|
|
}.${stdenv.hostPlatform.system} or throwSystem;
|
2018-04-09 21:41:25 +00:00
|
|
|
|
|
|
|
buildInputs = [ unzip makeWrapper ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/lib/mist $out/bin
|
|
|
|
unzip -d $out/lib/mist $src
|
|
|
|
ln -s $out/lib/mist/mist $out/bin
|
|
|
|
fixupPhase
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
ln -s ${desktopItem}/share/applications/* $out/share/applications
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2018-07-26 21:34:09 +00:00
|
|
|
--set-rpath "${atomEnv.libPath}:${gtk2}/lib:$out/lib/mist" \
|
2018-04-09 21:41:25 +00:00
|
|
|
$out/lib/mist/mist
|
|
|
|
'';
|
2018-05-24 04:37:33 +00:00
|
|
|
});
|
2018-04-09 21:41:25 +00:00
|
|
|
in
|
|
|
|
buildFHSUserEnv {
|
2018-07-26 21:34:09 +00:00
|
|
|
name = "mist";
|
|
|
|
inherit meta;
|
2018-04-09 21:41:25 +00:00
|
|
|
|
|
|
|
targetPkgs = pkgs: with pkgs; [
|
|
|
|
mist
|
|
|
|
];
|
|
|
|
|
|
|
|
extraInstallCommands = ''
|
|
|
|
mkdir -p "$out/share/applications"
|
|
|
|
cp "${desktopItem}/share/applications/"* $out/share/applications
|
|
|
|
'';
|
|
|
|
|
|
|
|
runScript = "mist";
|
|
|
|
}
|