35b9c063c2
Also fixes retworkx Darwin build. Fixes linker error for retworkx that required libiconv. Error log: error: linking with `/nix/store/47vpv5i10dwfg1cf5wca1k40f982g5fm-clang-wrapper-7.1.0/bin/cc` failed: exit code: 1 ... ld: library not found for -liconv clang-7: error: linker command failed with exit code 1 (use -v to see invocation) Also fix tests running on build, that didn't get converted when switched to the new way of running Cargo builds for python packages.
68 lines
1.4 KiB
Nix
68 lines
1.4 KiB
Nix
{ lib
|
|
, stdenv
|
|
, buildPythonPackage
|
|
, pythonOlder
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, libiconv
|
|
# Check inputs
|
|
, pytestCheckHook
|
|
, fixtures
|
|
, graphviz
|
|
, matplotlib
|
|
, networkx
|
|
, numpy
|
|
, pydot
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "retworkx";
|
|
version = "0.9.0";
|
|
format = "pyproject";
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Qiskit";
|
|
repo = "retworkx";
|
|
rev = version;
|
|
hash = "sha256-1W7DexS+ECAPsxyZAF36xcEguFkjUMX9lDBylNVPqyk=";
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
inherit src;
|
|
name = "${pname}-${version}";
|
|
hash = "sha256-y5l7jqrlk3ONHefZPS31IvcaO9ttXWLM7fIUmNVwbco=";
|
|
};
|
|
|
|
nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ];
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
|
|
|
pythonImportsCheck = [ "retworkx" ];
|
|
checkInputs = [
|
|
pytestCheckHook
|
|
fixtures
|
|
graphviz
|
|
matplotlib
|
|
networkx
|
|
numpy
|
|
pydot
|
|
];
|
|
|
|
preCheck = ''
|
|
export TESTDIR=$(mktemp -d)
|
|
cp -r tests/ $TESTDIR
|
|
pushd $TESTDIR
|
|
'';
|
|
postCheck = "popd";
|
|
|
|
meta = with lib; {
|
|
description = "A python graph library implemented in Rust.";
|
|
homepage = "https://retworkx.readthedocs.io/en/latest/index.html";
|
|
downloadPage = "https://github.com/Qiskit/retworkx/releases";
|
|
changelog = "https://github.com/Qiskit/retworkx/releases/tag/${version}";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
};
|
|
}
|