From c892f72f1ae36ac261b382f5bbce2a4fd3118613 Mon Sep 17 00:00:00 2001 From: figsoda Date: Wed, 18 Jan 2023 19:48:15 -0500 Subject: ion: unstable-2021-05-10 -> unstable-2022-11-27 Diff: https://github.com/redox-os/ion/compare/1170b84587bbad260a3ecac8e249a216cb1fd5e9...3bb8966fc99ba223033e1e02b0a6d50fc25cbef4 --- pkgs/shells/ion/build-script.patch | 17 +++++++++++++++ pkgs/shells/ion/default.nix | 42 ++++++++++++++++++++++++-------------- pkgs/top-level/all-packages.nix | 4 +--- 3 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 pkgs/shells/ion/build-script.patch 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,33 +1,45 @@ -{ 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="; - meta = with lib; { - description = "Modern system shell with simple (and powerful) syntax"; - homepage = "https://gitlab.redox-os.org/redox-os/ion"; - license = licenses.mit; - maintainers = with maintainers; [ dywedir ]; - }; + patches = [ + # remove git revision from the build script to fix build + ./build-script.patch + ]; - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ - Security - libiconv + buildInputs = lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Security ]; - doCheck = !stdenv.hostPlatform.isDarwin; + 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"; + homepage = "https://gitlab.redox-os.org/redox-os/ion"; + license = licenses.mit; + maintainers = with maintainers; [ dywedir ]; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 354fa60ea1e..90ba78c37a7 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 { }; -- cgit 1.4.1