forked from snabbco/snabb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} | ||
|