From 1e79b45fd6e9cb107c649f97984823b8a1b4c324 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 13 Sep 2025 13:06:25 +0200 Subject: [PATCH 01/10] trlib: fix for CMake v4 --- pkgs/by-name/tr/trlib/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/tr/trlib/package.nix b/pkgs/by-name/tr/trlib/package.nix index aec21ad636bf..3309a7244e94 100644 --- a/pkgs/by-name/tr/trlib/package.nix +++ b/pkgs/by-name/tr/trlib/package.nix @@ -30,6 +30,14 @@ stdenv.mkDerivation (finalAttrs: { }) ]; + # ref. https://github.com/felixlen/trlib/pull/25 + # This PR was merged upstream, so the patch can be removed on next release + postPatch = '' + substituteInPlace CMakeLists.txt --replace-fail \ + "cmake_minimum_required (VERSION 3.1)" \ + "cmake_minimum_required (VERSION 3.13)" + ''; + nativeBuildInputs = [ cmake ]; buildInputs = [ blas From 53e209515d738fca06d1a53001026a3a7c245a11 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Thu, 7 Aug 2025 01:33:16 +0200 Subject: [PATCH 02/10] hpipm: 0-unstable-2024-07-30 -> 0.1.3-unstable-2025-09-25 fix for CMake v4 Co-authored-by: Grimmauld --- pkgs/by-name/hp/hpipm/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/hp/hpipm/package.nix b/pkgs/by-name/hp/hpipm/package.nix index 534697dd1983..ad220cdb2b50 100644 --- a/pkgs/by-name/hp/hpipm/package.nix +++ b/pkgs/by-name/hp/hpipm/package.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "hpipm"; #version = "0.1.3"; not building, use master instead - version = "0-unstable-2024-07-30"; + version = "0.1.3-unstable-2025-09-25"; src = fetchFromGitHub { owner = "giaf"; repo = "hpipm"; - rev = "3ab7d6059d9d7da31ec9ff6a8ca84fd8ec5ab5e2"; - hash = "sha256-TRNHjW2/YDfGJHTG9sy2nmHyk6+HlBGIabPm87TETE8="; + rev = "8f3a2d00f6d1bd7101fb651391fba79377915288"; + hash = "sha256-XtnUs1RiB7zJOv7zdRzB31hnxDYaiH+Q4SLyE6/kuEg="; }; nativeBuildInputs = [ cmake ]; From 0292f13177a791a723d594fccd1e9dea085dfcee Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 14 Sep 2025 10:51:27 +0200 Subject: [PATCH 03/10] openscenegraph: fix for CMake v4 --- pkgs/by-name/op/openscenegraph/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/op/openscenegraph/package.nix b/pkgs/by-name/op/openscenegraph/package.nix index b1f9dcb63d9a..5c893c5d5e20 100644 --- a/pkgs/by-name/op/openscenegraph/package.nix +++ b/pkgs/by-name/op/openscenegraph/package.nix @@ -135,6 +135,13 @@ stdenv.mkDerivation rec { }) ]; + # ref. https://github.com/openscenegraph/OpenSceneGraph/pull/1373 + postPatch = '' + substituteInPlace CMakeLists.txt --replace-fail \ + "CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)" \ + "CMAKE_MINIMUM_REQUIRED(VERSION 3.10)" + ''; + cmakeFlags = lib.optional (!withApps) "-DBUILD_OSG_APPLICATIONS=OFF" ++ lib.optional withExamples "-DBUILD_OSG_EXAMPLES=ON"; From c1f44d4e91519f3aa49f3a628942748a92dd4142 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 14 Sep 2025 11:17:28 +0200 Subject: [PATCH 04/10] bullet: fix for CMake v4 --- pkgs/by-name/bu/bullet/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/bu/bullet/package.nix b/pkgs/by-name/bu/bullet/package.nix index 287716871294..ed90d083b421 100644 --- a/pkgs/by-name/bu/bullet/package.nix +++ b/pkgs/by-name/bu/bullet/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, libGLU, libGL, @@ -26,6 +27,14 @@ stdenv.mkDerivation rec { libglut ]; + patches = [ + # fix for CMake v4, merged upstream + (fetchpatch { + url = "https://github.com/bulletphysics/bullet3/commit/d1a4256b3a019117f2bb6cb8c63d6367aaf512e2.patch"; + hash = "sha256-FklMKYw5dKUcR5kZOkqv+KVLcWL/7r/0SAdYolmrn5A="; + }) + ]; + postPatch = '' substituteInPlace examples/ThirdPartyLibs/Gwen/CMakeLists.txt \ --replace "-DGLEW_STATIC" "-DGLEW_STATIC -Wno-narrowing" From 0007e799fb900453aef0d8e48b18bbe681de6c0d Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 14 Sep 2025 11:20:37 +0200 Subject: [PATCH 05/10] libccd: fix for CMake v4 --- pkgs/by-name/li/libccd/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/li/libccd/package.nix b/pkgs/by-name/li/libccd/package.nix index 8040dd7adcd6..7e5263de362d 100644 --- a/pkgs/by-name/li/libccd/package.nix +++ b/pkgs/by-name/li/libccd/package.nix @@ -26,6 +26,14 @@ stdenv.mkDerivation rec { }) ]; + # fix for CMake v4 + # ref https://github.com/danfis/libccd/pull/82, not merged yet + postPatch = '' + substituteInPlace CMakeLists.txt --replace-fail \ + "cmake_minimum_required(VERSION 2.8.11)" \ + "cmake_minimum_required(VERSION 3.12)" + ''; + nativeBuildInputs = [ cmake ]; meta = with lib; { From 0693b8d334572aa61225004d5f26ad19ed4a101e Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 14 Sep 2025 11:48:53 +0200 Subject: [PATCH 06/10] cxxopts: 3.2.1 -> 3.3.1 fix #411129 https://github.com/jarro2783/cxxopts/releases/tag/v3.3.1 Notable changes here: - gcc 15 compat - cmake 4 compat Co-authored-by: Grimmauld --- pkgs/by-name/cx/cxxopts/package.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/cx/cxxopts/package.nix b/pkgs/by-name/cx/cxxopts/package.nix index a00858fb2fff..ecd195a79cc9 100644 --- a/pkgs/by-name/cx/cxxopts/package.nix +++ b/pkgs/by-name/cx/cxxopts/package.nix @@ -8,15 +8,15 @@ enableUnicodeHelp ? true, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "cxxopts"; - version = "3.2.1"; + version = "3.3.1"; src = fetchFromGitHub { owner = "jarro2783"; repo = "cxxopts"; - rev = "v${version}"; - sha256 = "sha256-aOF3owz7SIV4trJY0PnMtIcwqoUpDbB3tNxZcsl9dzM="; + rev = "v${finalAttrs.version}"; + hash = "sha256-baM6EX9D0yfrKxuPXyUUV9RqdrVLyygeG6x57xN8lc4="; }; buildInputs = lib.optionals enableUnicodeHelp [ icu74.dev ]; @@ -44,4 +44,4 @@ stdenv.mkDerivation rec { maintainers = [ maintainers.spease ]; platforms = platforms.all; }; -} +}) From 88cf1ef3ada39568786ef7ccc9641177d5955112 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 14 Sep 2025 13:15:19 +0200 Subject: [PATCH 07/10] python3Packages.qdldl: fetch from github --- pkgs/development/python-modules/qdldl/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/qdldl/default.nix b/pkgs/development/python-modules/qdldl/default.nix index b1c08a87a074..f128b8fd399d 100644 --- a/pkgs/development/python-modules/qdldl/default.nix +++ b/pkgs/development/python-modules/qdldl/default.nix @@ -1,7 +1,7 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, cmake, numpy, pybind11, @@ -15,9 +15,11 @@ buildPythonPackage rec { version = "0.1.7.post5"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-CxOZ4cSbW+1arI/WPvCKtwjTQMN/tCb+ABKLwfNrKG4="; + src = fetchFromGitHub { + owner = "osqp"; + repo = "qdldl-python"; + tag = "v${version}"; + hash = "sha256-XHdvYWORHDYy/EIqmlmFQZwv+vK3I+rPIrvcEW1JyIw="; }; dontUseCmakeConfigure = true; From ea651fa6314e17bcff35af51397e2a145bcd3f35 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 14 Sep 2025 13:45:51 +0200 Subject: [PATCH 08/10] python3Packages.qdldl: fix for CMake v4 by properly using our qdldl, and, while here, fixing its CMake exports --- pkgs/by-name/qd/qdldl/package.nix | 7 ++ .../python-modules/qdldl/default.nix | 13 +++ .../python-modules/qdldl/use-qdldl.patch | 93 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 +- 4 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/python-modules/qdldl/use-qdldl.patch diff --git a/pkgs/by-name/qd/qdldl/package.nix b/pkgs/by-name/qd/qdldl/package.nix index bacdab3305e5..c88db5f6f18b 100644 --- a/pkgs/by-name/qd/qdldl/package.nix +++ b/pkgs/by-name/qd/qdldl/package.nix @@ -16,6 +16,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-pRlxqy5G8mxKXTIn4ruV/95TzpzNB/ArJX+WrEJRqW4="; }; + # fix abs dir concatenation + postPatch = '' + substituteInPlace CMakeLists.txt --replace-fail \ + "$/$""{CMAKE_INSTALL_INCLUDEDIR}" \ + "$""{CMAKE_INSTALL_INCLUDEDIR}" + ''; + nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/python-modules/qdldl/default.nix b/pkgs/development/python-modules/qdldl/default.nix index f128b8fd399d..e64e54f03eba 100644 --- a/pkgs/development/python-modules/qdldl/default.nix +++ b/pkgs/development/python-modules/qdldl/default.nix @@ -2,12 +2,14 @@ lib, buildPythonPackage, fetchFromGitHub, + replaceVars, cmake, numpy, pybind11, setuptools, scipy, pytestCheckHook, + qdldl, }: buildPythonPackage rec { @@ -22,6 +24,13 @@ buildPythonPackage rec { hash = "sha256-XHdvYWORHDYy/EIqmlmFQZwv+vK3I+rPIrvcEW1JyIw="; }; + # use up-to-date qdldl for CMake v4 + patches = [ + (replaceVars ./use-qdldl.patch { + inherit qdldl; + }) + ]; + dontUseCmakeConfigure = true; build-system = [ @@ -36,6 +45,10 @@ buildPythonPackage rec { scipy ]; + propagatedBuildInputs = [ + qdldl + ]; + pythonImportsCheck = [ "qdldl" ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/qdldl/use-qdldl.patch b/pkgs/development/python-modules/qdldl/use-qdldl.patch new file mode 100644 index 000000000000..7a8dd7b46f0e --- /dev/null +++ b/pkgs/development/python-modules/qdldl/use-qdldl.patch @@ -0,0 +1,93 @@ +From 0293de5a5bd209386b3c021ee661e85eee1985a9 Mon Sep 17 00:00:00 2001 +From: Guilhem Saurel +Date: Sun, 21 Sep 2025 14:55:32 +0200 +Subject: [PATCH] Use up-to-date qdldl for CMake v4 + +--- + c/CMakeLists.txt | 5 +++-- + c/amd/include/SuiteSparse_config.h | 2 +- + c/amd/include/perm.h | 2 +- + cpp/qdldl.hpp | 2 +- + setup.py | 3 ++- + 5 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt +index 728204d..df15d84 100644 +--- a/c/CMakeLists.txt ++++ b/c/CMakeLists.txt +@@ -12,7 +12,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/out) + +-add_subdirectory(qdldl EXCLUDE_FROM_ALL) ++find_package(qdldl REQUIRED CONFIG) + + set( + amd_src +@@ -37,7 +37,8 @@ set( + + + # Add QDLDL+AMD library +-add_library(qdldlamd STATIC ${amd_src} $) ++add_library(qdldlamd STATIC ${amd_src}) ++target_link_libraries(qdldlamd qdldl::qdldl) + target_include_directories(qdldlamd PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/amd/include + ${CMAKE_CURRENT_SOURCE_DIR}/qdldl/include +diff --git a/c/amd/include/SuiteSparse_config.h b/c/amd/include/SuiteSparse_config.h +index ea3cea4..19ac8df 100644 +--- a/c/amd/include/SuiteSparse_config.h ++++ b/c/amd/include/SuiteSparse_config.h +@@ -42,7 +42,7 @@ + extern "C" { + #endif + +-#include "qdldl_types.h" ++#include "qdldl/qdldl_types.h" + #define DLONG + typedef QDLDL_float c_float; + +diff --git a/c/amd/include/perm.h b/c/amd/include/perm.h +index 16c2617..841abe1 100644 +--- a/c/amd/include/perm.h ++++ b/c/amd/include/perm.h +@@ -2,7 +2,7 @@ + extern "C" { + # endif // ifdef __cplusplus + +-#include "qdldl_types.h" ++#include "qdldl/qdldl_types.h" + + /** + * C = A(p,p)= PAP' where A and C are symmetric the upper part stored; +diff --git a/cpp/qdldl.hpp b/cpp/qdldl.hpp +index 83b4970..1a7b5d1 100644 +--- a/cpp/qdldl.hpp ++++ b/cpp/qdldl.hpp +@@ -1,5 +1,5 @@ + // Source code for QDLDL, AMD and permutations +-#include "qdldl/include/qdldl.h" ++#include "qdldl/qdldl.h" + #include "amd/include/amd.h" + #include "amd/include/perm.h" + #include +diff --git a/setup.py b/setup.py +index edb50ed..c0e4c23 100644 +--- a/setup.py ++++ b/setup.py +@@ -97,10 +97,11 @@ class build_ext_qdldl(build_ext): + qdldl = Extension('qdldl', + sources=glob(os.path.join('cpp', '*.cpp')), + include_dirs=[os.path.join('c'), +- os.path.join('c', 'qdldl', 'include'), ++ "@qdldl@/include", + get_pybind_include(), + get_pybind_include(user=False)], + language='c++', ++ extra_link_args=['-lqdldl'], + extra_compile_args=compile_args + ['-std=c++11'], + extra_objects=[qdldl_lib]) + +-- +2.51.0 + diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8b6c87566660..6d19e5b35a09 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15469,7 +15469,7 @@ self: super: with self; { qdarkstyle = callPackage ../development/python-modules/qdarkstyle { }; - qdldl = callPackage ../development/python-modules/qdldl { }; + qdldl = callPackage ../development/python-modules/qdldl { inherit (pkgs) qdldl; }; qdrant-client = callPackage ../development/python-modules/qdrant-client { }; From 895b62aa0e3e9ff55c17e9dd9349ec06e4760f85 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 26 Sep 2025 08:25:18 +0200 Subject: [PATCH 09/10] python3Packages.qdldl: portable separator Co-authored-by: Grimmauld --- pkgs/development/python-modules/qdldl/use-qdldl.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/qdldl/use-qdldl.patch b/pkgs/development/python-modules/qdldl/use-qdldl.patch index 7a8dd7b46f0e..a653ffea5639 100644 --- a/pkgs/development/python-modules/qdldl/use-qdldl.patch +++ b/pkgs/development/python-modules/qdldl/use-qdldl.patch @@ -80,7 +80,7 @@ index edb50ed..c0e4c23 100644 sources=glob(os.path.join('cpp', '*.cpp')), include_dirs=[os.path.join('c'), - os.path.join('c', 'qdldl', 'include'), -+ "@qdldl@/include", ++ os.path.join("@qdldl@", "include"), get_pybind_include(), get_pybind_include(user=False)], language='c++', From 25414e6a317c9a18576115318f85ca99d4dc0bff Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 26 Sep 2025 08:47:22 +0200 Subject: [PATCH 10/10] python3Packages.qdldl: update meta Co-authored-by: Grimmauld --- pkgs/development/python-modules/qdldl/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/qdldl/default.nix b/pkgs/development/python-modules/qdldl/default.nix index e64e54f03eba..49e97e832b5c 100644 --- a/pkgs/development/python-modules/qdldl/default.nix +++ b/pkgs/development/python-modules/qdldl/default.nix @@ -52,11 +52,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "qdldl" ]; nativeCheckInputs = [ pytestCheckHook ]; - meta = with lib; { - description = "Free LDL factorization routine"; - homepage = "https://github.com/oxfordcontrol/qdldl"; - downloadPage = "https://github.com/oxfordcontrol/qdldl-python"; - license = licenses.asl20; - maintainers = with maintainers; [ drewrisinger ]; + meta = { + description = "Python interface to the QDLDL"; + homepage = "https://github.com/osqp/qdldl-python"; + changelog = "https://github.com/osqp/qdldl-python/releases/tag/${src.tag}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ drewrisinger ]; }; }