Skip to content

Commit

Permalink
use nixpkgs circt
Browse files Browse the repository at this point in the history
  • Loading branch information
sequencer committed Dec 15, 2023
1 parent 66dc1a4 commit 50fc6d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
8 changes: 2 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
circtSrc = {
url = "git+https://github.com/llvm/circt?submodules=1&shallow=1";
flake = false;
};
};

outputs = { self, nixpkgs, flake-utils, circtSrc }@inputs:
outputs = { self, nixpkgs, flake-utils }@inputs:
let
overlay = import ./overlay.nix circtSrc ;
overlay = import ./overlay.nix;
in
flake-utils.lib.eachDefaultSystem
(system:
Expand Down
33 changes: 9 additions & 24 deletions overlay.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
circtSrc: final: prev:
final: prev:
{
mill = (prev.mill.overrideAttrs (oldAttrs: rec {
version = "0.11.5";
Expand Down Expand Up @@ -26,29 +26,14 @@ circtSrc: final: prev:

espresso = final.callPackage ./nix/espresso.nix { };
circt = prev.circt.overrideAttrs (old: rec {
version = circtSrc.shortRev;
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DLLVM_ENABLE_BINDINGS=OFF"
"-DLLVM_ENABLE_OCAMLDOC=OFF"
"-DLLVM_BUILD_EXAMPLES=OFF"
"-DLLVM_OPTIMIZED_TABLEGEN=ON"
"-DLLVM_ENABLE_PROJECTS=mlir"
"-DLLVM_EXTERNAL_PROJECTS=circt"
"-DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=.."
"-DCIRCT_LLHD_SIM_ENABLED=OFF"
];
src = circtSrc;
preConfigure = ''
find ./test -name '*.mlir' -exec sed -i 's|/usr/bin/env|${final.coreutils}/bin/env|g' {} \;
substituteInPlace cmake/modules/GenVersionFile.cmake --replace "unknown git version" "git version ${version}"
'';
installPhase = ''
runHook preInstall
mkdir -p $out
CMAKE_INSTALL_PREFIX=$out cmake --build . --target install --config Release
runHook postInstall
'';
version = "nightly";
src = final.fetchFromGitHub {
owner = "llvm";
repo = "circt";
rev = "57372957e8365b34ca469299b8c864d830e836a1";
sha256 = "sha256-gExhWkhVhIpTKRCfF26pZnrcrf//ASQJDxEKbYc570s=";
fetchSubmodules = true;
};
});

llvm-lit = final.callPackage ./nix/llvm-lit.nix { };
Expand Down

0 comments on commit 50fc6d5

Please sign in to comment.