2021-03-14 01:11:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, cargo
|
|
|
|
, sphinx
|
2019-12-29 22:45:09 +00:00
|
|
|
, Security
|
2021-03-14 01:11:29 +00:00
|
|
|
, prefix ? "uutils-"
|
|
|
|
, buildMulticallBinary ? true
|
2019-12-29 22:45:09 +00:00
|
|
|
}:
|
2021-03-09 15:42:22 +00:00
|
|
|
|
2021-03-14 01:11:29 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-02-03 03:41:46 +00:00
|
|
|
pname = "uutils-coreutils";
|
2021-04-05 03:12:25 +01:00
|
|
|
version = "0.0.6";
|
2018-02-11 11:37:48 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "uutils";
|
|
|
|
repo = "coreutils";
|
2021-02-03 03:41:46 +00:00
|
|
|
rev = version;
|
2021-04-05 03:12:25 +01:00
|
|
|
sha256 = "sha256-dnswE/DU2jCfxWW10Ctjw8woktwWZqyd3E9IuKkle1M=";
|
2018-02-11 11:37:48 +00:00
|
|
|
};
|
|
|
|
|
2021-03-14 01:11:29 +00:00
|
|
|
postPatch = ''
|
|
|
|
# can be removed after https://github.com/uutils/coreutils/pull/1815 is included
|
|
|
|
substituteInPlace GNUmakefile \
|
|
|
|
--replace uutils coreutils
|
|
|
|
'';
|
2018-02-11 11:37:48 +00:00
|
|
|
|
2021-03-14 01:11:29 +00:00
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2021-04-05 03:12:25 +01:00
|
|
|
hash = "sha256-92BHPSVIPZLn399AcaJJjRq2WkxzDm8knKN3FIdAxAA=";
|
2021-03-14 01:11:29 +00:00
|
|
|
};
|
2018-02-11 11:37:48 +00:00
|
|
|
|
2021-03-14 01:11:29 +00:00
|
|
|
nativeBuildInputs = [ rustPlatform.cargoSetupHook sphinx ];
|
2018-02-11 11:37:48 +00:00
|
|
|
|
2020-03-29 09:07:29 +01:00
|
|
|
buildInputs = lib.optional stdenv.isDarwin Security;
|
2018-02-11 11:37:48 +00:00
|
|
|
|
2021-03-14 01:11:29 +00:00
|
|
|
makeFlags = [
|
|
|
|
"CARGO=${cargo}/bin/cargo"
|
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
"PROFILE=release"
|
|
|
|
"INSTALLDIR_MAN=${placeholder "out"}/share/man/man1"
|
|
|
|
] ++ lib.optionals (prefix != null) [ "PROG_PREFIX=${prefix}" ]
|
|
|
|
++ lib.optionals buildMulticallBinary [ "MULTICALL=y" ];
|
|
|
|
|
|
|
|
# too many impure/platform-dependent tests
|
|
|
|
doCheck = false;
|
2018-02-11 11:37:48 +00:00
|
|
|
|
2019-12-29 22:45:09 +00:00
|
|
|
meta = with lib; {
|
2018-02-11 11:37:48 +00:00
|
|
|
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.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/uutils/coreutils";
|
2021-03-14 01:11:29 +00:00
|
|
|
maintainers = with maintainers; [ siraben SuperSandro2000 ];
|
2018-02-11 11:37:48 +00:00
|
|
|
license = licenses.mit;
|
2018-10-05 08:50:19 +01:00
|
|
|
platforms = platforms.unix;
|
2018-02-11 11:37:48 +00:00
|
|
|
};
|
|
|
|
}
|