mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-06 05:43:17 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
43 lines
1.1 KiB
Nix
43 lines
1.1 KiB
Nix
{ lib, stdenv
|
|
, fetchFromGitHub
|
|
, rustPlatform
|
|
, pkgconfig
|
|
, libressl
|
|
, curl
|
|
, Security
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "wasm-pack";
|
|
version = "0.9.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "rustwasm";
|
|
repo = "wasm-pack";
|
|
rev = "v${version}";
|
|
sha256 = "1rqyfg6ajxxyfx87ar25nf5ck9hd0p12qgv98dicniqag8l4rvsr";
|
|
};
|
|
|
|
cargoSha256 = "0fw04hgxxqsbp1pylp32yd087r9bb8bpa05v90qdshkgp6znfl9s";
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [
|
|
# LibreSSL works around segfault issues caused by OpenSSL being unable to
|
|
# gracefully exit while doing work.
|
|
# See: https://github.com/rustwasm/wasm-pack/issues/650
|
|
libressl
|
|
] ++ stdenv.lib.optionals stdenv.isDarwin [ curl Security ];
|
|
|
|
# Most tests rely on external resources and build artifacts.
|
|
# Disabling check here to work with build sandboxing.
|
|
doCheck = false;
|
|
|
|
meta = with lib; {
|
|
description = "A utility that builds rust-generated WebAssembly package";
|
|
homepage = "https://github.com/rustwasm/wasm-pack";
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
maintainers = [ maintainers.dhkl ];
|
|
};
|
|
}
|