2021-02-18 08:17:28 +00:00
|
|
|
# Derivation prototype, used by maturin and setuptools-rust
|
|
|
|
# passthrough tests.
|
|
|
|
|
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2021-03-20 07:50:28 +00:00
|
|
|
, python
|
2021-02-18 08:17:28 +00:00
|
|
|
, rustPlatform
|
|
|
|
|
|
|
|
, nativeBuildInputs
|
|
|
|
|
|
|
|
, buildAndTestSubdir ? null
|
|
|
|
, format ? "pyproject"
|
2021-03-20 07:38:14 +00:00
|
|
|
, preConfigure ? ""
|
2021-02-18 08:17:28 +00:00
|
|
|
}:
|
|
|
|
|
2021-03-20 07:50:28 +00:00
|
|
|
python.pkgs.buildPythonPackage rec {
|
2021-02-18 08:17:28 +00:00
|
|
|
pname = "word-count";
|
|
|
|
version = "0.13.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PyO3";
|
|
|
|
repo = "pyo3";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-NOMrrfo8WjlPhtGxWUOPJS/UDDdbLQRCXR++Zd6JmIA=";
|
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
2021-03-20 07:38:14 +00:00
|
|
|
inherit src patches;
|
2021-02-18 08:17:28 +00:00
|
|
|
name = "${pname}-${version}";
|
2021-05-04 07:03:58 +01:00
|
|
|
hash = "sha256-u3L9nXHKILznyZTgxdvZyOCQZFZhuADrtI7zXYQzrbE=";
|
2021-02-18 08:17:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./Cargo.lock.patch ];
|
|
|
|
|
2021-03-20 07:38:14 +00:00
|
|
|
inherit buildAndTestSubdir format nativeBuildInputs preConfigure;
|
2021-02-18 08:17:28 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "word_count" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "PyO3 word count example";
|
|
|
|
homepage = "https://github.com/PyO3/pyo3";
|
|
|
|
license = licenses.asl20;
|
2021-09-12 15:42:12 +01:00
|
|
|
maintainers = [ ];
|
2021-02-18 08:17:28 +00:00
|
|
|
};
|
|
|
|
}
|