ctucx.git: nixfiles

ctucx' nixfiles

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 
{stdenv, runCommand, ...}:

let
  buildSymlinks = runCommand "macvim-build-symlinks" {} ''
    mkdir -p $out/bin
    ln -s /usr/bin/gcc $out/bin
  '';

in stdenv.mkDerivation {
  name = "XPCEventStreamHandler";
  src = ./.;

  nativeBuildInputs = [ buildSymlinks ];

  sandboxProfile = ''
     (allow file-read* file-write* process-exec mach-lookup)
     ; block homebrew dependencies
     (deny file-read* file-write* process-exec mach-lookup (subpath "/usr/local") (with no-log))
  '';

  buildPhase = "gcc -framework Foundation -o xpc_set_event_stream_handler xpc_set_event_stream_handler.m";

  installPhase = ''
    mkdir -p $out/bin
    cp xpc_set_event_stream_handler $out/bin/
  '';
}