xxd: move to unixtools

also add manpage to unixtools if provided to give compat with old xxd.
This commit is contained in:
Matthew Bauer 2018-07-04 15:24:58 -04:00
parent e776d326f6
commit 2f523dd9a4
2 changed files with 10 additions and 3 deletions

View file

@ -18590,8 +18590,6 @@ with pkgs;
flags = [ "python" "X11" ]; # only flag "X11" by now
});
xxd = callPackage ../tools/misc/xxd { };
vimNox = lowPrio (vim_configurable.override {
source = "vim-nox";
lua = pkgs.lua5_1; # vimNox source is from 2012, requires older lua
@ -21816,7 +21814,7 @@ with pkgs;
unixtools = recurseIntoAttrs (callPackages ./unix-tools.nix { });
inherit (unixtools) hexdump ps logger eject umount
mount wall hostname more sysctl getconf
getent locale killall;
getent locale killall xxd;
fts = if hostPlatform.isMusl then netbsd.fts else null;

View file

@ -16,6 +16,7 @@ let
singleBinary = cmd: providers: let
provider = "${lib.getBin providers.${hostPlatform.parsed.kernel.name}}/bin/${cmd}";
manpage = "${lib.getOutput "man" providers.${hostPlatform.parsed.kernel.name}}/share/man/man1/${cmd}.1.gz";
in runCommand "${cmd}-${version}" {
meta.platforms = map (n: { kernel.name = n; }) (pkgs.lib.attrNames providers);
} ''
@ -25,6 +26,10 @@ let
fi
install -D "${provider}" "$out/bin/${cmd}"
if [ -f "${manpage}" ]; then
install -D "${manpage}" $out/share/man/man1/${cmd}.1.gz
fi
'';
# more is unavailable in darwin
@ -147,6 +152,10 @@ let
linux = pkgs.utillinux;
darwin = pkgs.darwin.basic_cmds;
};
xxd = {
linux = pkgs.vim;
darwin = pkgs.vim;
};
};
makeCompat = name': value: buildEnv {