From 08938e24b14c26fb0917c4600dc04a8efa3a8576 Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Thu, 15 Sep 2022 15:35:46 +0100 Subject: [PATCH 01/14] Add GenericNerdyUsername to maintainer-list.nix --- maintainers/maintainer-list.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 6431ef96fc59..857679feb546 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -5263,6 +5263,15 @@ githubId = 313929; name = "Gabriel Ebner"; }; + genericnerdyusername = { + name = "GenericNerdyUsername"; + email = "genericnerdyusername@proton.me"; + github = "GenericNerdyUsername"; + githubId = 111183546; + keys = [{ + fingerprint = "58CE D4BE 6B10 149E DA80 A990 2F48 6356 A4CB 30F3"; + }]; + }; genofire = { name = "genofire"; email = "geno+dev@fireorbit.de"; From cce639c6de1e3c824930076f23fafec12ae5c8b8 Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Thu, 26 Jan 2023 15:13:20 +0000 Subject: [PATCH 02/14] python3Packages.tcolorpy: init at 0.1.2 --- .../python-modules/tcolorpy/default.nix | 26 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/development/python-modules/tcolorpy/default.nix diff --git a/pkgs/development/python-modules/tcolorpy/default.nix b/pkgs/development/python-modules/tcolorpy/default.nix new file mode 100644 index 000000000000..d31fb3683ef4 --- /dev/null +++ b/pkgs/development/python-modules/tcolorpy/default.nix @@ -0,0 +1,26 @@ +{ buildPythonPackage +, fetchFromGitHub +, lib +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "tcolorpy"; + version = "0.1.2"; + + src = fetchFromGitHub { + owner = "thombashi"; + repo = pname; + rev = "v${version}"; + hash = "sha256-duMbeKygEuGVcg4+gQRfClww3rs5AsmJR1VQBo7KWFY="; + }; + + nativeCheckInputs = [ pytestCheckHook ]; + + meta = with lib; { + homepage = "https://github.com/thombashi/tcolorpy"; + description = "A library to apply true color for terminal text"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c672707b90ef..0e39c1845538 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11234,6 +11234,8 @@ self: super: with self; { tbm-utils = callPackage ../development/python-modules/tbm-utils { }; + tcolorpy = callPackage ../development/python-modules/tcolorpy { }; + tcxparser = callPackage ../development/python-modules/tcxparser { }; tcxreader = callPackage ../development/python-modules/tcxreader { }; From 6d3840a67f7aea63462af0ef1fa9e162bcf7f09b Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Thu, 26 Jan 2023 14:59:05 +0000 Subject: [PATCH 03/14] python3Packages.typepy: init at 1.3.0 --- .../python-modules/typepy/default.nix | 34 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/python-modules/typepy/default.nix diff --git a/pkgs/development/python-modules/typepy/default.nix b/pkgs/development/python-modules/typepy/default.nix new file mode 100644 index 000000000000..b0a505e3205b --- /dev/null +++ b/pkgs/development/python-modules/typepy/default.nix @@ -0,0 +1,34 @@ +{ buildPythonPackage +, fetchFromGitHub +, lib +, mbstrdecoder +, python-dateutil +, pytz +, packaging +, pytestCheckHook +, tcolorpy +}: + +buildPythonPackage rec { + pname = "typepy"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "thombashi"; + repo = pname; + rev = "v${version}"; + hash = "sha256-J6SgVd2m0wOVr2ZV/pryRcJrn+BYTGstAUQO349c2lE="; + }; + + propagatedBuildInputs = [ mbstrdecoder python-dateutil pytz packaging ]; + + nativeCheckInputs = [ pytestCheckHook ]; + checkInputs = [ tcolorpy ]; + + meta = with lib; { + homepage = "https://github.com/thombashi/typepy"; + description = "A library for variable type checker/validator/converter at a run time"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0e39c1845538..22e2b6a2aec7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11764,6 +11764,8 @@ self: super: with self; { typeguard = callPackage ../development/python-modules/typeguard { }; + typepy = callPackage ../development/python-modules/typepy { }; + typer = callPackage ../development/python-modules/typer { }; types-colorama = callPackage ../development/python-modules/types-colorama { }; From 032d4bbc8856850c40304f19b4806a53da786dfc Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Thu, 26 Jan 2023 13:40:33 +0000 Subject: [PATCH 04/14] python3Packages.mbstrdecoder: init at 1.1.1 --- .../python-modules/mbstrdecoder/default.nix | 31 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/python-modules/mbstrdecoder/default.nix diff --git a/pkgs/development/python-modules/mbstrdecoder/default.nix b/pkgs/development/python-modules/mbstrdecoder/default.nix new file mode 100644 index 000000000000..59914caf8008 --- /dev/null +++ b/pkgs/development/python-modules/mbstrdecoder/default.nix @@ -0,0 +1,31 @@ +{ buildPythonPackage +, fetchFromGitHub +, lib +, chardet +, pytestCheckHook +, faker +}: + +buildPythonPackage rec { + pname = "mbstrdecoder"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "thombashi"; + repo = pname; + rev = "v${version}"; + hash = "sha256-U8F+mWKDulIRvvhswmdGnxKjM2qONQybViQ5TLZbLDY="; + }; + + propagatedBuildInputs = [ chardet ]; + + nativeCheckInputs = [ pytestCheckHook ]; + checkInputs = [ faker ]; + + meta = with lib; { + homepage = "https://github.com/thombashi/mbstrdecoder"; + description = "A library for decoding multi-byte character strings"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 22e2b6a2aec7..bfd16ad5c9d7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5770,6 +5770,8 @@ self: super: with self; { mbddns = callPackage ../development/python-modules/mbddns { }; + mbstrdecoder = callPackage ../development/python-modules/mbstrdecoder { }; + mccabe = callPackage ../development/python-modules/mccabe { }; mcstatus = callPackage ../development/python-modules/mcstatus { }; From 6b1a62aab0fca0906e728c01db20152a5bc7eab9 Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Thu, 26 Jan 2023 15:45:16 +0000 Subject: [PATCH 05/14] python3Packages.dataproperty: init at 0.55.0 --- .../python-modules/dataproperty/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/dataproperty/default.nix diff --git a/pkgs/development/python-modules/dataproperty/default.nix b/pkgs/development/python-modules/dataproperty/default.nix new file mode 100644 index 000000000000..af221199c910 --- /dev/null +++ b/pkgs/development/python-modules/dataproperty/default.nix @@ -0,0 +1,39 @@ +{ buildPythonPackage +, fetchFromGitHub +, lib +, mbstrdecoder +, typepy +, pytestCheckHook +, termcolor +}: + +buildPythonPackage rec { + pname = "dataproperty"; + version = "0.55.0"; + + src = fetchFromGitHub { + owner = "thombashi"; + repo = pname; + rev = "v${version}"; + hash = "sha256-ODSrKZ8M/ni9r2gkVIKWaKkdr+3AVi4INkEKJ+cmb44="; + }; + + propagatedBuildInputs = [ mbstrdecoder typepy ]; + + nativeCheckInputs = [ pytestCheckHook ]; + checkInputs = [ termcolor ]; + + # Tests fail, even on non-nixos + pytestFlagsArray = [ + "--deselect test/test_dataproperty.py::Test_DataPeroperty_len::test_normal_ascii_escape_sequence" + "--deselect test/test_dataproperty.py::Test_DataPeroperty_is_include_ansi_escape::test_normal" + "--deselect test/test_dataproperty.py::Test_DataPeroperty_repr::test_normal" + ]; + + meta = with lib; { + homepage = "https://github.com/thombashi/dataproperty"; + description = "A library for extracting properties from data"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bfd16ad5c9d7..a98175699a84 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2241,6 +2241,8 @@ self: super: with self; { datapoint = callPackage ../development/python-modules/datapoint { }; + dataproperty = callPackage ../development/python-modules/dataproperty { }; + dataset = callPackage ../development/python-modules/dataset { }; datasets = callPackage ../development/python-modules/datasets { }; From ce6fde7abddda5adc69e408439037c030b1b18ae Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Thu, 26 Jan 2023 19:26:11 +0000 Subject: [PATCH 06/14] python3Packages.tabledata: init at 1.3.0 --- .../python-modules/tabledata/default.nix | 30 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/python-modules/tabledata/default.nix diff --git a/pkgs/development/python-modules/tabledata/default.nix b/pkgs/development/python-modules/tabledata/default.nix new file mode 100644 index 000000000000..7b9a8977a928 --- /dev/null +++ b/pkgs/development/python-modules/tabledata/default.nix @@ -0,0 +1,30 @@ +{ buildPythonPackage +, fetchFromGitHub +, lib +, dataproperty +, typepy +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "tabledata"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "thombashi"; + repo = pname; + rev = "v${version}"; + hash = "sha256-6Nkdc32cp9wbmw7cnBn5VAJKfqxNunyxExuZ9b+qWNY="; + }; + + propagatedBuildInputs = [ dataproperty typepy ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + meta = with lib; { + homepage = "https://github.com/thombashi/tabledata"; + description = "A library to represent tabular data"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a98175699a84..67d0a24c48e4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11200,6 +11200,8 @@ self: super: with self; { tableaudocumentapi = callPackage ../development/python-modules/tableaudocumentapi { }; + tabledata = callPackage ../development/python-modules/tabledata { }; + tables = callPackage ../development/python-modules/tables { }; tablib = callPackage ../development/python-modules/tablib { }; From 14f7b52785a157345a759cf8bd91e8b79dcc5230 Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Thu, 26 Jan 2023 19:26:34 +0000 Subject: [PATCH 07/14] python3Packages.pytablewriter: init at 0.64.2 --- .../python-modules/pytablewriter/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/pytablewriter/default.nix diff --git a/pkgs/development/python-modules/pytablewriter/default.nix b/pkgs/development/python-modules/pytablewriter/default.nix new file mode 100644 index 000000000000..07461e06a298 --- /dev/null +++ b/pkgs/development/python-modules/pytablewriter/default.nix @@ -0,0 +1,57 @@ +{ buildPythonPackage +, fetchFromGitHub +, lib +, dataproperty +, mbstrdecoder +, pathvalidate +, setuptools +, tabledata +, tcolorpy +, typepy +, pytestCheckHook +, pyyaml +, toml +, elasticsearch +, dominate +}: + +buildPythonPackage rec { + pname = "pytablewriter"; + version = "0.64.2"; + + src = fetchFromGitHub { + owner = "thombashi"; + repo = pname; + rev = "v${version}"; + hash = "sha256-+IOHnmdd9g3SoHyITJJtbJ0/SAAmwWmwX5XeqsO34EM="; + }; + + propagatedBuildInputs = [ + dataproperty + mbstrdecoder + pathvalidate + tabledata + tcolorpy + typepy + ]; + + checkInputs = [ pyyaml toml elasticsearch dominate ]; + nativeCheckInputs = [ pytestCheckHook ]; + # Circular dependency + disabledTests = [ + "test_normal_from_file" + "test_normal_from_text" + "test_normal_clear_theme" + ]; + disabledTestPaths = [ + "test/writer/binary/test_excel_writer.py" + "test/writer/binary/test_sqlite_writer.py" + ]; + + meta = with lib; { + homepage = "https://github.com/thombashi/pytablewriter"; + description = "A library to write a table in various formats"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 67d0a24c48e4..653a30a0ea76 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8941,6 +8941,8 @@ self: super: with self; { pytabix = callPackage ../development/python-modules/pytabix { }; + pytablewriter = callPackage ../development/python-modules/pytablewriter { }; + pytado = callPackage ../development/python-modules/pytado { }; pytaglib = callPackage ../development/python-modules/pytaglib { }; From 8e11bd3d05ad56ec1da81d9f383365ab4ea71d56 Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Thu, 26 Jan 2023 19:58:43 +0000 Subject: [PATCH 08/14] python3Packages.riscv-isac: init at 0.16.1 --- .../python-modules/riscv-isac/default.nix | 44 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 46 insertions(+) create mode 100644 pkgs/development/python-modules/riscv-isac/default.nix diff --git a/pkgs/development/python-modules/riscv-isac/default.nix b/pkgs/development/python-modules/riscv-isac/default.nix new file mode 100644 index 000000000000..98fff40285b2 --- /dev/null +++ b/pkgs/development/python-modules/riscv-isac/default.nix @@ -0,0 +1,44 @@ +{ buildPythonPackage +, fetchFromGitHub +, lib +, click +, colorlog +, gitpython +, pyelftools +, pytablewriter +, pytest +, pyyaml +, ruamel-yaml +}: + +buildPythonPackage rec { + pname = "riscv-isac"; + version = "0.16.1"; + + src = fetchFromGitHub { + owner = "riscv-software-src"; + repo = pname; + rev = version; + hash = "sha256-Krjr9bvpoOeNfMbYj/QbJ+Y+AVLjwrzj8KKMUXCfnMA="; + }; + + postPatch = "substituteInPlace riscv_isac/requirements.txt --replace 'pyelftools==0.26' pyelftools"; + + propagatedBuildInputs = [ + click + colorlog + gitpython + pyelftools + pytablewriter + pytest + pyyaml + ruamel-yaml + ]; + + meta = with lib; { + homepage = "https://github.com/riscv/riscv-isac"; + description = "An ISA coverage extraction tool"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = licenses.bsd3; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 653a30a0ea76..df697f14134a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10057,6 +10057,8 @@ self: super: with self; { ripser = callPackage ../development/python-modules/ripser { }; + riscv-isac = callPackage ../development/python-modules/riscv-isac { }; + rising = callPackage ../development/python-modules/rising { }; ritassist = callPackage ../development/python-modules/ritassist { }; From 0e6fa5a27b9ccc4e6a5512011fb4c690aa3083e8 Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Fri, 27 Jan 2023 13:11:57 +0000 Subject: [PATCH 09/14] python3Packages.riscv-config: init at 3.5.0 --- .../python-modules/riscv-config/default.nix | 28 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/development/python-modules/riscv-config/default.nix diff --git a/pkgs/development/python-modules/riscv-config/default.nix b/pkgs/development/python-modules/riscv-config/default.nix new file mode 100644 index 000000000000..fdfd6741f6e2 --- /dev/null +++ b/pkgs/development/python-modules/riscv-config/default.nix @@ -0,0 +1,28 @@ +{ buildPythonPackage +, fetchFromGitHub +, lib +, cerberus +, pyyaml +, ruamel-yaml +}: + +buildPythonPackage rec { + pname = "riscv-config"; + version = "3.5.0"; + + src = fetchFromGitHub { + owner = "riscv-software-src"; + repo = pname; + rev = version; + hash = "sha256-HKmHrvOF4OOzoILrBJG46UOKow5gRxMcXXiI6f34dPc="; + }; + + propagatedBuildInputs = [ cerberus pyyaml ruamel-yaml ]; + + meta = with lib; { + homepage = "https://github.com/riscv/riscv-config"; + description = "RISC-V configuration validator"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = licenses.bsd3; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index df697f14134a..497eca8e8b68 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10057,6 +10057,8 @@ self: super: with self; { ripser = callPackage ../development/python-modules/ripser { }; + riscv-config = callPackage ../development/python-modules/riscv-config { }; + riscv-isac = callPackage ../development/python-modules/riscv-isac { }; rising = callPackage ../development/python-modules/rising { }; From 7ff1dcdf744a3bb7c41780b3902b25ba15cb1416 Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Fri, 27 Jan 2023 13:25:17 +0000 Subject: [PATCH 10/14] ocamlPackages.lem: init at 2022-12-10 --- .../development/ocaml-modules/lem/default.nix | 45 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/ocaml-modules/lem/default.nix diff --git a/pkgs/development/ocaml-modules/lem/default.nix b/pkgs/development/ocaml-modules/lem/default.nix new file mode 100644 index 000000000000..39952366dbac --- /dev/null +++ b/pkgs/development/ocaml-modules/lem/default.nix @@ -0,0 +1,45 @@ +{ stdenv +, fetchFromGitHub +, lib +, ncurses +, makeWrapper +, ocamlbuild +, findlib +, ocaml +, num +, zarith +}: + +lib.throwIfNot (lib.versionAtLeast ocaml.version "4.07") + "lem is not available for OCaml ${ocaml.version}" + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-lem"; + version = "2022-12-10"; + + src = fetchFromGitHub { + owner = "rems-project"; + repo = "lem"; + rev = version; + hash = "sha256-ZQgcuIVRkJS0KtpzjbO4OPHGg6B0TadWA6XpRir30y8="; + }; + + nativeBuildInputs = [ makeWrapper ocamlbuild findlib ocaml ]; + propagatedBuildInputs = [ zarith num ]; + + installFlags = [ "INSTALL_DIR=$(out)" ]; + + createFindlibDestdir = true; + + postInstall = '' + wrapProgram $out/bin/lem --set LEMLIB $out/share/lem/library + ''; + + meta = with lib; { + homepage = "https://github.com/rems-project/lem"; + description = "A tool for lightweight executable mathematics"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = with licenses; [ bsd3 gpl2 ]; + platforms = ocaml.meta.platforms; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 77580b9a32f0..6c70185c0cbc 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -743,6 +743,8 @@ let lastfm = callPackage ../development/ocaml-modules/lastfm { }; + lem = callPackage ../development/ocaml-modules/lem { }; + lens = callPackage ../development/ocaml-modules/lens { }; letsencrypt = callPackage ../development/ocaml-modules/letsencrypt { }; From 8205f9ac2f9153b1622c393628f8833d99637b1c Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Fri, 27 Jan 2023 13:41:00 +0000 Subject: [PATCH 11/14] ocamlPackages.linksem: init at 0.8 --- .../ocaml-modules/linksem/default.nix | 36 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/ocaml-modules/linksem/default.nix diff --git a/pkgs/development/ocaml-modules/linksem/default.nix b/pkgs/development/ocaml-modules/linksem/default.nix new file mode 100644 index 000000000000..751f4e14a2d3 --- /dev/null +++ b/pkgs/development/ocaml-modules/linksem/default.nix @@ -0,0 +1,36 @@ +{ lib +, fetchFromGitHub +, stdenv +, findlib +, ocaml +, lem +}: + +lib.throwIfNot (lib.versionAtLeast ocaml.version "4.07") + "linksem is not available for OCaml ${ocaml.version}" + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-linksem"; + version = "0.8"; + + src = fetchFromGitHub { + owner = "rems-project"; + repo = "linksem"; + rev = version; + hash = "sha256-7/YfDK3TruKCckMzAPLRrwBkHRJcX1S+AzXHWRxkZPA="; + }; + + nativeBuildInputs = [ findlib ocaml ]; + + propagatedBuildInputs = [ lem ]; + + createFindlibDestdir = true; + + meta = with lib; { + homepage = "https://github.com/rems-project/linksem"; + description = "A formalisation of substantial parts of ELF linking and DWARF debug information"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = licenses.bsd2; + platforms = ocaml.meta.platforms; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 6c70185c0cbc..145203e837bd 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -759,6 +759,8 @@ let linenoise = callPackage ../development/ocaml-modules/linenoise { }; + linksem = callPackage ../development/ocaml-modules/linksem { }; + llvm = callPackage ../development/ocaml-modules/llvm { libllvm = pkgs.llvmPackages_10.libllvm; }; From fc50807657bc1820e2a857f5d67c97a273523a5e Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Fri, 27 Jan 2023 14:03:33 +0000 Subject: [PATCH 12/14] ocamlPackages.sail: init at 0.15 --- .../ocaml-modules/sail/default.nix | 79 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 + 2 files changed, 81 insertions(+) create mode 100644 pkgs/development/ocaml-modules/sail/default.nix diff --git a/pkgs/development/ocaml-modules/sail/default.nix b/pkgs/development/ocaml-modules/sail/default.nix new file mode 100644 index 000000000000..f66abd2bdcf1 --- /dev/null +++ b/pkgs/development/ocaml-modules/sail/default.nix @@ -0,0 +1,79 @@ +{ lib +, fetchFromGitHub +, buildDunePackage +, base64 +, omd +, menhir +, ott +, linenoise +, dune-site +, pprint +, makeWrapper +, lem +, z3 +, linksem +, num +}: + +buildDunePackage rec { + pname = "sail"; + version = "0.15"; + + src = fetchFromGitHub { + owner = "rems-project"; + repo = "sail"; + rev = version; + hash = "sha256-eNdFOSzkniNvSCZeORRJ/IYAu+9P4HSouwmhd4BQLPk="; + }; + + duneVersion = "3"; + minimalOCamlVersion = "4.08"; + + nativeBuildInputs = [ + makeWrapper + ott + menhir + lem + ]; + + propagatedBuildInputs = [ + base64 + omd + dune-site + linenoise + pprint + linksem + ]; + + preBuild = '' + rm -r aarch* # Remove code derived from non-bsd2 arm spec + rm -r snapshots # Some of this might be derived from stuff in the aarch dir, it builds fine without it + ''; + # `buildDunePackage` only builds the [pname] package + # This doesnt work in this case, as sail includes multiple packages in the same source tree + buildPhase = '' + runHook preBuild + dune build --release ''${enableParallelBuild:+-j $NIX_BUILD_CORES} + runHook postBuild + ''; + checkPhase = '' + runHook preCheck + dune runtest ''${enableParallelBuild:+-j $NIX_BUILD_CORES} + runHook postCheck + ''; + installPhase = '' + runHook preInstall + dune install --prefix $out --libdir $OCAMLFIND_DESTDIR + runHook postInstall + ''; + postInstall = '' + wrapProgram $out/bin/sail --set SAIL_DIR $out/share/sail + ''; + + meta = with lib; { + homepage = "https://github.com/rems-project/sail"; + description = "A language for describing the instruction-set architecture (ISA) semantics of processors"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = licenses.bsd2; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 145203e837bd..0e704ce26af8 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1244,6 +1244,8 @@ let rusage = callPackage ../development/ocaml-modules/rusage { }; + sail = callPackage ../development/ocaml-modules/sail { }; + samplerate = callPackage ../development/ocaml-modules/samplerate { }; secp256k1 = callPackage ../development/ocaml-modules/secp256k1 { From 6f2d5c582b489efa2b52585fe8754e18b3fe1ee5 Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Fri, 27 Jan 2023 19:33:58 +0000 Subject: [PATCH 13/14] sail-riscv-*: init at 0.5 --- .../virtualization/sail-riscv/default.nix | 55 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 8 +++ 2 files changed, 63 insertions(+) create mode 100644 pkgs/applications/virtualization/sail-riscv/default.nix diff --git a/pkgs/applications/virtualization/sail-riscv/default.nix b/pkgs/applications/virtualization/sail-riscv/default.nix new file mode 100644 index 000000000000..b952b0f18918 --- /dev/null +++ b/pkgs/applications/virtualization/sail-riscv/default.nix @@ -0,0 +1,55 @@ +{ stdenv +, fetchFromGitHub +, lib +, arch +, ocamlPackages +, ocaml +, zlib +, z3 +}: + + +stdenv.mkDerivation rec { + pname = "sail-riscv"; + version = "0.5"; + + src = fetchFromGitHub { + owner = "riscv"; + repo = pname; + rev = version; + hash = "sha256-7PZNNUMaCZEBf0lOCqkquewRgZPooBOjIbGF7JlLnEo="; + }; + + nativeBuildInputs = with ocamlPackages; [ ocamlbuild findlib ocaml z3 sail ]; + buildInputs = with ocamlPackages; [ zlib linksem ]; + strictDeps = true; + + postPatch = '' + rm -r prover_snapshots + ''; + + makeFlags = [ + "SAIL=sail" + "ARCH=${arch}" + "SAIL_DIR=${ocamlPackages.sail}/share/sail" + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + cp c_emulator/riscv_sim_${arch} $out/bin + mkdir $out/share/ + cp -r generated_definitions/{coq,hol4,isabelle} $out/share/ + + runHook postInstall + ''; + + + meta = with lib; { + homepage = "https://github.com/riscv/sail-riscv"; + description = "A formal specification of the RISC-V architecture, written in Sail"; + maintainers = with maintainers; [ genericnerdyusername ]; + license = licenses.bsd2; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e2ff22c0ad24..9db20e4eacca 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -38112,6 +38112,14 @@ with pkgs; sailsd = callPackage ../misc/sailsd { }; + sail-riscv-rv32 = callPackage ../applications/virtualization/sail-riscv { + arch = "RV32"; + }; + + sail-riscv-rv64 = callPackage ../applications/virtualization/sail-riscv { + arch = "RV64"; + }; + shc = callPackage ../tools/security/shc { }; shellz = callPackage ../tools/security/shellz { }; From 530af6b5b99b2dbdb039c55092ad118a8d35d115 Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Sat, 28 Jan 2023 08:40:48 +0000 Subject: [PATCH 14/14] python3Packages.riscof: init at 1.25.2 --- .../python-modules/riscof/default.nix | 36 +++++++++++++++++++ .../riscof/make_writeable.patch | 25 +++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 3 files changed, 63 insertions(+) create mode 100644 pkgs/development/python-modules/riscof/default.nix create mode 100644 pkgs/development/python-modules/riscof/make_writeable.patch diff --git a/pkgs/development/python-modules/riscof/default.nix b/pkgs/development/python-modules/riscof/default.nix new file mode 100644 index 000000000000..52dce6a15090 --- /dev/null +++ b/pkgs/development/python-modules/riscof/default.nix @@ -0,0 +1,36 @@ +{ 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="; + }; + + postPatch = "substituteInPlace riscof/requirements.txt --replace 'GitPython==3.1.17' GitPython"; + + propagatedBuildInputs = [ riscv-isac riscv-config jinja2 ]; + + patches = [ + # riscof copies a template directory from the store, but breaks because it doesn't change permissions and expects it to be writeable + ./make_writeable.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; + }; +} diff --git a/pkgs/development/python-modules/riscof/make_writeable.patch b/pkgs/development/python-modules/riscof/make_writeable.patch new file mode 100644 index 000000000000..938f9913a7ad --- /dev/null +++ b/pkgs/development/python-modules/riscof/make_writeable.patch @@ -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 : diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 497eca8e8b68..4bf4a0931fe8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10057,6 +10057,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 { };