Skip to content

Commit

Permalink
python3Packages.riscof: init at 1.25.2
Browse files Browse the repository at this point in the history
  • Loading branch information
GenericNerdyUsername committed Feb 3, 2023
1 parent 42452b1 commit 3956209
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
31 changes: 31 additions & 0 deletions pkgs/development/python-modules/riscof/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ buildPythonPackage
, fetchFromGitHub
, lib
, git
, riscv-isac
, riscv-config
, jinja2
}:

buildPythonPackage rec {
pname = "riscof";
version = "1.25.2";

src = fetchFromGitHub {
owner = "riscv-software-src";
repo = pname;
rev = "1.25.2";
hash = "sha256-6jiKBGj4NN038/qq3ze+L0MYpQEEaN5xt4CTWu0i4qs=";
};

propagatedBuildInputs = [ riscv-isac riscv-config jinja2 ];

patches = [ ./make_writeable.patch ./gitpython-version.patch ];

meta = with lib; {
homepage = "https://github.com/riscv-software-src/riscof";
description = "RISC-V Architectural Test Framework";
maintainers = with maintainers; [ genericnerdyusername ];
license = licenses.bsd3;
};
}
10 changes: 10 additions & 0 deletions pkgs/development/python-modules/riscof/gitpython-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/riscof/requirements.txt b/riscof/requirements.txt
index 6fc0519..da51ab3 100644
--- a/riscof/requirements.txt
+++ b/riscof/requirements.txt
@@ -1,4 +1,4 @@
-GitPython==3.1.17
+GitPython
click>=7.1.2
Jinja2>=2.10.1
pytz>=2019.1
25 changes: 25 additions & 0 deletions pkgs/development/python-modules/riscof/make_writeable.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/riscof/cli.py b/riscof/cli.py
index 26af62e..9d0ddbf 100644
--- a/riscof/cli.py
+++ b/riscof/cli.py
@@ -502,6 +502,7 @@ def setup(dutname,refname,work_dir):
src = os.path.join(constants.root, "Templates/setup/model/")
dest = os.path.join(cwd, dutname)
distutils.dir_util.copy_tree(src, dest)
+ os.system(f"chmod +w -R '{dest}'")

os.rename(cwd+'/'+dutname+'/model_isa.yaml',
cwd+'/'+dutname+'/'+dutname+'_isa.yaml')
@@ -525,10 +526,12 @@ def setup(dutname,refname,work_dir):
src = os.path.join(constants.root, "Templates/setup/sail_cSim/")
dest = os.path.join(cwd, refname)
distutils.dir_util.copy_tree(src, dest)
+ os.system(f"chmod +w -R '{dest}'")
else:
src = os.path.join(constants.root, "Templates/setup/reference/")
dest = os.path.join(cwd, refname)
distutils.dir_util.copy_tree(src, dest)
+ os.system(f"chmod +w -R '{dest}'")
os.rename(cwd+'/'+refname+'/riscof_model.py',
cwd+'/'+refname+'/riscof_'+refname+'.py')
with open(cwd+'/'+refname+'/riscof_'+refname+'.py', 'r') as file :
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10044,6 +10044,8 @@ self: super: with self; {

ripser = callPackage ../development/python-modules/ripser { };

riscof = callPackage ../development/python-modules/riscof { };

riscv-config = callPackage ../development/python-modules/riscv-config { };

riscv-isac = callPackage ../development/python-modules/riscv-isac { };
Expand Down

0 comments on commit 3956209

Please sign in to comment.