Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / web / boa / default.nix
blob003e9829029856590608e32aff65e1ec07a33447
1 { lib
2 , rustPlatform
3 , fetchFromGitHub
4 , fetchpatch
5 , pkg-config
6 , bzip2
7 , openssl
8 , zstd
9 , stdenv
10 , darwin
13 rustPlatform.buildRustPackage rec {
14   pname = "boa";
15   version = "0.17.3";
17   src = fetchFromGitHub {
18     owner = "boa-dev";
19     repo = "boa";
20     rev = "v${version}";
21     hash = "sha256-ROzdOanfHNPwHXA0SzU2fpuBonbDbgDqH+ZgOjwK/tg=";
22     fetchSubmodules = true;
23   };
25   patches = [
26     (fetchpatch {
27       name = "fix-rust-1.71-lints.patch";
28       url = "https://github.com/boa-dev/boa/commit/93d05bda6864aa6ee67682d84bd4fc2108093ef5.patch";
29       hash = "sha256-hMp4/UBN5moGBSqf8BJV2nBwgV3cry9uC2fJmdT5hkQ=";
30     })
31   ];
33   cargoHash = "sha256-UIUXayJwTrWbLm1UKnIXy1Df8a7ZoBzdNm/uZ1+H+SQ=";
35   cargoBuildFlags = [ "--package" "boa_cli" ];
37   nativeBuildInputs = [ pkg-config ];
39   buildInputs =
40     [ bzip2 openssl zstd ]
41     ++ lib.optionals stdenv.isDarwin [
42       darwin.apple_sdk.frameworks.CoreFoundation
43       darwin.apple_sdk.frameworks.Security
44     ];
46   env = { ZSTD_SYS_USE_PKG_CONFIG = true; };
48   meta = with lib; {
49     description = "An embeddable and experimental Javascript engine written in Rust";
50     homepage = "https://github.com/boa-dev/boa";
51     changelog = "https://github.com/boa-dev/boa/blob/${src.rev}/CHANGELOG.md";
52     license = with licenses; [ mit /* or */ unlicense ];
53     maintainers = with maintainers; [ dit7ya ];
54   };