From 0b833261727ff8c36e3c51eab8f522747198429a Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 8 Apr 2018 00:41:15 -0500 Subject: [PATCH] darling: init --- pkgs/os-specific/darwin/darling/default.nix | 34 +++++++++++++++++++++ pkgs/top-level/darwin-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/os-specific/darwin/darling/default.nix diff --git a/pkgs/os-specific/darwin/darling/default.nix b/pkgs/os-specific/darwin/darling/default.nix new file mode 100644 index 000000000000..8c94b2d878dd --- /dev/null +++ b/pkgs/os-specific/darwin/darling/default.nix @@ -0,0 +1,34 @@ +{stdenv, lib, fetchFromGitHub, cmake, bison, flex}: + +stdenv.mkDerivation rec { + pname = "darling"; + name = pname; + + src = fetchFromGitHub { + repo = pname; + owner = "darlinghq"; + rev = "d2cc5fa748003aaa70ad4180fff0a9a85dc65e9b"; + sha256 = "1mkcnzy1cfpwghgvb9pszhy9jy6534y8krw8inwl9fqfd0w019wz"; + }; + + # only packaging sandbox for now + buildPhase = '' + cc -c src/sandbox/sandbox.c -o src/sandbox/sandbox.o + cc -dynamiclib -flat_namespace src/sandbox/sandbox.o -o libsystem_sandbox.dylib + ''; + + installPhase = '' + mkdir -p $out/lib + cp -rL src/sandbox/include/ $out/ + cp libsystem_sandbox.dylib $out/lib/ + ''; + + # buildInputs = [ cmake bison flex ]; + + meta = with lib; { + maintainers = with maintainers; [ matthewbauer ]; + license = licenses.gpl3; + description = "Darwin/macOS emulation layer for Linux"; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index 55b8fc9238be..d1d5aa470bca 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -67,4 +67,6 @@ in swift-corelibs = callPackages ../os-specific/darwin/swift-corelibs { }; + darling = callPackage ../os-specific/darwin/darling/default.nix { }; + })