Skip to content

Commit

Permalink
sv-lang: added version 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HU90m committed Nov 22, 2024
1 parent 810110b commit 7ed8b4b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 46 deletions.
3 changes: 2 additions & 1 deletion pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
container-hotplug = pkgs.callPackage ./container-hotplug {};
surfer = pkgs.callPackage ./surfer/default.nix {};
uf2conv = pkgs.callPackage ./uf2conv.nix {};
sv-lang_6 = pkgs.callPackage ./sv-lang.nix {};

inherit (pkgs.callPackage ./sv-lang.nix {}) sv-lang_6 sv-lang_7;
veridian = pkgs.callPackage ./veridian/default.nix {inherit sv-lang_6;};
peakrdl = pkgs.callPackage ./peakrdl.nix {};

Expand Down
95 changes: 50 additions & 45 deletions pkgs/sv-lang.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,63 @@
cmake,
ninja,
python3,
}:
stdenv.mkDerivation rec {
pname = "sv-lang";
version = "6.0";
}: let
svLangDerivation = version: hash:
stdenv.mkDerivation rec {
pname = "sv-lang";
inherit version;

src = fetchFromGitHub {
owner = "MikePopoloski";
repo = "slang";
rev = "v${version}";
sha256 = "sha256-mT8sfUz0H4jWM/SkV/uW4kmVKE9UQy6XieG65yJvIA8=";
};
src = fetchFromGitHub {
owner = "MikePopoloski";
repo = "slang";
rev = "v${version}";
inherit hash;
};

cmakeFlags = [
# fix for https://github.com/NixOS/nixpkgs/issues/144170
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBDIR=lib"
cmakeFlags = [
# fix for https://github.com/NixOS/nixpkgs/issues/144170
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBDIR=lib"

"-DFETCHCONTENT_SOURCE_DIR_FMT=${fmt_10.src.outPath}"
"-DFETCHCONTENT_SOURCE_DIR_CATCH2=${catch2_3.src.outPath}"
"-DFETCHCONTENT_SOURCE_DIR_FMT=${fmt_10.src.outPath}"
"-DFETCHCONTENT_SOURCE_DIR_CATCH2=${catch2_3.src.outPath}"

"-DSLANG_INCLUDE_TESTS=${
if doCheck
then "ON"
else "OFF"
}"
"-DSLANG_USE_MIMALLOC=OFF"
];
"-DSLANG_INCLUDE_TESTS=${
if doCheck
then "ON"
else "OFF"
}"
"-DSLANG_USE_MIMALLOC=OFF"
];

nativeBuildInputs = [
cmake
python3
ninja
nativeBuildInputs = [
cmake
python3
ninja

# though only used in tests, cmake will complain its absence when configuring
catch2_3
];
# though only used in tests, cmake will complain its absence when configuring
catch2_3
];

buildInputs = [
boost182
];
buildInputs = [
boost182
];

# TODO: a mysterious linker error occurs when building the unittests on darwin.
# The error occurs when using catch2_3 in nixpkgs, not when fetching catch2_3 using CMake
doCheck = !stdenv.isDarwin;
# TODO: a mysterious linker error occurs when building the unittests on darwin.
# The error occurs when using catch2_3 in nixpkgs, not when fetching catch2_3 using CMake
doCheck = !stdenv.isDarwin;

meta = with lib; {
description = "SystemVerilog compiler and language services";
homepage = "https://github.com/MikePopoloski/slang";
license = licenses.mit;
maintainers = with maintainers; [sharzy];
mainProgram = "slang";
broken = stdenv.isDarwin;
platforms = platforms.all;
};
meta = with lib; {
description = "SystemVerilog compiler and language services";
homepage = "https://github.com/MikePopoloski/slang";
license = licenses.mit;
maintainers = with maintainers; [sharzy];
mainProgram = "slang";
broken = stdenv.isDarwin;
platforms = platforms.all;
};
};
in {
sv-lang_6 = svLangDerivation "6.0" "sha256-mT8sfUz0H4jWM/SkV/uW4kmVKE9UQy6XieG65yJvIA8=";
sv-lang_7 = svLangDerivation "7.0" "sha256-msSc6jw2xbEZfOwtqwFEDIKcwf5SDKp+j15lVbNO98g=";
}

0 comments on commit 7ed8b4b

Please sign in to comment.