lol

verible: init at 0.0-2172-g238b6df6

Verible is a suite of SystemVerilog developer tools, including a parser,
style-linter, formatter, and language server.

Signed-off-by: Henner Zeller <h.zeller@acm.org>

+109
+85
pkgs/development/tools/verible/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , buildBazelPackage 5 + , bazel_4 6 + , flex 7 + , bison 8 + , python3 9 + }: 10 + 11 + buildBazelPackage rec { 12 + pname = "verible"; 13 + version = "0.0-2172-g238b6df6"; 14 + 15 + # These environment variables are read in bazel/build-version.py to create 16 + # a build string. Otherwise it would attempt to extract it from .git/. 17 + GIT_DATE = "2022-08-08"; 18 + GIT_VERSION = version; 19 + 20 + src = fetchFromGitHub { 21 + owner = "chipsalliance"; 22 + repo = "verible"; 23 + rev = "v${version}"; 24 + sha256 = "sha256-iOJhdbipuqqBiYGgk95d1c8bEK6Z16l16GuzYCQRc2g="; 25 + }; 26 + 27 + patches = [ 28 + # Patch WORKSPACE file to not include windows-related dependencies, 29 + # as they are removed by bazel, breaking the fixed output derivation 30 + # TODO: fix upstream 31 + ./remove-unused-deps.patch 32 + ]; 33 + 34 + bazelFlags = [ "--//bazel:use_local_flex_bison" ]; 35 + 36 + fetchAttrs = { 37 + # Fixed output derivation hash after bazel fetch 38 + sha256 = "sha256-XoLdlEeoDJlyWlnXZADHOKu06zKHgHJfgey8UhOt+LM="; 39 + }; 40 + 41 + nativeBuildInputs = [ 42 + flex # We use local flex and bison as WORKSPACE sources fail 43 + bison # .. to compile with newer glibc 44 + python3 45 + ]; 46 + 47 + postPatch = '' 48 + patchShebangs bazel/build-version.py \ 49 + common/util/create_version_header.sh \ 50 + common/parser/move_yacc_stack_symbols.sh \ 51 + common/parser/record_syntax_error.sh 52 + ''; 53 + 54 + removeRulesCC = false; 55 + bazelTarget = ":install-binaries"; 56 + bazelBuildFlags = [ 57 + "-c opt" 58 + ]; 59 + buildAttrs = { 60 + installPhase = '' 61 + mkdir -p "$out/bin" 62 + 63 + install bazel-bin/common/tools/verible-patch-tool "$out/bin" 64 + 65 + V_TOOLS_DIR=bazel-bin/verilog/tools 66 + install $V_TOOLS_DIR/diff/verible-verilog-diff "$out/bin" 67 + install $V_TOOLS_DIR/formatter/verible-verilog-format "$out/bin" 68 + install $V_TOOLS_DIR/kythe/verible-verilog-kythe-extractor "$out/bin" 69 + install $V_TOOLS_DIR/lint/verible-verilog-lint "$out/bin" 70 + install $V_TOOLS_DIR/ls/verible-verilog-ls "$out/bin" 71 + install $V_TOOLS_DIR/obfuscator/verible-verilog-obfuscate "$out/bin" 72 + install $V_TOOLS_DIR/preprocessor/verible-verilog-preprocessor "$out/bin" 73 + install $V_TOOLS_DIR/project/verible-verilog-project "$out/bin" 74 + install $V_TOOLS_DIR/syntax/verible-verilog-syntax "$out/bin" 75 + ''; 76 + }; 77 + 78 + meta = with lib; { 79 + homepage = "https://github.com/chipsalliance/verible"; 80 + description = "Suite of SystemVerilog developer tools. Including a style-linter, indexer, formatter, and language server."; 81 + license = licenses.asl20; 82 + platforms = platforms.linux; 83 + maintainers = with maintainers; [ hzeller ]; 84 + }; 85 + }
+22
pkgs/development/tools/verible/remove-unused-deps.patch
··· 1 + diff --git a/WORKSPACE b/WORKSPACE 2 + index 696cc7ef..55a5bb8a 100644 3 + --- a/WORKSPACE 4 + +++ b/WORKSPACE 5 + @@ -81,17 +81,6 @@ load("@com_github_google_rules_install//:setup.bzl", "install_rules_setup") 6 + 7 + install_rules_setup() 8 + 9 + -# Need to load before rules_flex/rules_bison to make sure 10 + -# win_flex_bison is the chosen toolchain on Windows 11 + -load("//bazel:win_flex_bison.bzl", "win_flex_configure") 12 + - 13 + -win_flex_configure( 14 + - name = "win_flex_bison", 15 + - sha256 = "095cf65cb3f12ee5888022f93109acbe6264e5f18f6ffce0bda77feb31b65bd8", 16 + - # bison 3.3.2, flex 2.6.4 17 + - url = "https://github.com/lexxmark/winflexbison/releases/download/v2.5.18/win_flex_bison-2.5.18.zip", 18 + -) 19 + - 20 + http_archive( 21 + name = "rules_m4", 22 + sha256 = "c67fa9891bb19e9e6c1050003ba648d35383b8cb3c9572f397ad24040fb7f0eb",
+2
pkgs/top-level/all-packages.nix
··· 11827 11827 11828 11828 verco = callPackage ../applications/version-management/verco { }; 11829 11829 11830 + verible = callPackage ../development/tools/verible { }; 11831 + 11830 11832 verilator = callPackage ../applications/science/electronics/verilator {}; 11831 11833 11832 11834 verilog = callPackage ../applications/science/electronics/verilog {