summary refs log blame commit diff
path: root/pkgs/os-specific/darwin/apple-source-releases/CoreOSMakefiles/default.nix
blob: 9f6031771c2d3c9b504d720cf82e66a3657e8ffd (plain) (tree)





























                                                                            
{ 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
  '';
}