depot/third_party/nixpkgs/pkgs/development/tools/biome/default.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

63 lines
1.2 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, libgit2_1_6
, zlib
, stdenv
, darwin
, git
}:
rustPlatform.buildRustPackage rec {
pname = "biome";
version = "1.2.2";
src = fetchFromGitHub {
owner = "biomejs";
repo = "biome";
rev = "cli/v${version}";
hash = "sha256-WiyORFXS1kpOaMCbnPdr5ewa6D4ozFTIRSArVlA2FvY=";
};
cargoHash = "sha256-s2CVEGYRzJgsg4soETStpaJ7GDNdJCBJ+Qbn88sFlDQ=";
nativeBuildInputs = [
pkg-config
];
buildInputs = [
libgit2_1_6
zlib
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
nativeCheckInputs = [
git
];
cargoBuildFlags = [ "-p=biome_cli" ];
cargoTestFlags = cargoBuildFlags;
env = {
BIOME_VERSION = version;
};
preCheck = ''
# tests assume git repository
git init
# tests assume $BIOME_VERSION is unset
unset BIOME_VERSION
'';
meta = with lib; {
description = "Toolchain of the web";
homepage = "https://biomejs.dev/";
changelog = "https://github.com/biomejs/biome/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ figsoda ];
mainProgram = "biome";
};
}