summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/apple-source-releases/CoreOSMakefiles/default.nix
blob: 9f6031771c2d3c9b504d720cf82e66a3657e8ffd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ stdenv, appleDerivation, unifdef }:

appleDerivation {
  buildinputs = [ unifdef ];

  phases = [ "unpackPhase" "installPhase" ];

  preInstall = ''
    substituteInPlace Makefile \
      --replace "rsync -a --exclude=.svn --exclude=.git" "cp -r"

    substituteInPlace Standard/Commands.in \
      --replace "/bin/sh" "bash" \
      --replace "/usr/bin/compress" "compress" \
      --replace "/usr/bin/gzip" "gzip" \
      --replace "/bin/pax" "pax" \
      --replace "/usr/bin/tar" "tar" \
      --replace "xcrun -find" "echo" \
      --replace '$(Install_Program_Group)   -s' '$(Install_Program_Group)' \
      --replace '$(Install_Program_Mode)   -s'  '$(Install_Program_Mode)'

    substituteInPlace ReleaseControl/Common.make \
      --replace "/tmp" "$TMPDIR"

    substituteInPlace ReleaseControl/BSDCommon.make \
      --replace '$(shell xcrun -find -sdk $(SDKROOT) cc)' "cc"

    export DSTROOT=$out
  '';
}