
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253. This wasn't tested for correctness with something like fodwatch [0], and should not have been (self-)merged so quickly, especially without further review. It also resulted in the breakage of at least one package [1] (and that's the one we know of and was caught). A few packages that were updated in between this commit and this revert were not reverted back to using `rev`, but other than that, this is a 1:1 revert. [0]: https://codeberg.org/raphaelr/fodwatch [1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
66 lines
1.5 KiB
Nix
66 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
boost,
|
|
catch2_3,
|
|
cmake,
|
|
ninja,
|
|
fmt_11,
|
|
mimalloc,
|
|
python3,
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "sv-lang";
|
|
version = "7.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "MikePopoloski";
|
|
repo = "slang";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-msSc6jw2xbEZfOwtqwFEDIKcwf5SDKp+j15lVbNO98g=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace external/CMakeLists.txt \
|
|
--replace-fail 'set(mimalloc_min_version "2.1")' 'set(mimalloc_min_version "${lib.versions.majorMinor mimalloc.version}")'
|
|
'';
|
|
|
|
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 = [
|
|
boost
|
|
fmt_11
|
|
mimalloc
|
|
# though only used in tests, cmake will complain its absence when configuring
|
|
catch2_3
|
|
];
|
|
|
|
# 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;
|
|
};
|
|
}
|