1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 12:11:28 +00:00

Merge pull request #183712 from shanesveller/package-nushell-0.66.2

nushell: 0.65.0 -> 0.67.0
This commit is contained in:
Mario Rodas 2022-09-08 05:36:47 -05:00 committed by GitHub
commit 4b9e3d1276
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 23 deletions

View file

@ -1,6 +1,7 @@
{ stdenv
, lib
, fetchFromGitHub
, runCommand
, rustPlatform
, openssl
, zlib
@ -10,10 +11,12 @@
, xorg
, libiconv
, AppKit
, Foundation
, Security
# darwin.apple_sdk.sdk
, sdk
, nghttp2
, libgit2
, cargo-edit
, withExtraFeatures ? true
, testers
, nushell
@ -21,39 +24,41 @@
rustPlatform.buildRustPackage rec {
pname = "nushell";
version = "0.65.0";
version = "0.67.0";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
sha256 = "sha256-KgXhmAOJaAvmNuDqSaW+h6GF5rWYgj8/wn+vz9V9S7M=";
sha256 = "sha256-O5uM27DvcpwlZStFFLYRDRtFXzAzUdG7v0phK9LJsSo=";
};
cargoSha256 = "sha256-YqtM/1p6oP0+E0rYSFPeCbof06E81eC2PZIwkU7J0I4=";
# Since 0.34, nu has an indirect dependency on `zstd-sys` (via `polars` and
# `parquet`, for dataframe support), which by default has an impure build
# (git submodule for the `zstd` C library). The `pkg-config` feature flag
# fixes this, but it's hard to invoke this in the right place, because of
# the indirect dependencies. So add a direct dependency on `zstd-sys` here
# at the top level, along with this feature flag, to ensure that when
# `zstd-sys` is transitively invoked, it triggers a pure build using the
# system `zstd` library provided above.
depsExtraArgs = { nativeBuildInputs = [ cargo-edit ]; };
# cargo add has been merged in to cargo so the above can be removed once 1.62.0 is available in nixpkgs
# https://github.com/rust-lang/cargo/pull/10472
cargoUpdateHook = ''
cargo add zstd-sys --features pkg-config --offline
# write the change to the lockfile
cargo update --package zstd-sys --offline
'';
cargoSha256 = "sha256-eGUI+/Vmqv+BCIQCGoF4Egf3oNyonM3tpt1R3EjIocQ=";
# enable pkg-config feature of zstd
cargoPatches = [ ./zstd-pkg-config.patch ];
nativeBuildInputs = [ pkg-config ]
++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ python3 ];
++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ python3 ]
++ lib.optionals stdenv.isDarwin [ rustPlatform.bindgenHook ];
buildInputs = [ openssl zstd ]
++ lib.optionals stdenv.isDarwin [ zlib libiconv Security ]
++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ xorg.libX11 ]
++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
Foundation
(
# Pull a header that contains a definition of proc_pid_rusage().
# (We pick just that one because using the other headers from `sdk` is not
# compatible with our C++ standard library. This header is already in
# the standard library on aarch64)
# See also:
# https://github.com/shanesveller/nixpkgs/tree/90ed23b1b23c8ee67928937bdec7ddcd1a0050f5/pkgs/development/libraries/webkitgtk/default.nix
# https://github.com/shanesveller/nixpkgs/blob/90ed23b1b23c8ee67928937bdec7ddcd1a0050f5/pkgs/tools/system/btop/default.nix#L32-L38
runCommand "${pname}_headers" { } ''
install -Dm444 "${lib.getDev sdk}"/include/libproc.h "$out"/include/libproc.h
''
)
] ++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ xorg.libX11 ]
++ lib.optionals (withExtraFeatures && stdenv.isDarwin) [ AppKit nghttp2 libgit2 ];
buildFeatures = lib.optional withExtraFeatures "extra";

View file

@ -0,0 +1,31 @@
diff --git a/Cargo.lock b/Cargo.lock
index d4c2ebe3a..bc78478c3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2641,6 +2641,7 @@ dependencies = [
"wax",
"which",
"windows",
+ "zstd",
]
[[package]]
@@ -5604,4 +5605,5 @@ checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b"
dependencies = [
"cc",
"libc",
+ "pkg-config",
]
diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml
index 8a9d29562..374ffa153 100644
--- a/crates/nu-command/Cargo.toml
+++ b/crates/nu-command/Cargo.toml
@@ -89,6 +89,8 @@ wax = { version = "0.5.0", features = ["diagnostics"] }
rusqlite = { version = "0.28.0", features = ["bundled"], optional = true }
sqlparser = { version = "0.16.0", features = ["serde"], optional = true }
+zstd = { version = "*", features = [ "pkg-config" ] }
+
[target.'cfg(unix)'.dependencies]
umask = "2.0.0"
users = "0.11.0"

View file

@ -24487,7 +24487,8 @@ with pkgs;
nsh = callPackage ../shells/nsh { };
nushell = callPackage ../shells/nushell {
inherit (darwin.apple_sdk.frameworks) AppKit Security;
inherit (darwin.apple_sdk.frameworks) AppKit Foundation Security;
inherit (darwin.apple_sdk) sdk;
};
nettools = if stdenv.isLinux