From 068bf90e01d86110421a9cc23c918a04a10d1905 Mon Sep 17 00:00:00 2001 From: Benjamin Summers Date: Tue, 6 Nov 2018 19:56:48 -0800 Subject: [PATCH] Build with nix on OSX and Linux --- scripts/bootstrap | 2 +- scripts/build | 2 +- scripts/nixbuild | 3 +++ shell.nix | 16 ++++++++++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 scripts/nixbuild create mode 100644 shell.nix diff --git a/scripts/bootstrap b/scripts/bootstrap index 4ac72fa7b..3a8a74e56 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash git submodule init git submodule update diff --git a/scripts/build b/scripts/build index bf5353f54..ccc472cb7 100755 --- a/scripts/build +++ b/scripts/build @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash mkdir ./build &> /dev/null meson . ./build --buildtype=release diff --git a/scripts/nixbuild b/scripts/nixbuild new file mode 100755 index 000000000..20ec10055 --- /dev/null +++ b/scripts/nixbuild @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +nix-shell --pure --run ./scripts/build diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..817082edc --- /dev/null +++ b/shell.nix @@ -0,0 +1,16 @@ +with (import {}); + +let + + osxdeps = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ + Cocoa + CoreServices + ]); + + deps = [ cmark curl gcc gmp libsigsegv meson ncurses ninja pkgconfig zlib re2c ]; + +in stdenv.mkDerivation { + name = "urbit"; + buildInputs = osxdeps ++ deps; + NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreServices"; +}