diff --git a/pkgs/by-name/c-/c-siphash/package.nix b/pkgs/by-name/c-/c-siphash/package.nix new file mode 100644 index 000000000000..442d863c710c --- /dev/null +++ b/pkgs/by-name/c-/c-siphash/package.nix @@ -0,0 +1,43 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchpatch, + meson, + pkg-config, + ninja, + c-stdaux, +}: + +stdenv.mkDerivation rec { + pname = "c-siphash"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "c-util"; + repo = "c-siphash"; + tag = "v${version}"; + hash = "sha256-S5eAlLR6p0Tpd6aYPGGGOH1sCGOyflVyhICi2pYt/8U="; + }; + + nativeBuildInputs = [ + meson + pkg-config + ninja + ]; + + propagatedBuildInputs = [ c-stdaux ]; + + doCheck = true; + + meta = { + homepage = "https://github.com/c-util/c-siphash"; + description = "Streaming-capable SipHash Implementation"; + changelog = "https://github.com/c-util/c-siphash/releases/tag/${src.tag}"; + license = with lib.licenses; [ + asl20 + lgpl2Plus + ]; + maintainers = with lib.maintainers; [ qbisi ]; + }; +} diff --git a/pkgs/by-name/c-/c-stdaux/package.nix b/pkgs/by-name/c-/c-stdaux/package.nix new file mode 100644 index 000000000000..6f77d3486207 --- /dev/null +++ b/pkgs/by-name/c-/c-stdaux/package.nix @@ -0,0 +1,39 @@ +{ + lib, + stdenv, + fetchFromGitHub, + meson, + ninja, +}: + +stdenv.mkDerivation rec { + pname = "c-stdaux"; + version = "1.5.0"; + + src = fetchFromGitHub { + owner = "c-util"; + repo = "c-stdaux"; + tag = "v${version}"; + hash = "sha256-MsnuEyVCmOIr/q6I1qyPsNXp48jxIEcXoYLHbOAZtW0="; + }; + + nativeBuildInputs = [ + meson + ninja + ]; + + # Assertion failed: (false && "!__builtin_constant_p(c_align_to(16, non_constant_expr ? 8 : 16))"), + # function test_basic_gnuc, file ../src/test-basic.c, line 548. + doCheck = !stdenv.hostPlatform.isDarwin; + + meta = { + homepage = "https://github.com/c-util/c-stdaux"; + description = "Auxiliary macros and functions for the C standard library"; + changelog = "https://github.com/c-util/c-stdaux/releases/tag/${src.tag}"; + license = with lib.licenses; [ + asl20 + lgpl2Plus + ]; + maintainers = with lib.maintainers; [ qbisi ]; + }; +} diff --git a/pkgs/development/python-modules/pytools/default.nix b/pkgs/development/python-modules/pytools/default.nix index af359bda26b2..def5b583843a 100644 --- a/pkgs/development/python-modules/pytools/default.nix +++ b/pkgs/development/python-modules/pytools/default.nix @@ -8,6 +8,7 @@ pytestCheckHook, pythonOlder, typing-extensions, + siphash24, }: buildPythonPackage rec { @@ -31,10 +32,12 @@ buildPythonPackage rec { optional-dependencies = { numpy = [ numpy ]; - # siphash = [ siphash ]; + siphash = [ siphash24 ]; }; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + ] ++ optional-dependencies.siphash; pythonImportsCheck = [ "pytools" @@ -42,14 +45,6 @@ buildPythonPackage rec { "pytools.lex" ]; - disabledTests = [ - # siphash is not available - "test_class_hashing" - "test_dataclass_hashing" - "test_datetime_hashing" - "test_hash_function" - ]; - meta = { description = "Miscellaneous Python lifesavers"; homepage = "https://github.com/inducer/pytools/"; diff --git a/pkgs/development/python-modules/siphash24/default.nix b/pkgs/development/python-modules/siphash24/default.nix new file mode 100644 index 000000000000..f700a76b6123 --- /dev/null +++ b/pkgs/development/python-modules/siphash24/default.nix @@ -0,0 +1,52 @@ +{ + lib, + fetchFromGitHub, + buildPythonPackage, + meson, + meson-python, + cython, + pkg-config, + c-siphash, + pytestCheckHook, +}: + +buildPythonPackage rec { + version = "1.7"; + pname = "siphash24"; + pyproject = true; + + src = fetchFromGitHub { + owner = "dnicolodi"; + repo = "python-siphash24"; + tag = "v${version}"; + hash = "sha256-/7XrRD4e7jLTUY/8mBbJ4dSo5P6pj8GRpSreIOZpKp0="; + }; + + nativeBuildInputs = [ pkg-config ]; + + build-system = [ + meson + meson-python + cython + ]; + + buildInputs = [ + c-siphash + ]; + + pythonImportsCheck = [ + "siphash24" + ]; + + pytestFlagsArray = [ "test.py" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + meta = { + homepage = "https://github.com/dnicolodi/python-siphash24"; + description = "Streaming-capable SipHash Implementation"; + changelog = "https://github.com/dnicolodi/python-siphash24/releases/tag/${src.tag}"; + license = lib.licenses.lgpl2Plus; + maintainers = with lib.maintainers; [ qbisi ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4fa0bfbef30d..47139152dd09 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15265,10 +15265,12 @@ self: super: with self; { sip = callPackage ../development/python-modules/sip { }; - siphashc = callPackage ../development/python-modules/siphashc { }; - sip4 = callPackage ../development/python-modules/sip/4.x.nix { }; + siphash24 = callPackage ../development/python-modules/siphash24 { }; + + siphashc = callPackage ../development/python-modules/siphashc { }; + sipyco = callPackage ../development/python-modules/sipyco { }; sirius = toPythonModule (pkgs.sirius.override {