Merge pull request #295463 from NickCao/systemc-cmake

systemc: build with cmake, expand platforms to unix

authored by Nick Cao and committed by GitHub 4d47ff9e e4d41522

+25 -6
+10 -5
pkgs/applications/science/electronics/systemc/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, autoreconfHook }: 1 + { lib, stdenv, fetchFromGitHub, cmake }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "systemc"; ··· 11 11 sha256 = "0sj8wlkp68cjhmkd9c9lvm3lk3sckczpz7w9vby64inc1f9fnf0b"; 12 12 }; 13 13 14 - enableParallelBuilding = true; 15 - nativeBuildInputs = [ autoreconfHook ]; 14 + nativeBuildInputs = [ cmake ]; 15 + 16 + cmakeFlags = [ 17 + # Undefined reference to the sc_core::sc_api_version_2_3_4_XXX 18 + # https://github.com/accellera-official/systemc/issues/21 19 + "-DCMAKE_CXX_STANDARD=17" 20 + ]; 16 21 17 - configureFlags = [ "--with-unix-layout" ]; 22 + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; 18 23 19 24 meta = with lib; { 20 25 description = "The language for System-level design, modeling and verification"; 21 26 homepage = "https://systemc.org/"; 22 27 license = licenses.asl20; 23 - platforms = platforms.linux; 28 + platforms = platforms.unix; 24 29 maintainers = with maintainers; [ victormignot amiloradovsky ]; 25 30 }; 26 31 }
+15 -1
pkgs/applications/science/electronics/verilator/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, perl, flex, bison, python3, autoconf, 1 + { lib, stdenv, fetchFromGitHub, fetchpatch, perl, flex, bison, python3, autoconf, 2 2 which, cmake, ccache, help2man, makeWrapper, glibcLocales, 3 3 systemc, git, numactl }: 4 4 ··· 13 13 hash = "sha256-Ya3lqK8BfvMVLZUrD2Et6OmptteWXp5VmZb2x2G/V/E="; 14 14 }; 15 15 16 + patches = [ 17 + (fetchpatch { 18 + # Fix try-lock spuriously fail in V3ThreadPool destructor 19 + # https://github.com/verilator/verilator/pull/4938 20 + url = "https://github.com/verilator/verilator/commit/4b9cce4369c78423779238e585ed693c456d464e.patch"; 21 + hash = "sha256-sGrk/pxqZqUcmJdzQoPlzXMmYqHCOmd9Y2n6ieVNg1U="; 22 + }) 23 + ]; 24 + 16 25 enableParallelBuilding = true; 17 26 buildInputs = [ perl python3 systemc ]; # ccache 18 27 nativeBuildInputs = [ makeWrapper flex bison autoconf help2man git ]; ··· 36 45 wrapProgram "$x" --set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive" 37 46 done 38 47 ''; 48 + 49 + env = { 50 + SYSTEMC_INCLUDE = "${lib.getDev systemc}/include"; 51 + SYSTEMC_LIBDIR = "${lib.getLib systemc}/lib"; 52 + }; 39 53 40 54 meta = with lib; { 41 55 description = "Fast and robust (System)Verilog simulator/compiler and linter";