Skip to content

Commit

Permalink
Merge pull request snabbco#32 from lukego/nix-comments
Browse files Browse the repository at this point in the history
Comment nix expression
  • Loading branch information
lukego authored Mar 15, 2017
2 parents 937375e + cd0e416 commit aa188bc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ PRs welcome! Shock me with your radical ideas! :-)

RaptorJIT uses [nix](http://nixos.org/nix/) to define a reproducible
build environment that includes Clang for C and LuaJIT 2.0 for
bootstrapping. The recommended way to build RaptorJIT is with nix,
which provides the dependencies automatically, but you can build
manually if you prefer.
bootstrapping (see [default.nix](default.nix)). The recommended way to
build RaptorJIT is with nix, which provides the dependencies
automatically, but you can build manually if you prefer.

#### Build with nix

Expand Down
19 changes: 15 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
{ pkgs ? (import <nixpkgs> {})
# default.nix - define the build environment for RaptorJIT
#
# This file can be used by 'nix-build' or 'nix-shell' to create a
# pristine build environment with precisely the expected software in
# $PATH. This makes it possible to build raptorjit in the same way on
# any machine.
#
# See README.md for usage instructions.

{ pkgs ? (import <nixpkgs> {}) # Use default nix distro (for now...)
, source ? ./.
, version ? "dev"
}:

with pkgs;
with clangStdenv;
with clangStdenv; # Clang instead of GCC

mkDerivation rec {
name = "raptorjit-${version}";
inherit version;
src = lib.cleanSource source;
enableParallelBuilding = true;
buildInputs = [ luajit ];
buildInputs = [ luajit ]; # LuaJIT to bootstrap DynASM
installPhase = ''
mkdir -p $out/bin
cp src/luajit $out/bin/raptorjit
'';

enableParallelBuilding = true; # Do 'make -j'
}

0 comments on commit aa188bc

Please sign in to comment.