From d7d416a5bbceded4dfa774d54df7847b92157f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 13 Mar 2024 13:23:50 +0200 Subject: [PATCH] turbo: take from unstable --- flake.nix | 3 +++ pkgs/turbo.nix | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 pkgs/turbo.nix diff --git a/flake.nix b/flake.nix index b9af132..caed622 100644 --- a/flake.nix +++ b/flake.nix @@ -109,6 +109,9 @@ tmuxbash = super.callPackage ./pkgs/tmuxbash.nix {}; nicer = super.callPackage ./pkgs/nicer.nix {}; gamja = super.callPackage ./pkgs/gamja.nix {}; + + # TODO: copied from 24.05 + turbo = super.callPackage ./pkgs/turbo.nix {}; }) (_: _: { crossArm64 = import nixpkgs { diff --git a/pkgs/turbo.nix b/pkgs/turbo.nix new file mode 100644 index 0000000..604d29a --- /dev/null +++ b/pkgs/turbo.nix @@ -0,0 +1,72 @@ +{ + stdenv, + lib, + fetchFromGitHub, + protobuf, + rustPlatform, + pkg-config, + openssl, + extra-cmake-modules, + fontconfig, + rust-jemalloc-sys, + testers, + turbo, + nix-update-script, + IOKit, + CoreServices, + CoreFoundation, + capnproto, +}: +rustPlatform.buildRustPackage rec { + pname = "turbo"; + version = "1.11.3"; + src = fetchFromGitHub { + owner = "vercel"; + repo = "turbo"; + rev = "v${version}"; + hash = "sha256-hjJXbGct9ZmriKdVjB7gwfmFsV1Tv57V7DfUMFZ8Xv0="; + }; + cargoBuildFlags = [ + "--package" + "turbo" + ]; + RELEASE_TURBO_CLI = "true"; + + cargoHash = "sha256-bAXO4Lqv4ibo+fz3679MjNgP2MMY8TbxhG0+DRy0xcA="; + + RUSTC_BOOTSTRAP = 1; + nativeBuildInputs = [ + pkg-config + extra-cmake-modules + protobuf + capnproto + ]; + buildInputs = + [ + openssl + fontconfig + rust-jemalloc-sys + ] + ++ lib.optionals stdenv.isDarwin [ + IOKit + CoreServices + CoreFoundation + ]; + + # Browser tests time out with chromium and google-chrome + doCheck = false; + + passthru = { + updateScript = nix-update-script { + extraArgs = ["--version-regex" "^\d+\.\d+\.\d+$"]; + }; + tests.version = testers.testVersion {package = turbo;}; + }; + + meta = with lib; { + description = "High-performance build system for JavaScript and TypeScript codebases"; + homepage = "https://turbo.build/"; + maintainers = with maintainers; [dlip]; + license = licenses.mpl20; + }; +}