-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nix flake and lock file. Add nix build step. Pending nix flake up…
…date step
- Loading branch information
1 parent
bdce7fa
commit 1c89e2a
Showing
3 changed files
with
118 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: "build nix flake" | ||
on: | ||
pull_request: | ||
push: | ||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: cachix/install-nix-action@v25 | ||
- run: nix build '.?submodules=1' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
description = "A nix flake for the Yosys synthesis suite"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
}; | ||
customYosys = pkgs.clangStdenv.mkDerivation { | ||
name = "yosys"; | ||
src = ./. ; | ||
buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git ]; | ||
checkInputs = with pkgs; [ gtest ]; | ||
propagatedBuildInputs = with pkgs; [ abc-verifier ]; | ||
preConfigure = "make config-clang"; | ||
checkTarget = "test"; | ||
installPhase = '' | ||
make install PREFIX=$out | ||
''; | ||
buildPhase = '' | ||
make -j$(nproc) | ||
''; | ||
meta = with pkgs.lib; { | ||
description = "Yosys Open SYnthesis Suite"; | ||
homepage = "https://yosyshq.net/yosys/"; | ||
license = licenses.isc; | ||
maintainers = with maintainers; [ ]; | ||
}; | ||
}; | ||
in { | ||
packages.default = customYosys; | ||
defaultPackage = customYosys; | ||
devShell = pkgs.mkShell { | ||
buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git gtest abc-verifier ]; | ||
}; | ||
} | ||
); | ||
} |