1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools-rust,
6 rustPlatform,
7 cargo,
8 rustc,
9 autoPatchelfHook,
10 pkg-config,
11 llvmPackages_15,
12 libxml2,
13 ncurses,
14 zlib,
15}:
16
17buildPythonPackage rec {
18 pname = "verilogae";
19 version = "1.0.0";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "pascalkuthe";
24 repo = "OpenVAF";
25 rev = "VerilogAE-v${version}";
26 hash = "sha256-TILKKmgSyhyxp88sdflDXAoH++iP6CMpdoXN1/1fsjU=";
27 };
28
29 postPatch = ''
30 substituteInPlace openvaf/llvm/src/initialization.rs \
31 --replace-fail "i8" "libc::c_char"
32 substituteInPlace openvaf/osdi/build.rs \
33 --replace-fail "-fPIC" ""
34 '';
35
36 cargoDeps = rustPlatform.importCargoLock {
37 lockFile = ./Cargo.lock;
38 outputHashes = {
39 "salsa-0.17.0-pre.2" = "sha256-6GssvV76lFr5OzAUekz2h6f82Tn7usz5E8MSZ5DmgJw=";
40 };
41 };
42
43 nativeBuildInputs = [
44 setuptools-rust
45 rustPlatform.cargoSetupHook
46 rustPlatform.bindgenHook
47 cargo
48 rustc
49 autoPatchelfHook
50 pkg-config
51 llvmPackages_15.clang
52 llvmPackages_15.llvm
53 ];
54
55 buildInputs = [
56 libxml2.dev
57 llvmPackages_15.libclang
58 ncurses
59 zlib
60 ];
61
62 cargoBuildType = "release";
63
64 pythonImportsCheck = [ "verilogae" ];
65
66 hardeningDisable = [ "pic" ];
67
68 meta = {
69 description = "Verilog-A tool useful for compact model parameter extraction";
70 homepage = "https://man.sr.ht/~dspom/openvaf_doc/verilogae/";
71 license = lib.licenses.gpl3Only;
72 maintainers = with lib.maintainers; [
73 jasonodoom
74 jleightcap
75 ];
76 platforms = lib.platforms.linux;
77 sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
78 };
79}