diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-06-11 20:12:29 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-06-11 20:12:29 -0600 |
| commit | 07bf05a7869c88c27912833c1db942f8fc849f4d (patch) | |
| tree | b32a11e146884bcee04ef2dd5702b45e89699424 /pkgs/force-riscv/default.nix | |
| parent | 905a306a705fc7bf9f0d03945bfe692c530dd05e (diff) | |
pkgs: add existing derivations written for other projects
Diffstat (limited to 'pkgs/force-riscv/default.nix')
| -rw-r--r-- | pkgs/force-riscv/default.nix | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/pkgs/force-riscv/default.nix b/pkgs/force-riscv/default.nix new file mode 100644 index 0000000..35907ce --- /dev/null +++ b/pkgs/force-riscv/default.nix @@ -0,0 +1,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/ + ''; +} |
