2023-09-07 09:31:03 -04:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, rustPlatform
|
|
|
|
, nushell
|
|
|
|
, pkg-config
|
|
|
|
, IOKit
|
|
|
|
, Foundation
|
2023-12-15 15:56:01 -05:00
|
|
|
, libclang
|
2023-09-11 18:39:19 -04:00
|
|
|
, nix-update-script
|
2023-09-07 09:31:03 -04:00
|
|
|
}:
|
|
|
|
|
2023-09-11 16:54:21 -04:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2023-09-11 05:58:11 -04:00
|
|
|
pname = "nushell_plugin_formats";
|
2023-09-11 16:54:21 -04:00
|
|
|
inherit (nushell) version src;
|
2024-04-05 08:47:06 -04:00
|
|
|
cargoHash = "sha256-mInMs0kAJn3/fgRAG0E8hgvaly2G68kT5O+D83pLq78=";
|
2023-09-11 18:43:05 -04:00
|
|
|
|
2023-12-16 05:08:52 -05:00
|
|
|
env = lib.optionalAttrs stdenv.cc.isClang {
|
2023-12-15 15:56:01 -05:00
|
|
|
LIBCLANG_PATH = "${libclang.lib}/lib";
|
|
|
|
};
|
2023-09-07 09:31:03 -04:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2023-09-25 16:58:52 -04:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ IOKit Foundation ];
|
2023-09-07 09:31:03 -04:00
|
|
|
cargoBuildFlags = [ "--package nu_plugin_formats" ];
|
2023-09-11 18:43:05 -04:00
|
|
|
|
2023-09-11 16:48:00 -04:00
|
|
|
checkPhase = ''
|
|
|
|
cargo test --manifest-path crates/nu_plugin_formats/Cargo.toml
|
|
|
|
'';
|
2023-09-11 18:43:05 -04:00
|
|
|
|
2023-10-05 15:15:16 -04:00
|
|
|
passthru.updateScript = nix-update-script {
|
|
|
|
# Skip the version check and only check the hash because we inherit version from nushell.
|
|
|
|
extraArgs = [ "--version=skip" ];
|
|
|
|
};
|
2023-09-11 18:43:05 -04:00
|
|
|
|
2023-09-07 09:31:03 -04:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A formats plugin for Nushell";
|
2024-03-18 22:14:51 -04:00
|
|
|
mainProgram = "nu_plugin_formats";
|
2023-09-11 16:52:59 -04:00
|
|
|
homepage = "https://github.com/nushell/nushell/tree/${version}/crates/nu_plugin_formats";
|
2023-09-07 09:31:03 -04:00
|
|
|
license = licenses.mpl20;
|
2023-09-11 18:30:12 -04:00
|
|
|
maintainers = with maintainers; [ viraptor aidalgol ];
|
2023-09-07 09:31:03 -04:00
|
|
|
platforms = with platforms; all;
|
|
|
|
};
|
|
|
|
}
|