From dfd3a4fa2aa3781927a3bdbce12610203054528a Mon Sep 17 00:00:00 2001 From: emaryn Date: Thu, 22 May 2025 00:44:12 +0800 Subject: [PATCH] numcpp: 2.13.0 -> 2.14.1 --- pkgs/by-name/nu/numcpp/package.nix | 18 ++++++++++-------- pkgs/by-name/nu/numcpp/pytest-CMakeLists.patch | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 pkgs/by-name/nu/numcpp/pytest-CMakeLists.patch diff --git a/pkgs/by-name/nu/numcpp/package.nix b/pkgs/by-name/nu/numcpp/package.nix index d0a495e4d6e3..c5972f050cc0 100644 --- a/pkgs/by-name/nu/numcpp/package.nix +++ b/pkgs/by-name/nu/numcpp/package.nix @@ -9,15 +9,17 @@ }: stdenv.mkDerivation (finalAttrs: { pname = "numcpp"; - version = "2.13.0"; + version = "2.14.1"; src = fetchFromGitHub { owner = "dpilger26"; repo = "NumCpp"; - rev = "Version_${finalAttrs.version}"; - hash = "sha256-+2xd8GNMSKPz801lfMAcHIkmidKd+xM8YblkdFj3HZk="; + tag = "Version_${finalAttrs.version}"; + hash = "sha256-8ghHTRneLeiFgzF9zHFjFu46qopc3l2Svku1H06XQTw="; }; + patches = [ ./pytest-CMakeLists.patch ]; + nativeCheckInputs = [ gtest python3 @@ -36,16 +38,16 @@ stdenv.mkDerivation (finalAttrs: { postInstall = '' substituteInPlace $out/share/NumCpp/cmake/NumCppConfig.cmake \ - --replace "\''${PACKAGE_PREFIX_DIR}/" "" + --replace-fail "\''${PACKAGE_PREFIX_DIR}/" "" ''; NIX_CFLAGS_COMPILE = "-Wno-error"; - meta = with lib; { + meta = { description = "Templatized Header Only C++ Implementation of the Python NumPy Library"; homepage = "https://github.com/dpilger26/NumCpp"; - license = licenses.mit; - maintainers = with maintainers; [ spalf ]; - platforms = platforms.unix; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ spalf ]; + platforms = lib.platforms.unix; }; }) diff --git a/pkgs/by-name/nu/numcpp/pytest-CMakeLists.patch b/pkgs/by-name/nu/numcpp/pytest-CMakeLists.patch new file mode 100644 index 000000000000..33bdb11e106a --- /dev/null +++ b/pkgs/by-name/nu/numcpp/pytest-CMakeLists.patch @@ -0,0 +1,18 @@ +add --embed to $PYTHON_LD_FLAGS and strip a preceding whitespace to conform to CMP0004 + +--- a/test/pytest/src/CMakeLists.txt ++++ b/test/pytest/src/CMakeLists.txt +@@ -56,11 +56,12 @@ find_package(Python 3.11 REQUIRED + if(UNIX) + execute_process( + COMMAND +- python3-config --ldflags ++ python3-config --embed --ldflags + OUTPUT_VARIABLE + PYTHON_LD_FLAGS + OUTPUT_STRIP_TRAILING_WHITESPACE + ) ++ string(STRIP ${PYTHON_LD_FLAGS} PYTHON_LD_FLAGS) + endif() + + target_link_libraries(${TARGET_NAME} PRIVATE