Adds nix expression for debugir

This commit is contained in:
Joshua Hoeflich 2021-08-08 20:56:32 -05:00
parent 192b1f3d6f
commit 000910fd38
2 changed files with 29 additions and 0 deletions

27
nix/debugir.nix Normal file
View File

@ -0,0 +1,27 @@
{ pkgs ? import <nixpkgs> {}}:
pkgs.stdenv.mkDerivation {
name = "debugir";
src = pkgs.fetchFromGitHub {
owner = "vaivaswatha";
repo = "debugir";
rev = "ed454ba264f30d2a70264357a31d94db3dd676eb";
sha256 = "08hrn66zn5pa8jk45msl9ipa8d1p7r9gmpknh41fyjr6c7qpmfrk";
};
buildInputs = with pkgs; [
cmake
libxml2
llvmPackages_12.llvm.dev
];
buildPhase = ''
mkdir build
cd build
cmake -DLLVM_DIR=${pkgs.llvmPackages_12.llvm.dev} -DCMAKE_BUILD_TYPE=Release ../
cmake --build ../
cp ../debugir .
'';
installPhase = ''
mkdir -p $out/bin
cp debugir $out/bin
'';
}

View File

@ -32,6 +32,7 @@ let
llvmPkgs = pkgs.llvmPackages_12;
zig = import ./nix/zig.nix { inherit pkgs; };
debugir = import ./nix/debugir.nix { inherit pkgs; };
inputs = with pkgs; [
# build libraries
@ -60,6 +61,7 @@ let
# faster builds - see https://github.com/rtfeldman/roc/blob/trunk/BUILDING_FROM_SOURCE.md#use-lld-for-the-linker
llvmPkgs.lld
debugir
# meta-tools
# note: niv manages its own nixpkgs so it doesn't need pkgs.callPackage. Do