···11{ stdenv
22, lib
33, fetchFromGitHub
44+, runCommand
45, rustPlatform
56, openssl
67, zlib
···1011, xorg
1112, libiconv
1213, AppKit
1414+, Foundation
1315, Security
1616+# darwin.apple_sdk.sdk
1717+, sdk
1418, nghttp2
1519, libgit2
1616-, cargo-edit
1720, withExtraFeatures ? true
1821, testers
1922, nushell
···21242225rustPlatform.buildRustPackage rec {
2326 pname = "nushell";
2424- version = "0.65.0";
2727+ version = "0.67.0";
25282629 src = fetchFromGitHub {
2730 owner = pname;
2831 repo = pname;
2932 rev = version;
3030- sha256 = "sha256-KgXhmAOJaAvmNuDqSaW+h6GF5rWYgj8/wn+vz9V9S7M=";
3333+ sha256 = "sha256-O5uM27DvcpwlZStFFLYRDRtFXzAzUdG7v0phK9LJsSo=";
3134 };
32353333- cargoSha256 = "sha256-YqtM/1p6oP0+E0rYSFPeCbof06E81eC2PZIwkU7J0I4=";
3434- # Since 0.34, nu has an indirect dependency on `zstd-sys` (via `polars` and
3535- # `parquet`, for dataframe support), which by default has an impure build
3636- # (git submodule for the `zstd` C library). The `pkg-config` feature flag
3737- # fixes this, but it's hard to invoke this in the right place, because of
3838- # the indirect dependencies. So add a direct dependency on `zstd-sys` here
3939- # at the top level, along with this feature flag, to ensure that when
4040- # `zstd-sys` is transitively invoked, it triggers a pure build using the
4141- # system `zstd` library provided above.
4242- depsExtraArgs = { nativeBuildInputs = [ cargo-edit ]; };
4343- # cargo add has been merged in to cargo so the above can be removed once 1.62.0 is available in nixpkgs
4444- # https://github.com/rust-lang/cargo/pull/10472
4545- cargoUpdateHook = ''
4646- cargo add zstd-sys --features pkg-config --offline
4747- # write the change to the lockfile
4848- cargo update --package zstd-sys --offline
4949- '';
3636+ cargoSha256 = "sha256-eGUI+/Vmqv+BCIQCGoF4Egf3oNyonM3tpt1R3EjIocQ=";
3737+3838+ # enable pkg-config feature of zstd
3939+ cargoPatches = [ ./zstd-pkg-config.patch ];
50405141 nativeBuildInputs = [ pkg-config ]
5252- ++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ python3 ];
4242+ ++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ python3 ]
4343+ ++ lib.optionals stdenv.isDarwin [ rustPlatform.bindgenHook ];
53445445 buildInputs = [ openssl zstd ]
5546 ++ lib.optionals stdenv.isDarwin [ zlib libiconv Security ]
5656- ++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ xorg.libX11 ]
4747+ ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
4848+ Foundation
4949+ (
5050+ # Pull a header that contains a definition of proc_pid_rusage().
5151+ # (We pick just that one because using the other headers from `sdk` is not
5252+ # compatible with our C++ standard library. This header is already in
5353+ # the standard library on aarch64)
5454+ # See also:
5555+ # https://github.com/shanesveller/nixpkgs/tree/90ed23b1b23c8ee67928937bdec7ddcd1a0050f5/pkgs/development/libraries/webkitgtk/default.nix
5656+ # https://github.com/shanesveller/nixpkgs/blob/90ed23b1b23c8ee67928937bdec7ddcd1a0050f5/pkgs/tools/system/btop/default.nix#L32-L38
5757+ runCommand "${pname}_headers" { } ''
5858+ install -Dm444 "${lib.getDev sdk}"/include/libproc.h "$out"/include/libproc.h
5959+ ''
6060+ )
6161+ ] ++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ xorg.libX11 ]
5762 ++ lib.optionals (withExtraFeatures && stdenv.isDarwin) [ AppKit nghttp2 libgit2 ];
58635964 buildFeatures = lib.optional withExtraFeatures "extra";