Unverified Commit 4d47ff9e authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

Merge pull request #295463 from NickCao/systemc-cmake

systemc: build with cmake, expand platforms to unix
parents e4d41522 cf7deee3
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
{ lib, stdenv, fetchFromGitHub, cmake }:

stdenv.mkDerivation rec {
  pname = "systemc";
@@ -11,16 +11,21 @@ stdenv.mkDerivation rec {
    sha256 = "0sj8wlkp68cjhmkd9c9lvm3lk3sckczpz7w9vby64inc1f9fnf0b";
  };

  enableParallelBuilding = true;
  nativeBuildInputs = [ autoreconfHook ];
  nativeBuildInputs = [ cmake ];

  configureFlags = [ "--with-unix-layout" ];
  cmakeFlags = [
    # Undefined reference to the sc_core::sc_api_version_2_3_4_XXX
    # https://github.com/accellera-official/systemc/issues/21
    "-DCMAKE_CXX_STANDARD=17"
  ];

  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;

  meta = with lib; {
    description = "The language for System-level design, modeling and verification";
    homepage    = "https://systemc.org/";
    license     = licenses.asl20;
    platforms   = platforms.linux;
    platforms   = platforms.unix;
    maintainers = with maintainers; [ victormignot amiloradovsky ];
  };
}
+15 −1
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, perl, flex, bison, python3, autoconf,
{ lib, stdenv, fetchFromGitHub, fetchpatch, perl, flex, bison, python3, autoconf,
  which, cmake, ccache, help2man, makeWrapper, glibcLocales,
  systemc, git, numactl }:

@@ -13,6 +13,15 @@ stdenv.mkDerivation rec {
    hash = "sha256-Ya3lqK8BfvMVLZUrD2Et6OmptteWXp5VmZb2x2G/V/E=";
  };

  patches = [
    (fetchpatch {
      # Fix try-lock spuriously fail in V3ThreadPool destructor
      # https://github.com/verilator/verilator/pull/4938
      url = "https://github.com/verilator/verilator/commit/4b9cce4369c78423779238e585ed693c456d464e.patch";
      hash = "sha256-sGrk/pxqZqUcmJdzQoPlzXMmYqHCOmd9Y2n6ieVNg1U=";
    })
  ];

  enableParallelBuilding = true;
  buildInputs = [ perl python3 systemc ];  # ccache
  nativeBuildInputs = [ makeWrapper flex bison autoconf help2man git ];
@@ -37,6 +46,11 @@ stdenv.mkDerivation rec {
    done
  '';

  env = {
    SYSTEMC_INCLUDE = "${lib.getDev systemc}/include";
    SYSTEMC_LIBDIR = "${lib.getLib systemc}/lib";
  };

  meta = with lib; {
    description = "Fast and robust (System)Verilog simulator/compiler and linter";
    homepage    = "https://www.veripool.org/verilator";