nixpkgs/pkgs/tools/misc/turbo/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

101 lines
1.9 KiB
Nix
Raw Normal View History

2023-02-16 03:27:44 +00:00
{ lib
, fetchFromGitHub
, buildGoModule
, git
, nodejs
, protobuf
, protoc-gen-go
, protoc-gen-go-grpc
, rustPlatform
, pkg-config
, openssl
, extra-cmake-modules
, fontconfig
, go
2023-03-11 11:07:29 +00:00
, testers
, turbo
2023-02-16 03:27:44 +00:00
}:
let
2023-03-11 10:02:25 +00:00
version = "1.8.3";
2023-02-16 03:27:44 +00:00
src = fetchFromGitHub {
owner = "vercel";
repo = "turbo";
rev = "v${version}";
2023-03-11 10:02:25 +00:00
sha256 = "sha256-aqe9ze6xZ5RUJJGT19nABhorrL9+ctSTS+ov97hG30o=";
2023-02-16 03:27:44 +00:00
};
go-turbo = buildGoModule rec {
inherit src version;
pname = "go-turbo";
modRoot = "cli";
2023-03-11 10:02:25 +00:00
vendorSha256 = "sha256-lqumN+xqJXEPI+nVnWSNfAyvQQ6fS9ao8uhwA1EbWWM=";
2023-02-16 03:27:44 +00:00
nativeBuildInputs = [
git
nodejs
protobuf
protoc-gen-go
protoc-gen-go-grpc
];
preBuild = ''
make compile-protos
'';
preCheck = ''
# Some tests try to run mkdir $HOME
HOME=$TMP
# Test_getTraversePath requires that source is a git repo
# pwd: /build/source/cli
pushd ..
git config --global init.defaultBranch main
git init
popd
'';
};
in
rustPlatform.buildRustPackage rec {
pname = "turbo";
inherit src version;
cargoBuildFlags = [
"--package"
"turbo"
];
RELEASE_TURBO_CLI = "true";
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"update-informer-0.6.0" = "sha256-uMp6PE4ccNGflbYz5WbLBKDtTlXNjOPA3vAnIMSdMEs=";
};
};
2023-02-16 03:27:44 +00:00
RUSTC_BOOTSTRAP = 1;
nativeBuildInputs = [
pkg-config
extra-cmake-modules
];
buildInputs = [
openssl
fontconfig
];
postInstall = ''
ln -s ${go-turbo}/bin/turbo $out/bin/go-turbo
'';
# Browser tests time out with chromium and google-chrome
doCheck = false;
2023-03-11 11:07:29 +00:00
passthru.tests.version = testers.testVersion { package = turbo; };
2023-02-16 03:27:44 +00:00
meta = with lib; {
description = "High-performance build system for JavaScript and TypeScript codebases";
homepage = "https://turbo.build/";
maintainers = with maintainers; [ dlip ];
license = licenses.mpl20;
};
}