Last active
April 4, 2020 06:56
-
-
Save JLarky/09a8622dad083573222173abb2e17238 to your computer and use it in GitHub Desktop.
nix package (https://github.com/NixOS/nixpkgs) to install deno (https://deno.land/). See https://github.com/NixOS/nixpkgs/issues/78461
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
{ stdenv, fetchurl, unzip }: | |
# this is more stupid version of https://github.com/denoland/deno_install/blob/master/install.sh | |
# Run this to get last version: | |
# curl -sSf https://github.com/denoland/deno/releases | grep denoland/deno/releases/downloa | grep -e x86_64-apple-darwin -e x86_64-unknown-linux-gnu | head -2 | |
# based on https://qiita.com/kimagure/items/de2a4ff45dd8fe8be4b1 | |
stdenv.mkDerivation rec { | |
name = "deno-${version}"; | |
version = "v0.38.0"; | |
src = fetchurl ({ | |
x86_64-linux = { | |
url = "https://github.com/denoland/deno/releases/download/${version}/deno-x86_64-unknown-linux-gnu.zip"; | |
sha256 = "04bcrb7v6hj1rihh4hspwkjddab4xhw8rcrc8s199l12f0i5zpp7"; | |
}; | |
x86_64-darwin = { | |
url = "https://github.com/denoland/deno/releases/download/${version}/deno-x86_64-apple-darwin.zip"; | |
sha256 = "04fyslxk09y21sv6ypbm8kq79yylkkc8qwd3l0b4mbgszkdvrzdr"; | |
}; | |
}).${stdenv.hostPlatform.system}; | |
buildInputs = [ unzip ]; | |
## unzip deno into proper path | |
unpackPhase = '' | |
mkdir -p $out/bin | |
unzip $src -d $out/bin | |
''; | |
## don't run install, since the binary is already there | |
dontInstall = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment