From 97700fe81162818320585ba459d353622566e00a Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 11 Feb 2018 12:37:48 +0100 Subject: [PATCH] uutils-coreutils: init at 2018-02-09 `uutils-coreutils` is an a cross-platform rewrite of GNU/coreutils based on Rust. It aims to increase portability and improve Windows support (see https://github.com/uutils/coreutils#why). Since the derivation provides the same binaries as `coreutils` does a `prefix` argument as been added to the function to avoid any conflicts that can be used like this: ``` nix self: super: { uutils-coreutils = self.uutils-coreutils.override { prefix = "uutils"; }; } ``` Resolves #28114 /cc @NeQuissimus ----- Important notice: the patch depends on #34505 which needs to be merged *FIRST* as it fixes a bug in the `rustc` setup of nixpkgs (see the PR's discussion and https://github.com/rust-lang/cargo/commit/5c9665f41c6b4d3b99d3b9f8b48a286f5f154692#commitcomment-27271420 for further reference). --- pkgs/tools/misc/uutils-coreutils/default.nix | 39 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 43 insertions(+) create mode 100644 pkgs/tools/misc/uutils-coreutils/default.nix diff --git a/pkgs/tools/misc/uutils-coreutils/default.nix b/pkgs/tools/misc/uutils-coreutils/default.nix new file mode 100644 index 000000000000..7f6e4f760b3b --- /dev/null +++ b/pkgs/tools/misc/uutils-coreutils/default.nix @@ -0,0 +1,39 @@ +{ stdenv, fetchFromGitHub, rustPlatform, cargo, cmake, sphinx, lib, prefix ? "uutils-" }: + +rustPlatform.buildRustPackage { + name = "uutils-coreutils-2018-02-09"; + src = fetchFromGitHub { + owner = "uutils"; + repo = "coreutils"; + rev = "f333ab26b03294a32a10c1c203a03c6b5cf8a89a"; + sha256 = "0nkggs5nqvc1mxzzgcsqm1ahchh4ll11xh0xqmcljrr5yg1rhhzf"; + }; + + # too many impure/platform-dependent tests + doCheck = false; + + cargoSha256 = "0qv2wz1bxhm5xhzbic7cqmn8jj8fyap0s18ylia4fbwpmv89nkc5"; + + makeFlags = + [ "CARGO=${cargo}/bin/cargo" "PREFIX=$(out)" "PROFILE=release" "INSTALLDIR_MAN=$(out)/share/man/man1" ] + ++ lib.optional (prefix != null) [ "PROG_PREFIX=${prefix}" ]; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ cargo sphinx ]; + + # empty {build,install}Phase to use defaults of `stdenv.mkDerivation` rather than rust defaults + buildPhase = ""; + installPhase = ""; + + meta = with stdenv.lib; { + description = "Cross-platform Rust rewrite of the GNU coreutils"; + longDescription = '' + uutils is an attempt at writing universal (as in cross-platform) + CLI utils in Rust. This repo is to aggregate the GNU coreutils rewrites. + ''; + homepage = https://github.com/uutils/coreutils; + maintainers = with maintainers; [ ma27 ]; + license = licenses.mit; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4235616748c7..5fa4e5278247 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2035,6 +2035,10 @@ with pkgs; uudeview = callPackage ../tools/misc/uudeview { }; + uutils-coreutils = callPackage ../tools/misc/uutils-coreutils { + inherit (pythonPackages) sphinx; + }; + zabbix-cli = callPackage ../tools/misc/zabbix-cli { }; ### DEVELOPMENT / EMSCRIPTEN