about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/web/deno/update/deps.ts
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-04-09 18:28:16 +0000
committerAlyssa Ross <hi@alyssa.is>2021-04-12 18:46:15 +0000
commitfd2e737e0678ee7d8081baef05b305146a2c0034 (patch)
treeac3e9b27576a0382335532d126f9a66d486bc638 /nixpkgs/pkgs/development/web/deno/update/deps.ts
parentcc207d720b6aa836e256c1ee9842bc739e630a8a (diff)
parent9e377a6ce42dccd9b624ae4ce8f978dc892ba0e2 (diff)
downloadnixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.gz
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.bz2
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.lz
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.xz
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.zst
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.zip
Merge remote-tracking branch 'nixpkgs/nixos-unstable'
Diffstat (limited to 'nixpkgs/pkgs/development/web/deno/update/deps.ts')
-rw-r--r--nixpkgs/pkgs/development/web/deno/update/deps.ts79
1 files changed, 0 insertions, 79 deletions
diff --git a/nixpkgs/pkgs/development/web/deno/update/deps.ts b/nixpkgs/pkgs/development/web/deno/update/deps.ts
deleted file mode 100644
index beedeade3a86..000000000000
--- a/nixpkgs/pkgs/development/web/deno/update/deps.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-import {
-  getExistingVersion,
-  genValueRegExp,
-  logger,
-  nixPrefetchURL,
-  versionRegExp,
-  write,
-} from "./common.ts";
-
-const log = logger("deps");
-
-export interface Architecture {
-  nix: string;
-  rust: string;
-}
-interface PrefetchResult {
-  arch: Architecture;
-  sha256: string;
-}
-
-const getRustyV8Version = async (
-  owner: string,
-  repo: string,
-  version: string,
-) =>
-  fetch(
-    `https://github.com/${owner}/${repo}/raw/${version}/core/Cargo.toml`,
-  )
-    .then((res) => res.text())
-    .then((txt) =>
-      txt.match(genValueRegExp("rusty_v8", versionRegExp))?.shift()
-    );
-
-const archShaTasks = (version: string, arches: Architecture[]) =>
-  arches.map(async (arch: Architecture): Promise<PrefetchResult> => {
-    log("Fetching:", arch.nix);
-    const sha256 = await nixPrefetchURL(
-      [`https://github.com/denoland/rusty_v8/releases/download/v${version}/librusty_v8_release_${arch.rust}.a`],
-    );
-    log("Done:    ", arch.nix);
-    return { arch, sha256 };
-  });
-
-const templateDeps = (version: string, deps: PrefetchResult[]) =>
-  `# auto-generated file -- DO NOT EDIT!
-{}:
-rec {
-  rustyV8Lib = {
-    version = "${version}";
-    sha256s = {
-${deps.map((d) => `      ${d.arch.nix} = "${d.sha256}";`).join("\n")}
-    };
-  };
-}
-`;
-
-export async function updateDeps(
-  filePath: string,
-  owner: string,
-  repo: string,
-  denoVersion: string,
-  arches: Architecture[],
-) {
-  log("Starting deps update");
-  // 0.0.0
-  const version = await getRustyV8Version(owner, repo, denoVersion);
-  if (typeof version !== "string") {
-    throw "no rusty_v8 version";
-  }
-  log("rusty_v8 version:", version);
-  const existingVersion = await getExistingVersion(filePath);
-  if (version === existingVersion) {
-    log("Version already matches latest, skipping...");
-    return;
-  }
-  const archShaResults = await Promise.all(archShaTasks(version, arches));
-  await write(filePath, templateDeps(version, archShaResults));
-  log("Finished deps update");
-}