Build with nix on OSX and Linux

This commit is contained in:
Benjamin Summers 2018-11-06 19:56:48 -08:00
parent 3c79a24554
commit 068bf90e01
4 changed files with 21 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
git submodule init
git submodule update

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
mkdir ./build &> /dev/null
meson . ./build --buildtype=release

3
scripts/nixbuild Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
nix-shell --pure --run ./scripts/build

16
shell.nix Normal file
View File

@ -0,0 +1,16 @@
with (import <nixpkgs> {});
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";
}