Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.riscof: init 1.25.2 #213832

Merged
merged 14 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
55 changes: 55 additions & 0 deletions pkgs/applications/virtualization/sail-riscv/default.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}
45 changes: 45 additions & 0 deletions pkgs/development/ocaml-modules/lem/default.nix
Original file line number Diff line number Diff line change
@@ -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 {
NickCao marked this conversation as resolved.
Show resolved Hide resolved
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;
};
NickCao marked this conversation as resolved.
Show resolved Hide resolved
}
36 changes: 36 additions & 0 deletions pkgs/development/ocaml-modules/linksem/default.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}
79 changes: 79 additions & 0 deletions pkgs/development/ocaml-modules/sail/default.nix
Original file line number Diff line number Diff line change
@@ -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
'';
Comment on lines +54 to +71
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in previous reviews, these manual overrides might not be needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build fails without them, as the default buildDunePackage only builds the [pname] package, but sail includes multiple packages in one source tree

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment about this, so future reviewers understand the intention of doing so on first sight.


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;
};
}
39 changes: 39 additions & 0 deletions pkgs/development/python-modules/dataproperty/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ buildPythonPackage
, fetchFromGitHub
, lib
, mbstrdecoder
, typepy
, pytestCheckHook
, termcolor
}:

buildPythonPackage rec {
pname = "dataproperty";
version = "0.55.0";

src = fetchFromGitHub {
NickCao marked this conversation as resolved.
Show resolved Hide resolved
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;
};
}
31 changes: 31 additions & 0 deletions pkgs/development/python-modules/mbstrdecoder/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ buildPythonPackage
, fetchFromGitHub
, lib
, chardet
, pytestCheckHook
, faker
}:

buildPythonPackage rec {
pname = "mbstrdecoder";
version = "1.1.1";

src = fetchFromGitHub {
NickCao marked this conversation as resolved.
Show resolved Hide resolved
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;
};
}
57 changes: 57 additions & 0 deletions pkgs/development/python-modules/pytablewriter/default.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}
Loading