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
|
2024-05-11 16:04:14 +02:00
|
|
|
, nix-update-script
|
2022-09-11 10:40:23 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "lightningcss";
|
2024-09-11 12:01:01 +02:00
|
|
|
version = "1.27.0";
|
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-09-11 12:01:01 +02:00
|
|
|
hash = "sha256-YOTFyIDQIdqnrbXtnnY5U32rk9/fZ+1NcSb3slgkxZU=";
|
2022-09-11 10:40:23 +02:00
|
|
|
};
|
|
|
|
|
2024-09-11 12:01:01 +02:00
|
|
|
cargoHash = "sha256-nzRvsdW+PfcS1ocg49JtRQ9RmFJ3iz65plH1ToQXSGU=";
|
2024-04-05 23:04:40 +02: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 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
|
|
|
|
2024-05-11 16:04:14 +02:00
|
|
|
passthru.updateScript = nix-update-script {};
|
|
|
|
|
2024-05-25 08:59:41 +02:00
|
|
|
meta = {
|
2022-09-11 10:40:23 +02:00
|
|
|
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}";
|
2024-05-25 08:59:41 +02:00
|
|
|
license = lib.licenses.mpl20;
|
|
|
|
maintainers = with lib.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
|
|
|
};
|
|
|
|
}
|