2023-07-15 17:15:38 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, callPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, nix-update-script
|
|
|
|
, darwin
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "edge-runtime";
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "1.10.0";
|
2023-07-15 17:15:38 +00:00
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "supabase";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-AWdgqL7Io4v3Z4XNS5JDDGuUeSqsNpF/NpJQ7h5oJZs=";
|
2023-07-15 17:15:38 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
cargoHash = "sha256-AIwMoqbnCl4DFX0gSGblkV8DgtruwXPw8ngHeBDD6Dw=";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|