unix-tools: add version

Uses the POSIX standard 1003.1-2008 as version number. It can be
accessed for free at http://pubs.opengroup.org/onlinepubs/9699919799/.
This commit is contained in:
Matthew Bauer 2018-05-23 23:38:35 -05:00
parent 02297beade
commit 02de1dc707

View File

@ -11,9 +11,11 @@
# input, not "procps" which requires Linux. # input, not "procps" which requires Linux.
let let
version = "1003.1-2008";
singleBinary = cmd: providers: let singleBinary = cmd: providers: let
provider = "${lib.getBin providers.${hostPlatform.parsed.kernel.name}}/bin/${cmd}"; provider = "${lib.getBin providers.${hostPlatform.parsed.kernel.name}}/bin/${cmd}";
in runCommand cmd { in runCommand "${cmd}-${version}" {
meta.platforms = map (n: { kernel.name = n; }) (pkgs.lib.attrNames providers); meta.platforms = map (n: { kernel.name = n; }) (pkgs.lib.attrNames providers);
} '' } ''
mkdir -p $out/bin mkdir -p $out/bin
@ -28,7 +30,7 @@ let
# more is unavailable in darwin # more is unavailable in darwin
# just use less # just use less
more_compat = runCommand "more" {} '' more_compat = runCommand "more-${version}" {} ''
mkdir -p $out/bin mkdir -p $out/bin
ln -s ${pkgs.less}/bin/less $out/bin/more ln -s ${pkgs.less}/bin/less $out/bin/more
''; '';
@ -131,7 +133,7 @@ let
}; };
makeCompat = name': value: buildEnv { makeCompat = name': value: buildEnv {
name = name' + "-compat"; name = name' + "-compat-${version}";
paths = value; paths = value;
}; };