From 4bba34ce4b36f7950bfc8aa587e695fc4fd34a32 Mon Sep 17 00:00:00 2001 From: qbisi Date: Mon, 3 Mar 2025 01:35:29 +0800 Subject: [PATCH 1/5] c-stdaux: init at 1.5.0 --- pkgs/by-name/c-/c-stdaux/package.nix | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pkgs/by-name/c-/c-stdaux/package.nix 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..17e04f450087 --- /dev/null +++ b/pkgs/by-name/c-/c-stdaux/package.nix @@ -0,0 +1,37 @@ +{ + 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 + ]; + + doCheck = true; + + 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 ]; + }; +} From 6abfccb7dde317a2343e1b671605b7ad93aa7958 Mon Sep 17 00:00:00 2001 From: qbisi Date: Mon, 3 Mar 2025 01:36:55 +0800 Subject: [PATCH 2/5] c-siphash: init at 1.1.0 --- pkgs/by-name/c-/c-siphash/package.nix | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pkgs/by-name/c-/c-siphash/package.nix 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 ]; + }; +} From 190100c498cb25e462f49482f4d291d0b129c819 Mon Sep 17 00:00:00 2001 From: qbisi Date: Mon, 3 Mar 2025 01:54:22 +0800 Subject: [PATCH 3/5] python312Packages.siphash24: init at 1.7 --- .../python-modules/siphash24/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 6 ++- 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/python-modules/siphash24/default.nix 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 ccc3fb12e80c..9dc865d832d1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15146,10 +15146,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 { From 8cb1bbd47d36db0e18ddf64e44f5342e7a9ab2de Mon Sep 17 00:00:00 2001 From: qbisi Date: Mon, 3 Mar 2025 02:02:06 +0800 Subject: [PATCH 4/5] python312Packages.pytools: add siphash24 support --- .../python-modules/pytools/default.nix | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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/"; From 135deed75a76c9dea5a2a9ba7d36e2037d23a785 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sun, 2 Mar 2025 15:35:31 -0500 Subject: [PATCH 5/5] c-stdaux: disable tests on darwin --- pkgs/by-name/c-/c-stdaux/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/c-/c-stdaux/package.nix b/pkgs/by-name/c-/c-stdaux/package.nix index 17e04f450087..6f77d3486207 100644 --- a/pkgs/by-name/c-/c-stdaux/package.nix +++ b/pkgs/by-name/c-/c-stdaux/package.nix @@ -22,7 +22,9 @@ stdenv.mkDerivation rec { ninja ]; - doCheck = true; + # 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";