From 65b24f11053bef8d96581593f67bab32a8288456 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 21 Nov 2024 09:21:04 +0100 Subject: [PATCH 1/2] python312Packages.boost-histogram: modernize derivation; use fetchFromGitHub --- .../boost-histogram/default.nix | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/boost-histogram/default.nix b/pkgs/development/python-modules/boost-histogram/default.nix index 83f534e71345..551386dd1dbf 100644 --- a/pkgs/development/python-modules/boost-histogram/default.nix +++ b/pkgs/development/python-modules/boost-histogram/default.nix @@ -1,18 +1,27 @@ { lib, - fetchPypi, buildPythonPackage, - pythonOlder, + fetchFromGitHub, + + # nativeBuildInputs cmake, + + # build-system pybind11, nanobind, ninja, + scikit-build-core, setuptools-scm, + + # buildInputs boost, + + # dependencies numpy, + + # tests pytestCheckHook, pytest-benchmark, - scikit-build-core, }: buildPythonPackage rec { @@ -20,12 +29,11 @@ buildPythonPackage rec { version = "1.5.0"; pyproject = true; - disabled = pythonOlder "3.6"; - - src = fetchPypi { - pname = "boost_histogram"; - inherit version; - hash = "sha256-BiPwEObFLl0Bh2dyOVloYJDbB/ww8NHYR1tdZjxd2yw="; + src = fetchFromGitHub { + owner = "scikit-hep"; + repo = "boost-histogram"; + rev = "refs/tags/v${version}"; + hash = "sha256-GsgzJqZTrtc4KRkGn468m0e+sgX9rzJdwA9JMPSSPWk="; }; nativeBuildInputs = [ cmake ]; @@ -49,10 +57,11 @@ buildPythonPackage rec { pytest-benchmark ]; - meta = with lib; { + meta = { description = "Python bindings for the C++14 Boost::Histogram library"; homepage = "https://github.com/scikit-hep/boost-histogram"; - license = licenses.bsd3; - maintainers = with maintainers; [ veprbl ]; + changelog = "https://github.com/scikit-hep/boost-histogram/releases/tag/v${version}"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ veprbl ]; }; } From d44c2904dc7b89015c4fdab883a6c886d67f686b Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 21 Nov 2024 09:29:52 +0100 Subject: [PATCH 2/2] python312Packages.boost-histogram: skip crashing test on aarch64-darwin --- .../development/python-modules/boost-histogram/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/boost-histogram/default.nix b/pkgs/development/python-modules/boost-histogram/default.nix index 551386dd1dbf..fb656151a13b 100644 --- a/pkgs/development/python-modules/boost-histogram/default.nix +++ b/pkgs/development/python-modules/boost-histogram/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, @@ -57,6 +58,12 @@ buildPythonPackage rec { pytest-benchmark ]; + disabledTests = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # Segfaults: boost_histogram/_internal/hist.py", line 799 in sum + # Fatal Python error: Segmentation fault + "test_numpy_conversion_4" + ]; + meta = { description = "Python bindings for the C++14 Boost::Histogram library"; homepage = "https://github.com/scikit-hep/boost-histogram";