Merge pull request #319173 from getchoo/pkgs/maturin/adopt

This commit is contained in:
Sandro 2024-07-12 15:14:55 +02:00 committed by GitHub
commit 130ef08317
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 49 additions and 33 deletions

View File

@ -1,10 +1,14 @@
{ callPackage
, lib
, stdenv
, fetchFromGitHub
, rustPlatform
, libiconv
, Security
{
callPackage,
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
darwin,
libiconv,
testers,
nix-update-script,
maturin,
}:
rustPlatform.buildRustPackage rec {
@ -20,16 +24,25 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-EuMPcJAGz564cC9UWrlihBxRUJCtqw4jvP/SQgx2L/0=";
buildInputs = lib.optionals stdenv.isDarwin [ Security libiconv ];
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
libiconv
];
# Requires network access, fails in sandbox.
doCheck = false;
passthru.tests.pyo3 = callPackage ./pyo3-test {};
passthru = {
tests = {
version = testers.testVersion { package = maturin; };
pyo3 = callPackage ./pyo3-test { };
};
meta = with lib; {
updateScript = nix-update-script { };
};
meta = {
description = "Build and publish Rust crates Python packages";
mainProgram = "maturin";
longDescription = ''
Build and publish Rust crates with PyO3, rust-cpython, and
cffi bindings as well as Rust binaries as Python packages.
@ -40,7 +53,11 @@ rustPlatform.buildRustPackage rec {
'';
homepage = "https://github.com/PyO3/maturin";
changelog = "https://github.com/PyO3/maturin/blob/v${version}/Changelog.md";
license = with licenses; [ asl20 /* or */ mit ];
maintainers = [ ];
license = with lib.licenses; [
asl20 # or
mit
];
maintainers = with lib.maintainers; [ getchoo ];
mainProgram = "maturin";
};
}

View File

@ -1,6 +1,4 @@
{ python3
, rustPlatform
}:
{ python3, rustPlatform }:
python3.pkgs.callPackage ./generic.nix {
buildAndTestSubdir = "examples/word-count";

View File

@ -1,16 +1,17 @@
# Derivation prototype, used by maturin and setuptools-rust
# passthrough tests.
{ lib
, fetchFromGitHub
, python
, rustPlatform
{
lib,
fetchFromGitHub,
python,
rustPlatform,
, nativeBuildInputs
nativeBuildInputs,
, buildAndTestSubdir ? null
, format ? "pyproject"
, preConfigure ? ""
buildAndTestSubdir ? null,
format ? "pyproject",
preConfigure ? "",
}:
python.pkgs.buildPythonPackage rec {
@ -24,22 +25,25 @@ python.pkgs.buildPythonPackage rec {
hash = "sha256-NOMrrfo8WjlPhtGxWUOPJS/UDDdbLQRCXR++Zd6JmIA=";
};
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
};
cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };
postPatch = ''
ln -s ${./Cargo.lock} Cargo.lock
'';
inherit buildAndTestSubdir format nativeBuildInputs preConfigure;
inherit
buildAndTestSubdir
format
nativeBuildInputs
preConfigure
;
pythonImportsCheck = [ "word_count" ];
meta = with lib; {
meta = {
description = "PyO3 word count example";
homepage = "https://github.com/PyO3/pyo3";
license = licenses.asl20;
license = lib.licenses.asl20;
maintainers = [ ];
};
}

View File

@ -16557,9 +16557,6 @@ with pkgs;
leptosfmt = callPackage ../development/tools/rust/leptosfmt { };
maturin = callPackage ../development/tools/rust/maturin {
inherit (darwin.apple_sdk.frameworks) Security;
};
panamax = callPackage ../development/tools/rust/panamax { };
ograc = callPackage ../development/tools/rust/ograc { };