21 , extraNativeBuildInputs ? [ ]
22 , extraBuildInputs ? [ ]
23 }: buildPythonPackage rec {
28 outputs = [ "out" ] ++ lib.optional (pname == "wasmer") "testsout";
30 src = fetchFromGitHub {
32 repo = "wasmer-python";
34 hash = "sha256-nOeOhQ1XY+9qmLGURrI5xbgBUgWe5XRpV38f73kKX2s=";
37 cargoDeps = rustPlatform.fetchCargoTarball {
39 name = "${pname}-${version}";
43 nativeBuildInputs = (with rustPlatform; [ cargoSetupHook maturinBuildHook ])
44 ++ extraNativeBuildInputs;
47 # Workaround for metadata, that maturin 0.14 does not accept in Cargo.toml anymore
48 substituteInPlace ${buildAndTestSubdir}/Cargo.toml \
49 --replace "package.metadata.maturin" "broken"
52 buildInputs = lib.optionals stdenv.isDarwin [ libiconv ]
55 inherit buildAndTestSubdir;
57 postInstall = lib.optionalString (pname == "wasmer") ''
59 cp -R tests $testsout/tests
62 # check in passthru.tests.pytest because all packages are required to run the tests
65 passthru.tests = lib.optionalAttrs (pname == "wasmer") {
66 pytest = callPackage ./tests.nix { };
69 pythonImportsCheck = [ "${lib.replaceStrings ["-"] ["_"] pname}" ];
72 description = "Python extension to run WebAssembly binaries";
73 homepage = "https://github.com/wasmerio/wasmer-python";
74 license = licenses.mit;
75 platforms = platforms.unix;
83 buildAndTestSubdir = "packages/api";
84 cargoHash = "sha256-twoog8LjQtoli+TlDipSuB7yLFkXQJha9BqobqgZW3Y=";
87 wasmer-compiler-cranelift = common {
88 pname = "wasmer-compiler-cranelift";
89 buildAndTestSubdir = "packages/compiler-cranelift";
90 cargoHash = "sha256-IqeMOY6emhIC7ekH8kIOZCr3JVkjxUg/lQli+ZZpdq4=";
93 wasmer-compiler-llvm = common {
94 pname = "wasmer-compiler-llvm";
95 buildAndTestSubdir = "packages/compiler-llvm";
96 cargoHash = "sha256-xawbf5gXXV+7I2F2fDSaMvjtFvGDBtqX7wL3c28TSbA=";
97 extraNativeBuildInputs = [ llvm_14 ];
98 extraBuildInputs = [ libffi libxml2.out ncurses zlib ];
101 wasmer-compiler-singlepass = common {
102 pname = "wasmer-compiler-singlepass";
103 buildAndTestSubdir = "packages/compiler-singlepass";
104 cargoHash = "sha256-4nZHMCNumNhdGPOmHXlJ5POYP7K+VPjwhEUMgzGb/Rk=";