|
| 1 | +{ |
| 2 | + description = "A nix flake for the Yosys synthesis suite"; |
| 3 | + |
| 4 | + inputs = { |
| 5 | + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
| 6 | + flake-utils.url = "github:numtide/flake-utils"; |
| 7 | + nix-github-actions.url = "github:nix-community/nix-github-actions"; |
| 8 | + nix-github-actions.inputs.nixpkgs.follows = "nixpkgs"; |
| 9 | + }; |
| 10 | + |
| 11 | + outputs = { self, nixpkgs, flake-utils, nix-github-actions }: |
| 12 | + flake-utils.lib.eachDefaultSystem (system: |
| 13 | + let |
| 14 | + pkgs = import nixpkgs { |
| 15 | + inherit system; |
| 16 | + }; |
| 17 | + customYosys = pkgs.clangStdenv.mkDerivation { |
| 18 | + name = "yosys"; |
| 19 | + src = ./. ; |
| 20 | + buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git ]; |
| 21 | + checkInputs = with pkgs; [ gtest ]; |
| 22 | + propagatedBuildInputs = with pkgs; [ abc-verifier ]; |
| 23 | + preConfigure = "make config-clang"; |
| 24 | + checkTarget = "test"; |
| 25 | + installPhase = '' |
| 26 | + make install PREFIX=$out |
| 27 | + ''; |
| 28 | + meta = with pkgs.lib; { |
| 29 | + description = "Yosys Open SYnthesis Suite"; |
| 30 | + homepage = "https://yosyshq.net/yosys/"; |
| 31 | + license = licenses.isc; |
| 32 | + maintainers = with maintainers; [ ]; |
| 33 | + }; |
| 34 | + }; |
| 35 | + in { |
| 36 | + packages.default = customYosys; |
| 37 | + defaultPackage = customYosys; |
| 38 | + devShell = pkgs.mkShell { |
| 39 | + buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git gtest abc-verifier ]; |
| 40 | + }; |
| 41 | + githubActions = nix-github-actions.lib.mkGithubMatrix { checks = self.packages; }; |
| 42 | + } |
| 43 | + ); |
| 44 | +} |
0 commit comments