mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-21 05:45:19 +00:00
Add Nix derivation
This commit is contained in:
27
default.nix
Normal file
27
default.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
let
|
||||
odin-unwrapped = pkgs.llvmPackages_11.stdenv.mkDerivation (rec {
|
||||
name = "odin-unwrapped";
|
||||
src = ./.;
|
||||
dontConfigure = true;
|
||||
nativeBuildInputs = [ pkgs.git ];
|
||||
buildPhase = ''
|
||||
make debug SHELL=${pkgs.llvmPackages_11.stdenv.shell}
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp odin $out/bin/odin
|
||||
cp -r core $out/bin/core
|
||||
'';
|
||||
});
|
||||
path = builtins.map (path: path + "/bin") (with pkgs.llvmPackages_11; [
|
||||
bintools
|
||||
llvm
|
||||
clang
|
||||
lld
|
||||
]);
|
||||
in
|
||||
pkgs.writeScriptBin "odin" ''
|
||||
#!${pkgs.llvmPackages_11.stdenv.shell}
|
||||
PATH="${(builtins.concatStringsSep ":" path)}" exec ${odin-unwrapped}/bin/odin $@
|
||||
''
|
||||
Reference in New Issue
Block a user