edge-runtime: nixfmt

This commit is contained in:
wxt 2024-11-04 15:36:32 +08:00
parent 64c924e098
commit 1221b2e0da
No known key found for this signature in database
GPG Key ID: F62181757D8BF693
2 changed files with 39 additions and 21 deletions

View File

@ -1,15 +1,21 @@
{ lib, stdenv, fetchurl }:
{
lib,
stdenv,
fetchurl,
}:
let
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_${stdenv.hostPlatform.rust.rustcTarget}.a";
sha256 = args.shas.${stdenv.hostPlatform.system};
meta = {
inherit (args) version;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
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_${stdenv.hostPlatform.rust.rustcTarget}.a";
sha256 = args.shas.${stdenv.hostPlatform.system};
meta = {
inherit (args) version;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
};
};
in
fetch_librusty_v8 {
version = "0.83.2";

View File

@ -1,12 +1,13 @@
{ stdenv
, lib
, callPackage
, fetchFromGitHub
, rustPlatform
, nix-update-script
, darwin
, openssl
, pkg-config
{
stdenv,
lib,
callPackage,
fetchFromGitHub,
rustPlatform,
nix-update-script,
darwin,
openssl,
pkg-config,
}:
let
@ -31,10 +32,21 @@ rustPlatform.buildRustPackage {
};
};
nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl ]
++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ Security CoreFoundation SystemConfiguration ]);
buildInputs =
lib.optionals stdenv.hostPlatform.isLinux [ openssl ]
++ lib.optionals stdenv.hostPlatform.isDarwin (
with darwin.apple_sdk.frameworks;
[
Security
CoreFoundation
SystemConfiguration
]
);
# 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