Repository navigation
Expand file tree
/
Copy pathdefault.nix
More file actions
162 lines (146 loc) · 3.54 KB
/
Copy pathdefault.nix
File metadata and controls
162 lines (146 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
{
lib,
stdenv,
# nativeBuildInputs
bison,
cmake,
doxygen,
flex,
gitMinimal,
gtest,
libsForQt5,
pkg-config,
swig,
# buildInputs
boost186, # 1.87.0 broken https://github.com/boostorg/asio/issues/442
cbc, # for clp
cimg,
clp, # for or-tools
cudd,
gperftools,
eigen,
glpk,
lcov,
lemon-graph,
libjpeg,
or-tools,
pcre,
python3,
re2, # for or-tools
readline,
spdlog,
tcl,
tclPackages,
yosys,
zlib,
xorg,
llvmPackages,
yaml-cpp,
}:
stdenv.mkDerivation {
pname = "Sizer";
version = "0.1.0-alpha.1";
src = with lib.fileset; toSource {
root = ./.;
fileset = unions [
./cmake
./etc
./src
./submit
./test
./tests
./thirdparty
./CMakeLists.txt
./LICENSE
./README.md
./NOTICE
];
};
nativeBuildInputs = [
bison
cmake
doxygen
flex
gitMinimal
gtest
libsForQt5.wrapQtAppsHook
pkg-config
swig
];
buildInputs = [
boost186
cbc
cimg
clp
cudd
gperftools
eigen
glpk
lcov
lemon-graph
libjpeg
libsForQt5.qtbase
libsForQt5.qtcharts
libsForQt5.qtdeclarative
libsForQt5.qtsvg
or-tools
pcre
python3
re2
readline
spdlog
tcl
tclPackages.tclreadline
yosys
zlib
yaml-cpp
]
++ lib.optionals stdenv.hostPlatform.isLinux [ xorg.libX11 ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ];
postPatch = ''
patchShebangs --build etc/find_messages.py
patchShebangs --build etc/file_to_string.py
# Fix shebangs in thirdparty/OpenROAD
patchShebangs --build thirdparty/OpenROAD/etc/find_messages.py
patchShebangs --build thirdparty/OpenROAD/etc/file_to_string.py
# Build-time asset embedding scripts invoked directly by CMake.
patchShebangs --build thirdparty/OpenROAD/src/web/src
# Disable two tests that are failing curently.
sed 's/^.*partition_gcd/# \0/g' -i thirdparty/OpenROAD/src/par/test/CMakeLists.txt
# Fix TCL include path expectations
sed -i 's,<tcl8.6/,<,g' src/ckt.cpp src/analyze_timing.cpp src/lib_parser.cpp
'';
cmakeFlags = [
(lib.cmakeBool "ENABLE_TESTS" true)
(lib.cmakeBool "USE_SYSTEM_BOOST" true)
(lib.cmakeBool "USE_SYSTEM_ABC" false)
(lib.cmakeBool "ABC_SKIP_TESTS" true) # it attempts to download gtest
# The project forces BUILD_SYN=OFF, so OpenROAD's syn_py target
# never exists while its Python module list still references it,
# which breaks linking with -lsyn_py. Match the CI build and skip
# Python bindings entirely.
(lib.cmakeBool "BUILD_PYTHON" false)
(lib.cmakeBool "USE_SYSTEM_OPENSTA" false)
(lib.cmakeFeature "OPENROAD_VERSION" "v0.1.0-alpha")
(lib.cmakeBool "CMAKE_RULE_MESSAGES" false)
(lib.cmakeFeature "TCL_HEADER" "${tcl}/include/tcl.h")
(lib.cmakeFeature "TCL_LIBRARY" "${tcl}/lib/libtcl${stdenv.hostPlatform.extensions.sharedLibrary}")
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
(lib.cmakeFeature "CMAKE_CXX_FLAGS" "-DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED")
];
# Resynthesis needs access to the Yosys binaries.
qtWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ yosys ]}" ];
enableParallelBuilding = true;
doCheck = false;
doInstallCheck = false;
meta = {
license = lib.licenses.bsd3;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with lib.maintainers; [
trepetti
hzeller
Emin017
]; # https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/op/openroad/package.nix
};
}