edge-runtime: init at 1.6.7

This commit is contained in:
happysalada 2023-07-13 19:12:01 +08:00 committed by Yt
parent c625352b53
commit cb697b86b1
3 changed files with 94 additions and 0 deletions

View file

@ -0,0 +1,72 @@
{ stdenv
, lib
, callPackage
, fetchFromGitHub
, rustPlatform
, nix-update-script
, darwin
, openssl
, pkg-config
}:
let
pname = "edge-runtime";
version = "1.6.7";
in
rustPlatform.buildRustPackage {
inherit pname version;
src = fetchFromGitHub {
owner = "supabase";
repo = pname;
rev = "v${version}";
hash = "sha256-Jq9UXFgbTDKe1AWyg4fxn62ODqWu0AUqzlUOo+JUYpo=";
fetchSubmodules = true;
};
cargoHash = "sha256-fOqo9aPgpW6oAEHtZIE7iHjTIRrgDPbdSFBaq4s0r94=";
nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];
buildInputs = lib.optionals stdenv.isLinux [ openssl ]
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Security CoreFoundation ]);
# The v8 package will try to download a `librusty_v8.a` release at build time to our read-only filesystem
# To avoid this we pre-download the file and export it via RUSTY_V8_ARCHIVE
RUSTY_V8_ARCHIVE = callPackage ./librusty_v8.nix { };
passthru.updateScript = nix-update-script { };
preCheck = ''
export HOME=$(mktemp -d)
'';
checkFlags = [
# tries to make a network access
"--skip=deno_runtime::test::test_main_rt_fs"
"--skip=deno_runtime::test::test_main_runtime_creation"
"--skip=deno_runtime::test::test_os_env_vars"
"--skip=deno_runtime::test::test_os_ops"
"--skip=deno_runtime::test::test_user_runtime_creation"
"--skip=test_custom_readable_stream_response"
"--skip=test_import_map_file_path"
"--skip=test_import_map_inline"
"--skip=test_main_worker_options_request"
"--skip=test_main_worker_post_request"
"--skip=test_null_body_with_204_status"
"--skip=test_null_body_with_204_status_post"
"--skip=test_file_upload"
"--skip=test_oak_server"
"--skip=test_tls_throw_invalid_data"
"--skip=test_user_worker_json_imports"
"--skip=node::analyze::tests::test_esm_code_with_node_globals"
"--skip=node::analyze::tests::test_esm_code_with_node_globals_with_shebang"
];
meta = with lib; {
description = "A server based on Deno runtime, capable of running JavaScript, TypeScript, and WASM services";
homepage = "https://github.com/supabase/edge-runtime";
license = licenses.mit;
maintainers = with maintainers; [ happysalada ];
};
}

View file

@ -0,0 +1,20 @@
{ rust, stdenv, fetchurl }:
let
arch = rust.toRustTarget stdenv.hostPlatform;
fetch_librusty_v8 = args: fetchurl {
name = "librusty_v8-${args.version}";
url = "https://github.com/denoland/rusty_v8/releases/download/v${args.version}/librusty_v8_release_${arch}.a";
sha256 = args.shas.${stdenv.hostPlatform.system};
meta = { inherit (args) version; };
};
in
fetch_librusty_v8 {
version = "0.68.0";
shas = {
x86_64-linux = "sha256-yq7YPD2TM6Uw0EvCqIsZ/lbE1RLgIg7a42qDVrr5fX4=";
aarch64-linux = "sha256-uZFm3hAeyEUUXqRJFLM3OBVfglH3AecjFKVgeJZu3L0=";
x86_64-darwin = "sha256-YkxoggK0I4rT/KNJ30StDPLUc02Mdjwal3JH+s/YTQo=";
aarch64-darwin = "sha256-aXE7W3sSzbhvC661BYTTHyHlihmVVtFSv85nSjGOLkU=";
};
}

View file

@ -573,6 +573,8 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) CoreServices Security;
};
edge-runtime = callPackage ../development/web/edge-runtime { };
efficient-compression-tool = callPackage ../tools/compression/efficient-compression-tool { };
eludris = callPackage ../tools/misc/eludris {