2022-09-11 10:40:23 +02:00
|
|
|
{ lib
|
2022-12-04 14:50:37 +01:00
|
|
|
, stdenv
|
2022-09-11 10:40:23 +02:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "lightningcss";
|
2024-04-05 23:04:40 +02:00
|
|
|
version = "1.24.1";
|
2022-09-11 10:40:23 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "parcel-bundler";
|
|
|
|
repo = "lightningcss";
|
2022-12-04 14:50:37 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-05 23:04:40 +02:00
|
|
|
hash = "sha256-HRuL7zwpN2e51+/Ltvif+eh+WBss/FtHCOlJfa/eVdE=";
|
2022-09-11 10:40:23 +02:00
|
|
|
};
|
|
|
|
|
2024-04-05 23:04:40 +02:00
|
|
|
cargoHash = "sha256-HavdTNaLTGctePa890dy/jGlXZXXZu1QFeFJOpjOiME=";
|
|
|
|
|
|
|
|
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 10:40:23 +02:00
|
|
|
|
2022-12-04 14:50:37 +01:00
|
|
|
buildFeatures = [
|
|
|
|
"cli"
|
|
|
|
];
|
2022-09-11 10:40:23 +02:00
|
|
|
|
2022-12-04 14:50:37 +01:00
|
|
|
cargoBuildFlags = [
|
|
|
|
"--lib"
|
|
|
|
"--bin=lightningcss"
|
|
|
|
];
|
2022-09-11 10:40:23 +02:00
|
|
|
|
2022-12-04 14:50:37 +01:00
|
|
|
cargoTestFlags = [
|
|
|
|
"--lib"
|
|
|
|
];
|
2022-09-11 10:40:23 +02:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Extremely fast CSS parser, transformer, and minifier written in Rust";
|
|
|
|
homepage = "https://lightningcss.dev/";
|
2022-12-04 14:50:37 +01:00
|
|
|
changelog = "https://github.com/parcel-bundler/lightningcss/releases/tag/v${version}";
|
2022-09-11 10:40:23 +02:00
|
|
|
license = licenses.mpl20;
|
2024-04-08 21:20:00 +02:00
|
|
|
maintainers = with maintainers; [ johnrtitor toastal ];
|
2023-09-18 12:41:45 +02:00
|
|
|
mainProgram = "lightningcss";
|
2022-12-06 21:47:40 +01:00
|
|
|
# never built on aarch64-linux since first introduction in nixpkgs
|
|
|
|
broken = stdenv.isLinux && stdenv.isAarch64;
|
2022-09-11 10:40:23 +02:00
|
|
|
};
|
|
|
|
}
|