nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 rustPlatform,
7 libiconv,
8 cffi,
9 numpy,
10 scipy,
11 nix-update-script,
12}:
13
14buildPythonPackage rec {
15 pname = "clarabel";
16 version = "0.11.1";
17 pyproject = true;
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-58QcR/Dlmuq5mu//nlivSodT7lJpu+7L1VJvxvQblZg=";
22 };
23
24 cargoDeps = rustPlatform.fetchCargoVendor {
25 inherit pname version src;
26 hash = "sha256-Cmxbz1zPA/J7EeJhGfD4Zt+QvyJK6BOZ+YQAsf8H+is=";
27 };
28
29 nativeBuildInputs = with rustPlatform; [
30 cargoSetupHook
31 maturinBuildHook
32 ];
33
34 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libiconv;
35
36 dependencies = [
37 cffi
38 numpy
39 scipy
40 ];
41
42 pythonImportsCheck = [ "clarabel" ];
43
44 # no tests but run the same examples as .github/workflows/pypi.yaml
45 checkPhase = ''
46 runHook preCheck
47 python examples/python/example_sdp.py
48 python examples/python/example_qp.py
49 runHook postCheck
50 '';
51
52 passthru.updateScript = nix-update-script { };
53
54 meta = {
55 changelog = "https://github.com/oxfordcontrol/Clarabel.rs/releases/tag/v${version}/CHANGELOG.md";
56 description = "Conic Interior Point Solver";
57 homepage = "https://github.com/oxfordcontrol/Clarabel.rs";
58 license = lib.licenses.asl20;
59 maintainers = [ ];
60 };
61}