2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, makeWrapper, fetchurl, unzip, atomEnv, makeDesktopItem, buildFHSUserEnv }:
|
2018-04-09 22:41:25 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
version = "0.10.0";
|
|
|
|
name = "mist-${version}";
|
|
|
|
|
|
|
|
throwSystem = throw "Unsupported system: ${stdenv.system}";
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Browse and use Ðapps on the Ethereum network";
|
|
|
|
homepage = https://github.com/ethereum/mist;
|
|
|
|
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 05:37:33 +01:00
|
|
|
mist = stdenv.lib.appendToName "unwrapped" (stdenv.mkDerivation {
|
2018-07-20 18:56:59 +01:00
|
|
|
inherit name version meta;
|
2018-04-09 22:41:25 +01:00
|
|
|
|
|
|
|
src = {
|
|
|
|
i686-linux = fetchurl {
|
|
|
|
url = "https://github.com/ethereum/mist/releases/download/v${version}/Mist-linux32-${urlVersion}.zip";
|
|
|
|
sha256 = "01hvxlm9w522pwvsjdy18gsrapkfjr7d1jjl4bqjjysxnjaaj2lk";
|
|
|
|
};
|
|
|
|
x86_64-linux = fetchurl {
|
|
|
|
url = "https://github.com/ethereum/mist/releases/download/v${version}/Mist-linux64-${urlVersion}.zip";
|
|
|
|
sha256 = "01k17j7fdfhxfd26njdsiwap0xnka2536k9ydk32czd8db7ya9zi";
|
|
|
|
};
|
|
|
|
}.${stdenv.system} or throwSystem;
|
|
|
|
|
|
|
|
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)" \
|
|
|
|
--set-rpath "${atomEnv.libPath}:$out/lib/mist" \
|
|
|
|
$out/lib/mist/mist
|
|
|
|
'';
|
2018-05-24 05:37:33 +01:00
|
|
|
});
|
2018-04-09 22:41:25 +01:00
|
|
|
in
|
|
|
|
buildFHSUserEnv {
|
2018-07-20 18:56:59 +01:00
|
|
|
inherit name meta;
|
2018-04-09 22:41:25 +01:00
|
|
|
|
|
|
|
targetPkgs = pkgs: with pkgs; [
|
|
|
|
mist
|
|
|
|
];
|
|
|
|
|
|
|
|
extraInstallCommands = ''
|
|
|
|
mkdir -p "$out/share/applications"
|
|
|
|
cp "${desktopItem}/share/applications/"* $out/share/applications
|
|
|
|
'';
|
|
|
|
|
|
|
|
runScript = "mist";
|
|
|
|
}
|