···1{ stdenv
2, lib
3, fetchFromGitHub
04, rustPlatform
5, openssl
6, zlib
···10, xorg
11, libiconv
12, AppKit
013, Security
0014, nghttp2
15, libgit2
16-, cargo-edit
17, withExtraFeatures ? true
18, testers
19, nushell
···2122rustPlatform.buildRustPackage rec {
23 pname = "nushell";
24- version = "0.65.0";
2526 src = fetchFromGitHub {
27 owner = pname;
28 repo = pname;
29 rev = version;
30- sha256 = "sha256-KgXhmAOJaAvmNuDqSaW+h6GF5rWYgj8/wn+vz9V9S7M=";
31 };
3233- cargoSha256 = "sha256-YqtM/1p6oP0+E0rYSFPeCbof06E81eC2PZIwkU7J0I4=";
34- # Since 0.34, nu has an indirect dependency on `zstd-sys` (via `polars` and
35- # `parquet`, for dataframe support), which by default has an impure build
36- # (git submodule for the `zstd` C library). The `pkg-config` feature flag
37- # fixes this, but it's hard to invoke this in the right place, because of
38- # the indirect dependencies. So add a direct dependency on `zstd-sys` here
39- # at the top level, along with this feature flag, to ensure that when
40- # `zstd-sys` is transitively invoked, it triggers a pure build using the
41- # system `zstd` library provided above.
42- depsExtraArgs = { nativeBuildInputs = [ cargo-edit ]; };
43- # cargo add has been merged in to cargo so the above can be removed once 1.62.0 is available in nixpkgs
44- # https://github.com/rust-lang/cargo/pull/10472
45- cargoUpdateHook = ''
46- cargo add zstd-sys --features pkg-config --offline
47- # write the change to the lockfile
48- cargo update --package zstd-sys --offline
49- '';
5051 nativeBuildInputs = [ pkg-config ]
52- ++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ python3 ];
05354 buildInputs = [ openssl zstd ]
55 ++ lib.optionals stdenv.isDarwin [ zlib libiconv Security ]
56- ++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ xorg.libX11 ]
0000000000000057 ++ lib.optionals (withExtraFeatures && stdenv.isDarwin) [ AppKit nghttp2 libgit2 ];
5859 buildFeatures = lib.optional withExtraFeatures "extra";
···1{ stdenv
2, lib
3, fetchFromGitHub
4+, runCommand
5, rustPlatform
6, openssl
7, zlib
···11, xorg
12, libiconv
13, AppKit
14+, Foundation
15, Security
16+# darwin.apple_sdk.sdk
17+, sdk
18, nghttp2
19, libgit2
020, withExtraFeatures ? true
21, testers
22, nushell
···2425rustPlatform.buildRustPackage rec {
26 pname = "nushell";
27+ version = "0.67.0";
2829 src = fetchFromGitHub {
30 owner = pname;
31 repo = pname;
32 rev = version;
33+ sha256 = "sha256-O5uM27DvcpwlZStFFLYRDRtFXzAzUdG7v0phK9LJsSo=";
34 };
3536+ cargoSha256 = "sha256-eGUI+/Vmqv+BCIQCGoF4Egf3oNyonM3tpt1R3EjIocQ=";
37+38+ # enable pkg-config feature of zstd
39+ cargoPatches = [ ./zstd-pkg-config.patch ];
00000000000004041 nativeBuildInputs = [ pkg-config ]
42+ ++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ python3 ]
43+ ++ lib.optionals stdenv.isDarwin [ rustPlatform.bindgenHook ];
4445 buildInputs = [ openssl zstd ]
46 ++ lib.optionals stdenv.isDarwin [ zlib libiconv Security ]
47+ ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
48+ Foundation
49+ (
50+ # Pull a header that contains a definition of proc_pid_rusage().
51+ # (We pick just that one because using the other headers from `sdk` is not
52+ # compatible with our C++ standard library. This header is already in
53+ # the standard library on aarch64)
54+ # See also:
55+ # https://github.com/shanesveller/nixpkgs/tree/90ed23b1b23c8ee67928937bdec7ddcd1a0050f5/pkgs/development/libraries/webkitgtk/default.nix
56+ # https://github.com/shanesveller/nixpkgs/blob/90ed23b1b23c8ee67928937bdec7ddcd1a0050f5/pkgs/tools/system/btop/default.nix#L32-L38
57+ runCommand "${pname}_headers" { } ''
58+ install -Dm444 "${lib.getDev sdk}"/include/libproc.h "$out"/include/libproc.h
59+ ''
60+ )
61+ ] ++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ xorg.libX11 ]
62 ++ lib.optionals (withExtraFeatures && stdenv.isDarwin) [ AppKit nghttp2 libgit2 ];
6364 buildFeatures = lib.optional withExtraFeatures "extra";