2022-09-11 08:40:23 +00:00
|
|
|
{
|
|
|
|
lib,
|
2022-12-04 13:50:37 +00:00
|
|
|
stdenv,
|
2022-09-11 08:40:23 +00:00
|
|
|
rustPlatform,
|
|
|
|
fetchFromGitHub,
|
2024-05-11 14:04:14 +00:00
|
|
|
nix-update-script,
|
2022-09-11 08:40:23 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "lightningcss";
|
2024-11-25 09:05:38 +00:00
|
|
|
version = "1.28.2";
|
2022-09-11 08:40:23 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "parcel-bundler";
|
|
|
|
repo = "lightningcss";
|
2022-12-04 13:50:37 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-11-25 09:05:38 +00:00
|
|
|
hash = "sha256-IwuDJcKCG1CDyRsZbobPQnRzsaUfpJHKFemOWLJNM9c=";
|
2022-09-11 08:40:23 +00:00
|
|
|
};
|
|
|
|
|
2024-11-25 09:05:38 +00:00
|
|
|
cargoHash = "sha256-um8G6QKxqPEcuCWmlFOqZVQLU8GxLwZ3S7z2Na2uzhQ=";
|
2024-04-05 21:04:40 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Backport fix for build error for lightningcss-napi
|
|
|
|
# see https://github.com/parcel-bundler/lightningcss/pull/713
|
|
|
|
# FIXME: remove when merged upstream
|
|
|
|
./0001-napi-fix-build-error-in-cargo-auditable.patch
|
|
|
|
];
|
2022-09-11 08:40:23 +00:00
|
|
|
|
2022-12-04 13:50:37 +00:00
|
|
|
buildFeatures = [
|
|
|
|
"cli"
|
|
|
|
];
|
2022-09-11 08:40:23 +00:00
|
|
|
|
2022-12-04 13:50:37 +00:00
|
|
|
cargoBuildFlags = [
|
|
|
|
"--lib"
|
|
|
|
"--bin=lightningcss"
|
|
|
|
];
|
2022-09-11 08:40:23 +00:00
|
|
|
|
2022-12-04 13:50:37 +00:00
|
|
|
cargoTestFlags = [
|
|
|
|
"--lib"
|
|
|
|
];
|
2022-09-11 08:40:23 +00:00
|
|
|
|
2024-05-11 14:04:14 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2024-05-25 06:59:41 +00:00
|
|
|
meta = {
|
2022-09-11 08:40:23 +00:00
|
|
|
description = "Extremely fast CSS parser, transformer, and minifier written in Rust";
|
|
|
|
homepage = "https://lightningcss.dev/";
|
2022-12-04 13:50:37 +00:00
|
|
|
changelog = "https://github.com/parcel-bundler/lightningcss/releases/tag/v${version}";
|
2024-05-25 06:59:41 +00:00
|
|
|
license = lib.licenses.mpl20;
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
johnrtitor
|
|
|
|
toastal
|
|
|
|
];
|
2023-09-18 10:41:45 +00:00
|
|
|
mainProgram = "lightningcss";
|
2024-11-04 17:42:00 +00:00
|
|
|
platforms = lib.platforms.all;
|
2022-09-11 08:40:23 +00:00
|
|
|
};
|
|
|
|
}
|