nixpkgs/pkgs/by-name/sv/sv-lang/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.5 KiB
Nix
Raw Normal View History

2023-06-16 00:32:11 +08:00
{
lib,
stdenv,
fetchFromGitHub,
2024-11-23 03:14:35 +00:00
boost,
2023-06-16 00:32:11 +08:00
catch2_3,
cmake,
ninja,
fmt_11,
mimalloc,
2023-06-16 00:32:11 +08:00
python3,
}:
stdenv.mkDerivation rec {
pname = "sv-lang";
version = "7.0";
2023-06-16 00:32:11 +08:00
src = fetchFromGitHub {
owner = "MikePopoloski";
repo = "slang";
rev = "v${version}";
sha256 = "sha256-msSc6jw2xbEZfOwtqwFEDIKcwf5SDKp+j15lVbNO98g=";
2023-06-16 00:32:11 +08:00
};
2025-04-04 20:54:46 +02:00
postPatch = ''
substituteInPlace external/CMakeLists.txt \
--replace-fail 'set(mimalloc_min_version "2.1")' 'set(mimalloc_min_version "${lib.versions.majorMinor mimalloc.version}")'
'';
2023-06-16 00:32:11 +08:00
cmakeFlags = [
# fix for https://github.com/NixOS/nixpkgs/issues/144170
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DSLANG_INCLUDE_TESTS=${if doCheck then "ON" else "OFF"}"
];
nativeBuildInputs = [
cmake
python3
ninja
];
buildInputs = [
2024-11-23 03:14:35 +00:00
boost
fmt_11
mimalloc
2024-10-28 10:27:42 -04:00
# though only used in tests, cmake will complain its absence when configuring
catch2_3
2023-06-16 00:32:11 +08:00
];
# 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.hostPlatform.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";
platforms = platforms.all;
broken = stdenv.hostPlatform.isDarwin;
2023-06-16 00:32:11 +08:00
};
}