···4, rustPlatform
5, openssl
6, zlib
7+, zstd
8, pkg-config
9, python3
10, xorg
···1819rustPlatform.buildRustPackage rec {
20 pname = "nushell";
21+ version = "0.35.0";
2223 src = fetchFromGitHub {
24 owner = pname;
25 repo = pname;
26 rev = version;
27+ sha256 = "0p5whwx6wk9k7mrxhr7azrppbj9mv53hd4bl1cgygxz231aq8337";
28 };
2930+ cargoSha256 = "0xs0s02zf78pgd94ifh465mg14rrwjfg7qbzmmq8jha758gfwdi3";
3132 nativeBuildInputs = [ pkg-config ]
33 ++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ python3 ];
3435+ buildInputs = [ openssl zstd ]
36 ++ lib.optionals stdenv.isDarwin [ zlib libiconv Security ]
37 ++ lib.optionals (withExtraFeatures && stdenv.isLinux) [ xorg.libX11 ]
38 ++ lib.optionals (withExtraFeatures && stdenv.isDarwin) [ AppKit nghttp2 libgit2 ];
3940 cargoBuildFlags = lib.optional withExtraFeatures "--features=extra";
41+42+ # Since 0.34, nu has an indirect dependency on `zstd-sys` (via `polars` and
43+ # `parquet`, for dataframe support), which by default has an impure build
44+ # (git submodule for the `zstd` C library). The `pkg-config` feature flag
45+ # fixes this, but it's hard to invoke this in the right place, because of
46+ # the indirect dependencies. So add a direct dependency on `zstd-sys` here
47+ # at the top level, along with this feature flag, to ensure that when
48+ # `zstd-sys` is transitively invoked, it triggers a pure build using the
49+ # system `zstd` library provided above.
50+ #
51+ # (If this patch needs updating, in a nushell repo add the zstd-sys line to
52+ # Cargo.toml, then `cargo update --package zstd-sys` to update Cargo.lock.)
53+ cargoPatches = [ ./use-system-zstd-lib.diff ];
5455 # TODO investigate why tests are broken on darwin
56 # failures show that tests try to write to paths