11 , librusty_v8 ? callPackage ./librusty_v8.nix { }
14 rustPlatform.buildRustPackage rec {
18 src = fetchFromGitHub {
22 hash = "sha256-DLVeI1pnHpUya8muVUP6VNXiLmlaedOOPPef3tHNOng=";
25 cargoHash = "sha256-qTvPpUBinPm3eQ5PLcqdCcZEG5Q6kGyt35mL914K9jk=";
28 # upstream uses lld on aarch64-darwin for faster builds
29 # within nix lld looks for CoreFoundation rather than CoreFoundation.tbd and fails
30 substituteInPlace .cargo/config.toml --replace '"-C", "link-arg=-fuse-ld=lld"' ""
33 # uses zlib-ng but can't dynamically link yet
34 # https://github.com/rust-lang/libz-sys/issues/158
36 # required by libz-ng-sys crate
38 # required by deno_kv crate
42 buildInputs = lib.optionals stdenv.isDarwin (
43 [ libiconv darwin.libobjc ] ++
44 (with darwin.apple_sdk.frameworks; [ Security CoreServices Metal Foundation QuartzCore ])
47 # work around "error: unknown warning group '-Wunused-but-set-parameter'"
48 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unknown-warning-option";
50 buildAndTestSubdir = "cli";
52 # The v8 package will try to download a `librusty_v8.a` release at build time to our read-only filesystem
53 # To avoid this we pre-download the file and export it via RUSTY_V8_ARCHIVE
54 RUSTY_V8_ARCHIVE = librusty_v8;
56 # Tests have some inconsistencies between runs with output integration tests
57 # Skipping until resolved
61 find ./target -name libswc_common${stdenv.hostPlatform.extensions.sharedLibrary} -delete
65 installShellCompletion --cmd deno \
66 --bash <($out/bin/deno completions bash) \
67 --fish <($out/bin/deno completions fish) \
68 --zsh <($out/bin/deno completions zsh)
71 doInstallCheck = true;
72 installCheckPhase = ''
73 runHook preInstallCheck
75 $out/bin/deno --version | grep "deno ${version}"
76 runHook postInstallCheck
79 passthru.updateScript = ./update/update.ts;
80 passthru.tests = callPackage ./tests { };
83 homepage = "https://deno.land/";
84 changelog = "https://github.com/denoland/deno/releases/tag/v${version}";
85 description = "A secure runtime for JavaScript and TypeScript";
87 Deno aims to be a productive and secure scripting environment for the modern programmer.
88 Deno will always be distributed as a single executable.
89 Given a URL to a Deno program, it is runnable with nothing more than the ~15 megabyte zipped executable.
90 Deno explicitly takes on the role of both runtime and package manager.
91 It uses a standard browser-compatible protocol for loading modules: URLs.
92 Among other things, Deno is a great replacement for utility scripts that may have been historically written with
95 license = licenses.mit;
97 maintainers = with maintainers; [ jk ];
98 platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];