about summary refs log tree commit diff
path: root/pkgs/development/tools/rust/maturin/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/rust/maturin/default.nix')
-rw-r--r--pkgs/development/tools/rust/maturin/default.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/development/tools/rust/maturin/default.nix b/pkgs/development/tools/rust/maturin/default.nix
new file mode 100644
index 000000000000..4b07129ae0ef
--- /dev/null
+++ b/pkgs/development/tools/rust/maturin/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, rustPlatform, dbus, gmp, openssl, pkgconfig
+, darwin }:
+
+let
+  inherit (darwin.apple_sdk.frameworks) Security;
+in rustPlatform.buildRustPackage rec {
+  name = "maturin-${version}";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "PyO3";
+    repo = "maturin";
+    rev = "v${version}";
+    sha256 = "1qscn8ycyg9ldkp1v5178mlw8r5ak2p12x52c0w4hgij7y1q5s39";
+  };
+
+  cargoSha256 = "0fk9dgwkgkkmxxd8ydl0vp14jhzi65pkz36v5h3nkp4cb4n4cvdj";
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [ gmp openssl ]
+    ++ stdenv.lib.optional stdenv.isDarwin Security
+    ++ stdenv.lib.optional stdenv.isLinux dbus;
+
+  # Requires network access, fails in sandbox.
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "Build and publish crates with pyo3 bindings as python packages";
+    homepage = https://github.com/PyO3/maturin;
+    license = licenses.mit;
+    maintainers = [ maintainers.danieldk ];
+    platforms = platforms.all;
+  };
+}