Unverified Commit 130ef083 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

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

parents 9dd95220 c64a7196
Loading
Loading
Loading
Loading
+30 −13
Original line number Diff line number Diff line
{ 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 { };
    };

    updateScript = nix-update-script { };
  };

  meta = with lib; {
  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";
  };
}
+1 −3
Original line number Diff line number Diff line
{ python3
, rustPlatform
}:
{ python3, rustPlatform }:

python3.pkgs.callPackage ./generic.nix {
  buildAndTestSubdir = "examples/word-count";
+18 −14
Original line number Diff line number Diff line
# 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 = [ ];
  };
}
+0 −3
Original line number Diff line number Diff line
@@ -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 { };