about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/wasmer/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/wasmer/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/wasmer/default.nix65
1 files changed, 18 insertions, 47 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/wasmer/default.nix b/nixpkgs/pkgs/development/python-modules/wasmer/default.nix
index 62c8a2a06b71..373e7a0a2203 100644
--- a/nixpkgs/pkgs/development/python-modules/wasmer/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/wasmer/default.nix
@@ -1,63 +1,34 @@
 { lib
 , rustPlatform
 , fetchFromGitHub
-, maturin
 , buildPythonPackage
-, isPy38
-, python
 }:
 let
   pname = "wasmer";
   version = "1.0.0";
+in buildPythonPackage rec {
+  inherit pname version;
 
-  wheel = rustPlatform.buildRustPackage rec {
-    inherit pname version;
-
-    src = fetchFromGitHub {
-      owner = "wasmerio";
-      repo = "wasmer-python";
-      rev = version;
-      hash = "sha256-I1GfjLaPYMIHKh2m/5IQepUsJNiVUEJg49wyuuzUYtY=";
-    };
-
-    cargoHash = "sha256-txOOia1C4W+nsXuXp4EytEn82CFfSmiOYwRLC4WPImc=";
-
-    nativeBuildInputs = [ maturin python ];
-
-    preBuild = ''
-      cd packages/api
-    '';
-
-    buildPhase = ''
-      runHook preBuild
-      maturin build --release --manylinux off --strip
-      runHook postBuild
-    '';
-
-    postBuild = ''
-      cd ../..
-    '';
-
-    doCheck = false;
+  src = fetchFromGitHub {
+    owner = "wasmerio";
+    repo = "wasmer-python";
+    rev = version;
+    hash = "sha256-I1GfjLaPYMIHKh2m/5IQepUsJNiVUEJg49wyuuzUYtY=";
+  };
 
-    installPhase = ''
-      runHook preInstall
-      install -Dm644 -t $out target/wheels/*.whl
-      runHook postInstall
-    '';
+  cargoDeps = rustPlatform.fetchCargoTarball {
+    inherit src;
+    name = "${pname}-${version}";
+    hash = "sha256-txOOia1C4W+nsXuXp4EytEn82CFfSmiOYwRLC4WPImc=";
   };
 
-in
-buildPythonPackage rec {
-  inherit pname version;
+  format = "pyproject";
+
+  nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ];
 
-  format = "wheel";
-  src = wheel;
+  buildAndTestSubdir = "packages/api";
 
-  unpackPhase = ''
-    mkdir -p dist
-    cp $src/*.whl dist
-  '';
+  doCheck = false;
 
   pythonImportsCheck = [ "wasmer" ];
 
@@ -65,7 +36,7 @@ buildPythonPackage rec {
     description = "Python extension to run WebAssembly binaries";
     homepage = "https://github.com/wasmerio/wasmer-python";
     license = licenses.mit;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     maintainers = with maintainers; [ SuperSandro2000 ];
   };
 }