2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, stdenv
|
|
|
|
, darwin
|
2023-07-15 17:15:38 +00:00
|
|
|
, nix-update-script
|
2023-05-24 13:37:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rome";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "12.1.3";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rome";
|
|
|
|
repo = "tools";
|
|
|
|
rev = "cli/v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-BlHpdfbyx6nU44vasEw0gRZ0ickyD2eUXPfeFZHSCbI=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
cargoHash = "sha256-jHdoRymKPjBonT4TvAiTNzGBuTcNoPsvdFKEf33dpVc=";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
cargoBuildFlags = [ "--package" "rome_cli" ];
|
|
|
|
|
|
|
|
env = {
|
|
|
|
RUSTFLAGS = "-C strip=symbols";
|
2023-07-15 17:15:38 +00:00
|
|
|
ROME_VERSION = version;
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
|
|
|
# need to manually unset the ROME_VERSION before checkPhase otherwise some tests fail
|
|
|
|
preCheck = ''
|
|
|
|
unset ROME_VERSION;
|
|
|
|
'';
|
|
|
|
|
|
|
|
# these test fail
|
|
|
|
checkFlags = [
|
|
|
|
"--skip parser::tests::uncompleted_markers_panic"
|
|
|
|
"--skip commands::check::fs_error_infinite_symlink_exapansion"
|
|
|
|
"--skip commands::check::fs_error_dereferenced_symlink"
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.updateScript = nix-update-script {
|
|
|
|
extraArgs = [ "--version-regex" "cli%2Fv(.*)" ];
|
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A formatter, linter, bundler, and more for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS";
|
|
|
|
homepage = "https://rome.tools";
|
|
|
|
changelog = "https://github.com/rome/tools/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dit7ya felschr ];
|
|
|
|
};
|
|
|
|
}
|