2024-06-12 00:09:27 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
darwin,
|
|
|
|
libiconv,
|
2024-06-12 00:13:03 +00:00
|
|
|
testers,
|
2024-06-12 00:14:16 +00:00
|
|
|
nix-update-script,
|
2024-06-12 00:13:03 +00:00
|
|
|
maturin,
|
2024-08-07 15:02:23 +00:00
|
|
|
python3,
|
2021-02-12 09:47:30 +00:00
|
|
|
}:
|
2018-10-30 15:36:21 +00:00
|
|
|
|
2021-02-12 09:45:00 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2021-02-11 14:04:30 +00:00
|
|
|
pname = "maturin";
|
2024-09-25 21:03:20 +00:00
|
|
|
version = "1.7.4";
|
2018-10-30 15:36:21 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PyO3";
|
2019-08-30 18:59:44 +00:00
|
|
|
repo = "maturin";
|
2018-10-30 15:36:21 +00:00
|
|
|
rev = "v${version}";
|
2024-09-25 21:03:20 +00:00
|
|
|
hash = "sha256-Zephf4mB3RI5YIAOIjfqIfgVANefkH63OQoPPMe417E=";
|
2018-10-30 15:36:21 +00:00
|
|
|
};
|
|
|
|
|
2024-09-25 21:03:20 +00:00
|
|
|
cargoHash = "sha256-yLKt/Xml7ig6QG3T5Qn39tW7U5NIN1hSOaLiSRMiy5I=";
|
2018-10-30 15:36:21 +00:00
|
|
|
|
2024-06-12 00:09:27 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
libiconv
|
|
|
|
];
|
2018-10-30 15:36:21 +00:00
|
|
|
|
|
|
|
# Requires network access, fails in sandbox.
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-06-12 00:13:03 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
version = testers.testVersion { package = maturin; };
|
2024-08-07 15:02:23 +00:00
|
|
|
pyo3 = python3.pkgs.callPackage ./pyo3-test {
|
|
|
|
format = "pyproject";
|
|
|
|
buildAndTestSubdir = "examples/word-count";
|
|
|
|
preConfigure = "";
|
|
|
|
|
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
|
|
|
];
|
|
|
|
};
|
2024-06-12 00:13:03 +00:00
|
|
|
};
|
2024-06-12 00:14:16 +00:00
|
|
|
|
|
|
|
updateScript = nix-update-script { };
|
2024-06-12 00:13:03 +00:00
|
|
|
};
|
2021-02-18 08:17:28 +00:00
|
|
|
|
2024-06-12 00:11:41 +00:00
|
|
|
meta = {
|
2021-02-14 02:24:18 +00:00
|
|
|
description = "Build and publish Rust crates Python packages";
|
|
|
|
longDescription = ''
|
|
|
|
Build and publish Rust crates with PyO3, rust-cpython, and
|
|
|
|
cffi bindings as well as Rust binaries as Python packages.
|
|
|
|
|
|
|
|
This project is meant as a zero-configuration replacement for
|
|
|
|
setuptools-rust and Milksnake. It supports building wheels for
|
|
|
|
Python and can upload them to PyPI.
|
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/PyO3/maturin";
|
2023-05-27 04:20:00 +00:00
|
|
|
changelog = "https://github.com/PyO3/maturin/blob/v${version}/Changelog.md";
|
2024-06-12 00:11:41 +00:00
|
|
|
license = with lib.licenses; [
|
2024-06-12 00:09:27 +00:00
|
|
|
asl20 # or
|
|
|
|
mit
|
|
|
|
];
|
2024-06-12 00:11:41 +00:00
|
|
|
maintainers = with lib.maintainers; [ getchoo ];
|
|
|
|
mainProgram = "maturin";
|
2018-10-30 15:36:21 +00:00
|
|
|
};
|
|
|
|
}
|