mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-20 19:16:11 +00:00
Merge pull request #38880 from matthewbauer/darwin-devdisk
Add Darwin devdisk commands and put them in unixtools
This commit is contained in:
commit
1b11ffbae8
@ -44,6 +44,8 @@ let
|
||||
file_cmds = "264.1.1";
|
||||
shell_cmds = "187";
|
||||
system_cmds = "550.6";
|
||||
diskdev_cmds = "593";
|
||||
top = "108";
|
||||
};
|
||||
"osx-10.11.5" = {
|
||||
Libc = "1082.50.1"; # 10.11.6 still unreleased :/
|
||||
@ -243,10 +245,12 @@ let
|
||||
adv_cmds = applePackage "adv_cmds/xcode.nix" "osx-10.11.6" "12gbv35i09aij9g90p6b3x2f3ramw43qcb2gjrg8lzkzmwvcyw9q" {};
|
||||
basic_cmds = applePackage "basic_cmds" "osx-10.11.6" "0hvab4b1v5q2x134hdkal0rmz5gsdqyki1vb0dbw4py1bqf0yaw9" {};
|
||||
developer_cmds = applePackage "developer_cmds" "osx-10.11.6" "1r9c2b6dcl22diqf90x58psvz797d3lxh4r2wppr7lldgbgn24di" {};
|
||||
diskdev_cmds = applePackage "diskdev_cmds" "osx-10.11.6" "1ssdyiaq5m1zfy96yy38yyknp682ki6bvabdqd5z18fa0rv3m2ar" {};
|
||||
network_cmds = applePackage "network_cmds" "osx-10.11.6" "0lhi9wz84qr1r2ab3fb4nvmdg9gxn817n5ldg7zw9gnf3wwn42kw" {};
|
||||
file_cmds = applePackage "file_cmds" "osx-10.11.6" "1zfxbmasps529pnfdjvc13p7ws2cfx8pidkplypkswyff0nff4wp" {};
|
||||
shell_cmds = applePackage "shell_cmds" "osx-10.11.6" "0084k271v66h4jqp7q7rmjvv7w4mvhx3aq860qs8jbd30canm86n" {};
|
||||
system_cmds = applePackage "system_cmds" "osx-10.11.6" "1h46j2c5v02pkv5d9fyv6cpgyg0lczvwicrx6r9s210cl03l77jl" {};
|
||||
top = applePackage "top" "osx-10.11.6" "0i9120rfwapgwdvjbfg0ya143i29s1m8zbddsxh39pdc59xnsg5l" {};
|
||||
|
||||
security_systemkeychain = applePackage "security_systemkeychain" "osx-10.10.5" "0xviskdgxsail15npi0billyiysvljlmg38mmhnr7qi4ymnnjr90" {};
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
{ stdenv, appleDerivation, xcbuild, lib, hostPlatform, Libc, xnu, libutil-new }:
|
||||
|
||||
appleDerivation {
|
||||
buildInputs = [ xcbuild libutil-new ];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-I.";
|
||||
NIX_LDFLAGS = "-lutil";
|
||||
patchPhase = ''
|
||||
# ugly hacks for missing headers
|
||||
# most are bsd related - probably should make this a drv
|
||||
unpackFile ${Libc.src}
|
||||
unpackFile ${xnu.src}
|
||||
mkdir System sys machine i386
|
||||
cp xnu-*/bsd/sys/disklabel.h sys
|
||||
cp xnu-*/bsd/machine/disklabel.h machine
|
||||
cp xnu-*/bsd/i386/disklabel.h i386
|
||||
cp -r xnu-*/bsd/sys System
|
||||
cp -r Libc-*/uuid System
|
||||
'';
|
||||
installPhase = ''
|
||||
install -D Products/Release/libdisk.a $out/lib/libdisk.a
|
||||
rm Products/Release/libdisk.a
|
||||
for bin in Products/Release/*; do
|
||||
install -D $bin $out/bin/$(basename $bin)
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = stdenv.lib.platforms.darwin;
|
||||
maintainers = with stdenv.lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
@ -4,16 +4,12 @@
|
||||
appleDerivation {
|
||||
buildInputs = [ xcbuild ];
|
||||
|
||||
dontUseXcbuild = true;
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace tzlink.c \
|
||||
--replace '#include <xpc/xpc.h>' ""
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
xcodebuild -target util
|
||||
'';
|
||||
xcbuildFlags = "-target util";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib $out/include
|
||||
|
@ -0,0 +1,15 @@
|
||||
{xcbuild, appleDerivation, apple_sdk, ncurses, libutil-new, lib}:
|
||||
|
||||
appleDerivation {
|
||||
buildInputs = [ xcbuild apple_sdk.frameworks.IOKit ncurses libutil-new ];
|
||||
NIX_LDFLAGS = "-lutil";
|
||||
installPhase = ''
|
||||
install -D Products/Release/libtop.a $out/lib/libtop.a
|
||||
install -D Products/Release/libtop.h $out/include/libtop.h
|
||||
install -D Products/Release/top $out/bin/top
|
||||
'';
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
{ stdenv, lib, fetchurl, flex, bison, linuxHeaders, libtirpc, mount, umount, modprobe, nfs-utils, e2fsprogs
|
||||
{ stdenv, lib, fetchurl, flex, bison, linuxHeaders, libtirpc, mount, umount, nfs-utils, e2fsprogs
|
||||
, libxml2, kerberos, kmod, openldap, sssd, cyrus_sasl, openssl }:
|
||||
|
||||
let
|
||||
@ -20,7 +20,7 @@ in stdenv.mkDerivation {
|
||||
export MOUNT=${mount}/bin/mount
|
||||
export MOUNT_NFS=${nfs-utils}/bin/mount.nfs
|
||||
export UMOUNT=${umount}/bin/umount
|
||||
export MODPROBE=${modprobe}/bin/modprobe
|
||||
export MODPROBE=${kmod}/bin/modprobe
|
||||
export E2FSCK=${e2fsprogs}/bin/fsck.ext2
|
||||
export E3FSCK=${e2fsprogs}/bin/fsck.ext3
|
||||
export E4FSCK=${e2fsprogs}/bin/fsck.ext4
|
||||
|
@ -21233,6 +21233,6 @@ with pkgs;
|
||||
|
||||
# Unix tools
|
||||
unixtools = recurseIntoAttrs (callPackages ./unix-tools.nix { });
|
||||
inherit (unixtools) hexdump ps logger eject modprobe umount
|
||||
inherit (unixtools) hexdump ps logger eject umount
|
||||
mount wall hostname more sysctl;
|
||||
}
|
||||
|
@ -48,6 +48,14 @@ in rec {
|
||||
linux = pkgs.utillinux;
|
||||
darwin = pkgs.getopt;
|
||||
};
|
||||
fdisk = singleBinary "fdisk" {
|
||||
linux = pkgs.utillinux;
|
||||
darwin = pkgs.darwin.diskdev_cmds;
|
||||
};
|
||||
fsck = singleBinary "fsck" {
|
||||
linux = pkgs.utillinux;
|
||||
darwin = pkgs.darwin.diskdev_cmds;
|
||||
};
|
||||
hexdump = singleBinary "hexdump" {
|
||||
linux = pkgs.utillinux;
|
||||
darwin = pkgs.darwin.shell_cmds;
|
||||
@ -63,15 +71,13 @@ in rec {
|
||||
logger = singleBinary "logger" {
|
||||
linux = pkgs.utillinux;
|
||||
};
|
||||
modprobe = singleBinary "modprobe" {
|
||||
linux = pkgs.kmod;
|
||||
};
|
||||
more = singleBinary "more" {
|
||||
linux = pkgs.utillinux;
|
||||
darwin = more_compat;
|
||||
};
|
||||
mount = singleBinary "mount" {
|
||||
linux = pkgs.utillinux;
|
||||
darwin = pkgs.darwin.diskdev_cmds;
|
||||
};
|
||||
netstat = singleBinary "netstat" {
|
||||
linux = pkgs.nettools;
|
||||
@ -85,6 +91,10 @@ in rec {
|
||||
linux = pkgs.procps;
|
||||
darwin = pkgs.darwin.ps;
|
||||
};
|
||||
quota = singleBinary "quota" {
|
||||
linux = pkgs.utillinux;
|
||||
darwin = pkgs.darwin.diskdev_cmds;
|
||||
};
|
||||
route = singleBinary "route" {
|
||||
linux = pkgs.nettools;
|
||||
darwin = pkgs.darwin.network_cmds;
|
||||
@ -97,8 +107,13 @@ in rec {
|
||||
linux = pkgs.procps;
|
||||
darwin = pkgs.darwin.system_cmds;
|
||||
};
|
||||
top = singleBinary "top" {
|
||||
linux = pkgs.procps;
|
||||
darwin = pkgs.darwin.top;
|
||||
};
|
||||
umount = singleBinary "umount" {
|
||||
linux = pkgs.utillinux;
|
||||
darwin = pkgs.darwin.diskdev_cmds;
|
||||
};
|
||||
whereis = singleBinary "whereis" {
|
||||
linux = pkgs.utillinux;
|
||||
@ -117,16 +132,17 @@ in rec {
|
||||
|
||||
procps = buildEnv {
|
||||
name = "procps-compat";
|
||||
paths = [ sysctl ps ];
|
||||
paths = [ ps sysctl top ];
|
||||
};
|
||||
|
||||
utillinux = buildEnv {
|
||||
name = "utillinux-compat";
|
||||
paths = [ getopt hexdump script whereis write ];
|
||||
paths = [ fsck fdisk getopt hexdump mount
|
||||
quota script umount whereis write ];
|
||||
};
|
||||
|
||||
nettools = buildEnv {
|
||||
name = "nettools-compat";
|
||||
paths = [ arp hostname netstat route ];
|
||||
paths = [ arp hostname ifconfig netstat route ];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user