From 63a859c835148abcad17ff54af1fe84e61f417cb Mon Sep 17 00:00:00 2001 From: Dov Alperin Date: Tue, 5 Jul 2022 22:02:41 -0400 Subject: [PATCH] bun: init at 0.1.1 --- maintainers/maintainer-list.nix | 9 ++++ pkgs/development/web/bun/default.nix | 61 ++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 72 insertions(+) create mode 100644 pkgs/development/web/bun/default.nix diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 37f33173be1f..061249174d9d 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -2768,6 +2768,15 @@ githubId = 16895361; name = "Deniz Alp Durmaz"; }; + DAlperin = { + email = "git@dov.dev"; + github = "DAlperin"; + githubId = 16063713; + name = "Dov Alperin"; + keys = [{ + fingerprint = "4EED 5096 B925 86FA 1101 6673 7F2C 07B9 1B52 BB61"; + }]; + }; DamienCassou = { email = "damien@cassou.me"; github = "DamienCassou"; diff --git a/pkgs/development/web/bun/default.nix b/pkgs/development/web/bun/default.nix new file mode 100644 index 000000000000..04124379b147 --- /dev/null +++ b/pkgs/development/web/bun/default.nix @@ -0,0 +1,61 @@ +{ stdenvNoCC, callPackage, fetchurl, autoPatchelfHook, unzip, openssl, lib }: +let + dists = { + aarch64-darwin = { + arch = "aarch64"; + shortName = "darwin"; + sha256 = "06kf4dyb8y486r2bbpz8znnaxah9y2hwc9km3cigacfchi4dy28j"; + }; + + x86_64-darwin = { + arch = "x64"; + shortName = "darwin"; + sha256 = "06q8cajxra8lgyd1ap6iqzqdw31gkvlc6l2ma0mm22y63msgdn8b"; + }; + + x86_64-linux = { + arch = "x64"; + shortName = "linux"; + sha256 = "038w54yyk94042hg27hfm49w12xsg8wh0skza9l9iybvc9qlvh2i"; + }; + }; + dist = dists.${stdenvNoCC.hostPlatform.system} or (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}"); +in +stdenvNoCC.mkDerivation rec { + version = "0.1.1"; + pname = "bun"; + + src = fetchurl { + url = "https://github.com/Jarred-Sumner/bun-releases-for-updater/releases/download/bun-v${version}/bun-${dist.shortName}-${dist.arch}.zip"; + sha256 = dist.sha256; + }; + + strictDeps = true; + nativeBuildInputs = [ unzip ] ++ lib.optionals stdenvNoCC.isLinux [ autoPatchelfHook ]; + buildInputs = [ openssl ]; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + install -Dm 755 ./bun $out/bin/bun + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://bun.sh"; + changelog = "https://github.com/Jarred-Sumner/bun/releases/tag/bun-v${version}"; + description = "Incredibly fast JavaScript runtime, bundler, transpiler and package manager – all in one"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + longDescription = '' + All in one fast & easy-to-use tool. Instead of 1,000 node_modules for development, you only need bun. + ''; + license = with licenses; [ + mit # bun core + lgpl21Only # javascriptcore and webkit + ]; + maintainers = with maintainers; [ DAlperin jk ]; + platforms = builtins.attrNames dists; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f631ef09a800..28a17b4498c4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12565,6 +12565,8 @@ with pkgs; tex = texlive.combined.scheme-full; }; + bun = callPackage ../development/web/bun { }; + cakelisp = callPackage ../development/compilers/cakelisp { }; ciao = callPackage ../development/compilers/ciao { };