summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorMatthew Justin Bauer <mjbauer95@gmail.com>2018-04-13 00:12:49 -0500
committerGitHub <noreply@github.com>2018-04-13 00:12:49 -0500
commit1b11ffbae8739ffbf365a2bf8318e6db9f6deea6 (patch)
tree0b7c8d7c1a2a7656f6d98cc64326835f5099b5b0 /pkgs/os-specific
parent6b796a9c23db8cbb3065ffdd20c1a53fd86de9a6 (diff)
parent23467e207feb13d2ca783f0d36a21988e037507b (diff)
downloadnixlib-1b11ffbae8739ffbf365a2bf8318e6db9f6deea6.tar
nixlib-1b11ffbae8739ffbf365a2bf8318e6db9f6deea6.tar.gz
nixlib-1b11ffbae8739ffbf365a2bf8318e6db9f6deea6.tar.bz2
nixlib-1b11ffbae8739ffbf365a2bf8318e6db9f6deea6.tar.lz
nixlib-1b11ffbae8739ffbf365a2bf8318e6db9f6deea6.tar.xz
nixlib-1b11ffbae8739ffbf365a2bf8318e6db9f6deea6.tar.zst
nixlib-1b11ffbae8739ffbf365a2bf8318e6db9f6deea6.zip
Merge pull request #38880 from matthewbauer/darwin-devdisk
Add Darwin devdisk commands and put them in unixtools
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/default.nix4
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix32
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libutil/new.nix6
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/top/default.nix15
-rw-r--r--pkgs/os-specific/linux/autofs/default.nix4
5 files changed, 54 insertions, 7 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix
index 6019c20dd409..5d4cd22363d6 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix
@@ -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" {};
 
diff --git a/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix
new file mode 100644
index 000000000000..aba2472af602
--- /dev/null
+++ b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix
@@ -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 ];
+  };
+}
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libutil/new.nix b/pkgs/os-specific/darwin/apple-source-releases/libutil/new.nix
index 2c75f3966dbf..7facea2b8936 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libutil/new.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/libutil/new.nix
@@ -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
diff --git a/pkgs/os-specific/darwin/apple-source-releases/top/default.nix b/pkgs/os-specific/darwin/apple-source-releases/top/default.nix
new file mode 100644
index 000000000000..4ddec2a30c90
--- /dev/null
+++ b/pkgs/os-specific/darwin/apple-source-releases/top/default.nix
@@ -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 ];
+  };
+}
diff --git a/pkgs/os-specific/linux/autofs/default.nix b/pkgs/os-specific/linux/autofs/default.nix
index a7472de1d025..859593e4b9aa 100644
--- a/pkgs/os-specific/linux/autofs/default.nix
+++ b/pkgs/os-specific/linux/autofs/default.nix
@@ -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