Unverified Commit fb72a061 authored by misilelab's avatar misilelab
Browse files

deno: 2.1.10 -> 2.2.1

parent 91cdf52f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -2,11 +2,11 @@
{ fetchLibrustyV8 }:

fetchLibrustyV8 {
  version = "130.0.1";
  version = "134.4.0";
  shas = {
    x86_64-linux = "sha256-MKdqaIF3M7j9IraOezoP5szr+SDfTg0iUOEtwe76N7k=";
    aarch64-linux = "sha256-qc25H3Aj2KRhsAZ+2SD1c4RmweVK07oW71opZXRuUoc=";
    x86_64-darwin = "sha256-CYw4AdBjFXmRqkTcxqT9Z0n0rBTxUsqrHxcf8c9Q8ww=";
    aarch64-darwin = "sha256-d1QTLt8gOUFxACes4oyIYgDF/srLOEk+5p5Oj1ECajQ=";
    x86_64-linux = "sha256-yG9p8b0dQTtoa234eTRBumjQ5GWxWJFsKHbgNFCUUAA=";
    aarch64-linux = "sha256-5IrviupPjTUHTeuwmeA3FHuOy2H8qc05WNqRmlE0UJk=";
    x86_64-darwin = "sha256-RPEW5a51WjfYyPjvkKvFbs+fPTlsv9/2sFtqUdtz7EY=";
    aarch64-darwin = "sha256-PFyJTOYHWw3YOoG85w+y0899vc0+psz0TtCMXORcsHI=";
  };
}
+10 −4
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
    inherit (callPackage ./fetchers.nix { }) fetchLibrustyV8;
  },
  libffi,
  sqlite,
}:

let
@@ -18,17 +19,17 @@ let
in
rustPlatform.buildRustPackage rec {
  pname = "deno";
  version = "2.1.10";
  version = "2.2.1";

  src = fetchFromGitHub {
    owner = "denoland";
    repo = "deno";
    tag = "v${version}";
    hash = "sha256-1NqBNrTYHhsG6O2qsgANM15FOxx3xheE9T3nYDDH1D0=";
    hash = "sha256-WXAUsBC3nAJcuUB753dpM/WDzqWu+e/Kt/BrwQkk/dY=";
  };

  useFetchCargoVendor = true;
  cargoHash = "sha256-D7dt9RdlTmR2C1dwOl5vZKUlLUnTkdudtZ4FQpr9ddU=";
  cargoHash = "sha256-t44Q4yBdcYAk6jkRrzAHXBsJTsRTHAD95Wyxd3waaHc=";

  postPatch = ''
    # upstream uses lld on aarch64-darwin for faster builds
@@ -42,6 +43,7 @@ rustPlatform.buildRustPackage rec {
  # uses zlib-ng but can't dynamically link yet
  # https://github.com/rust-lang/libz-sys/issues/158
  nativeBuildInputs = [
    rustPlatform.bindgenHook
    # required by libz-ng-sys crate
    cmake
    # required by deno_kv crate
@@ -54,7 +56,11 @@ rustPlatform.buildRustPackage rec {
    "--disable-multi-os-directory"
  ];

  buildInputs = [ libffi ];
  buildInputs = [
    libffi
    # required by libsqlite3-sys
    sqlite.dev
  ];
  buildAndTestSubdir = "cli";

  # work around "error: unknown warning group '-Wunused-but-set-parameter'"
+4 −12
Original line number Diff line number Diff line
@@ -25,16 +25,12 @@ const fetchArchShaTasks = (version: string, arches: Architecture[]) =>
  arches.map(
    async (arch: Architecture): Promise<PrefetchResult> => {
      log("Fetching:", arch.nix);
      const sha256 = await run("nix-prefetch", [
        `
{ fetchurl }:
fetchurl {
  url = "https://github.com/denoland/rusty_v8/releases/download/v${version}/librusty_v8_release_${arch.rust}.a.gz";
}
`,
      const sha256 = await run("nix-prefetch-url", [
        `https://github.com/denoland/rusty_v8/releases/download/v${version}/librusty_v8_release_${arch.rust}.a.gz`
      ]);
      const sha256_sri = await run("nix-hash", ["--type", "sha256", "--to-sri", sha256]);
      log("Done:    ", arch.nix);
      return { arch, sha256 };
      return { arch, sha256: sha256_sri };
    },
  );

@@ -45,10 +41,6 @@ const templateDeps = (version: string, deps: PrefetchResult[]) =>
fetchLibrustyV8 {
  version = "${version}";
  shas = {
    x86_64-linux = "sha256-jLYl/CJp2Z+Ut6qZlh6u+CtR8KN+ToNTB+72QnVbIKM=";
    aarch64-linux = "sha256-uAkBMg6JXA+aILd8TzDtuaEdM3Axiw43Ad5tZzxNt5w=";
    x86_64-darwin = "sha256-60aR0YvQT8KyacY8J3fWKZcf9vny51VUB19NVpurS/A=";
    aarch64-darwin = "sha256-pd/I6Mclj2/r/uJTIywnolPKYzeLu1c28d/6D56vkzQ=";
${deps.map(({ arch, sha256 }) => `    ${arch.nix} = "${sha256}";`).join("\n")}
  };
}
+3 −3
Original line number Diff line number Diff line
@@ -16,11 +16,11 @@ interface Replacer {
const log = logger("src");

const prefetchHash = (nixpkgs: string, version: string) =>
  run("nix-prefetch", ["-f", nixpkgs, "deno.src", "--rev", version]);
  run("nurl", ["https://github.com/denoland/deno", version, "-H", "-n", nixpkgs]);
const prefetchCargoHash = (nixpkgs: string) =>
  run(
    "nix-prefetch",
    [`{ sha256 }: (import ${nixpkgs} {}).deno.cargoDeps.overrideAttrs (_: { hash = sha256; })`],
    "nurl",
    ["-e", `(import ${nixpkgs} {}).deno.cargoDeps.overrideAttrs (_: { hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; })`]
  );

const replace = (str: string, replacers: Replacer[]) =>
+1 −1
Original line number Diff line number Diff line
#!/usr/bin/env nix-shell
/*
#!nix-shell -i "deno run --allow-net --allow-run --allow-read --allow-write" -p deno git nix-prefetch
#!nix-shell -i "deno run --allow-net --allow-run --allow-read --allow-write" -p deno git nurl
*/
import { getExistingVersion, getLatestVersion, logger } from "./common.ts";
import { Architecture, updateLibrustyV8 } from "./librusty_v8.ts";