Skip to content

Commit

Permalink
Merge pull request #328295 from getchoo/pkgs/turbo/2.0.7
Browse files Browse the repository at this point in the history
turbo: 1.13.2 -> 2.0.11; modernize; adopt
  • Loading branch information
Atemu authored Aug 10, 2024
2 parents 12c65e2 + 711d9f1 commit 676fcba
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 13,733 deletions.
12 changes: 12 additions & 0 deletions pkgs/by-name/tu/turbo-unwrapped/enable-lazy_cell.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/crates/turborepo-lib/src/lib.rs b/crates/turborepo-lib/src/lib.rs
index e8d41933da..26b8c7c92f 100644
--- a/crates/turborepo-lib/src/lib.rs
+++ b/crates/turborepo-lib/src/lib.rs
@@ -2,6 +2,7 @@
#![feature(box_patterns)]
#![feature(error_generic_member_access)]
#![feature(hash_extract_if)]
+#![feature(lazy_cell)]
#![feature(option_get_or_insert_default)]
#![feature(once_cell_try)]
#![feature(panic_info_message)]
96 changes: 96 additions & 0 deletions pkgs/by-name/tu/turbo-unwrapped/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
stdenv,
lib,
fetchFromGitHub,
rustPlatform,
capnproto,
darwin,
extra-cmake-modules,
fontconfig,
llvmPackages,
nix-update-script,
openssl,
pkg-config,
protobuf,
rust-jemalloc-sys,
zlib,
}:

rustPlatform.buildRustPackage rec {
pname = "turbo-unwrapped";
version = "2.0.12";

src = fetchFromGitHub {
owner = "vercel";
repo = "turbo";
rev = "v${version}";
hash = "sha256-rh9BX8M3Kgu07Pz4G3AM6S9zeK3Bb6CzOpcYo7rQgIw=";
};

patches = [
# upstream uses nightly where lazy_cell is stable
./enable-lazy_cell.patch
];

cargoHash = "sha256-oZHSoPrPCUwXSrxEASm4LuYO+XHyNDRRl38Q7U7F/lk=";

nativeBuildInputs =
[
capnproto
extra-cmake-modules
pkg-config
protobuf
]
# https://github.com/vercel/turbo/blob/ea740706e0592b3906ab34c7cfa1768daafc2a84/CONTRIBUTING.md#linux-dependencies
++ lib.optional stdenv.isLinux llvmPackages.bintools;

buildInputs =
[
fontconfig
openssl
rust-jemalloc-sys
zlib
]
++ lib.optionals stdenv.isDarwin (
with darwin.apple_sdk_11_0.frameworks;
[
CoreFoundation
CoreServices
IOKit
]
);

cargoBuildFlags = [
"--package"
"turbo"
];

# Browser tests time out with chromium and google-chrome
doCheck = false;

env = {
# nightly features are used
RUSTC_BOOTSTRAP = 1;
};

passthru = {
updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"'v(\d+\.\d+\.\d+)'"
];
};
};

meta = {
description = "High-performance build system for JavaScript and TypeScript codebases";
homepage = "https://turbo.build/";
changelog = "https://github.com/vercel/turbo/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
dlip
getchoo
];
mainProgram = "turbo";
};
}
42 changes: 42 additions & 0 deletions pkgs/by-name/tu/turbo/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
lib,
symlinkJoin,
makeBinaryWrapper,
testers,
turbo,
turbo-unwrapped,
# https://turbo.build/repo/docs/telemetry
disableTelemetry ? true,
disableUpdateNotifier ? true,
}:

symlinkJoin rec {
pname = "turbo";
inherit (turbo-unwrapped) version;
name = "${pname}-${version}";

nativeBuildInputs = [ makeBinaryWrapper ];

paths = [ turbo-unwrapped ];

postBuild = ''
wrapProgram $out/bin/turbo \
${lib.optionalString disableTelemetry "--set TURBO_TELEMETRY_DISABLED 1"} \
${lib.optionalString disableUpdateNotifier "--set TURBO_NO_UPDATE_NOTIFIER 1"}
'';

passthru = {
tests.version = testers.testVersion { package = turbo; };
};

meta = {
inherit (turbo-unwrapped.meta)
description
homepage
changelog
license
mainProgram
maintainers
;
};
}
Loading

0 comments on commit 676fcba

Please sign in to comment.