diff --git a/pkgs/shells/ion/build-script.patch b/pkgs/shells/ion/build-script.patch new file mode 100644 index 00000000000..86928928959 --- /dev/null +++ b/pkgs/shells/ion/build-script.patch @@ -0,0 +1,17 @@ +--- a/build.rs ++++ b/build.rs +@@ -23,13 +23,7 @@ fn write_version_file() -> io::Result<()> { + let target = env::var("TARGET").unwrap(); + let version_fname = Path::new(&env::var("OUT_DIR").unwrap()).join("version_string"); + let mut version_file = File::create(&version_fname)?; +- write!( +- &mut version_file, +- "r#\"ion {} ({})\nrev {}\"#", +- version, +- target, +- get_git_rev()?.trim() +- )?; ++ write!(&mut version_file, "r#\"ion {version} ({target})\n\"#")?; + Ok(()) + } + diff --git a/pkgs/shells/ion/default.nix b/pkgs/shells/ion/default.nix index ce15dbf2d25..d99b4baa427 100644 --- a/pkgs/shells/ion/default.nix +++ b/pkgs/shells/ion/default.nix @@ -1,17 +1,40 @@ -{ lib, stdenv, fetchFromGitHub, rustPlatform, Security, libiconv }: +{ lib +, rustPlatform +, fetchFromGitHub +, stdenv +, darwin +}: rustPlatform.buildRustPackage rec { pname = "ion"; - version = "unstable-2021-05-10"; + version = "unstable-2022-11-27"; src = fetchFromGitHub { owner = "redox-os"; repo = "ion"; - rev = "1170b84587bbad260a3ecac8e249a216cb1fd5e9"; - sha256 = "sha256-lI1GwA3XerRJaC/Z8vTZc6GzRDLjv3w768C+Ui6Q+3Q="; + rev = "3bb8966fc99ba223033e1e02b0a6d50fc25cbef4"; + sha256 = "sha256-6KW/YkMQFeGb1i+1YdADZRW89UruHsfPhMq9Cvxjl/4="; }; - cargoSha256 = "sha256-hURpgxc99iIMtzIlR6Kbfqcbu1uYLDHnfVLqgmMbvFA="; + cargoSha256 = "sha256-KLKPnj4SmAuspjMPAGLJ8Yy9SxAi6FvGE/FIF58lAH8="; + + patches = [ + # remove git revision from the build script to fix build + ./build-script.patch + ]; + + buildInputs = lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Security + ]; + + checkFlags = lib.optionals stdenv.isDarwin [ + # test assumes linux + "--skip=binary::completer::tests::filename_completion" + ]; + + passthru = { + shellPath = "/bin/ion"; + }; meta = with lib; { description = "Modern system shell with simple (and powerful) syntax"; @@ -19,15 +42,4 @@ rustPlatform.buildRustPackage rec { license = licenses.mit; maintainers = with maintainers; [ dywedir ]; }; - - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ - Security - libiconv - ]; - - doCheck = !stdenv.hostPlatform.isDarwin; - - passthru = { - shellPath = "/bin/ion"; - }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b00b9c49481..311aa10ba68 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13709,9 +13709,7 @@ with pkgs; fzf-git-sh = callPackage ../shells/fzf-git-sh {}; - ion = callPackage ../shells/ion { - inherit (darwin) Security; - }; + ion = callPackage ../shells/ion { }; jush = callPackage ../shells/jush { };