blob: 35907ce27293868ec981e4e1ecff96df3fb8d688 (
plain)
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
|
{ fetchFromGitHub, lib, makeWrapper, python3, stdenv }:
with lib; stdenv.mkDerivation {
pname = "force-riscv";
version = "master-2023-01-31";
src = fetchFromGitHub {
repo = "force-riscv";
owner = "openhwgroup";
rev = "192bcc15e0dde8aaf25621da4317569b3f374047";
sha256 = "sha256-Eol973IMGRVAuw/rsYiK61+KVYkmbqq9yudaNbMCzJ0=";
};
buildInputs = [ python3 ];
nativeBuildInputs = [ makeWrapper ];
patches = [
./remove-pyeval-initthreads.patch
./wno-error-range-loop-construct.patch
./imageio-include-string.patch
./testio-include-string.patch
./urbg-static-constexpr-min-max.patch
];
postPatch = ''
patchShebangs utils/ fpix/utils/
'';
makeFlags = [
"FORCE_CC=${stdenv.cc.targetPrefix}c++"
"FORCE_PYTHON_LIB=${python3}/lib"
"FORCE_PYTHON_INC=${python3}/include/${python3.libPrefix}"
];
# Ver setenv.bash
installPhase =
let
paths = [
"3rd_party/py"
"utils"
"utils/builder"
"utils/builder/test_builder"
"utils/builder/shared"
"utils/regression"
];
pythonPath = concatStringsSep ":" (map (p: "$out/${p}") paths);
in
''
mkdir -p $out/ $out/fpix/ $out/riscv/ $out/3rd_party/
# SimApiHANDCAR.so queda en bin (?), al parecer es así
cp -r bin/ py/ $out/
cp -r fpix/bin/ $out/fpix/
for BIN in $out/bin/friscv $out/fpix/bin/fpix_riscv; do
wrapProgram $BIN \
--prefix PYTHONPATH : ${pythonPath}
done
rm -r utils/handcar/make_area
cp -r 3rd_party/py/ $out/3rd_party/
cp -r config/ utils/ $out/
cp -r riscv/arch_data/ $out/riscv/
'';
}
|