nixpkgs/pkgs/by-name/ma/maturin/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.7 KiB
Nix
Raw Normal View History

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,
python3,
2021-02-12 09:47:30 +00:00
}:
2018-10-30 15:36:21 +00:00
rustPlatform.buildRustPackage rec {
2021-02-11 14:04:30 +00:00
pname = "maturin";
version = "1.7.4";
2018-10-30 15:36:21 +00:00
src = fetchFromGitHub {
owner = "PyO3";
repo = "maturin";
2018-10-30 15:36:21 +00:00
rev = "v${version}";
hash = "sha256-Zephf4mB3RI5YIAOIjfqIfgVANefkH63OQoPPMe417E=";
2018-10-30 15:36:21 +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; };
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
};
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.
'';
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";
license = with lib.licenses; [
2024-06-12 00:09:27 +00:00
asl20 # or
mit
];
maintainers = with lib.maintainers; [ getchoo ];
mainProgram = "maturin";
2018-10-30 15:36:21 +00:00
};
}