2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
}:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2023-05-24 13:37:59 +00:00
|
|
|
pname = "wamr";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "2.1.1";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bytecodealliance";
|
|
|
|
repo = "wasm-micro-runtime";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "WAMR-${finalAttrs.version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-/DQ+dZ3VoijL7FdgRgPg3H7whhXhjIzjhCaqpjPYw4k=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-02-29 20:09:43 +00:00
|
|
|
"-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinSdkVersion}"
|
2024-01-25 14:12:00 +00:00
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
sourceRoot = let
|
2024-09-26 11:04:55 +00:00
|
|
|
platform = if stdenv.hostPlatform.isLinux then
|
2024-01-02 11:29:13 +00:00
|
|
|
"linux"
|
2024-09-26 11:04:55 +00:00
|
|
|
else if stdenv.hostPlatform.isDarwin then
|
2024-01-02 11:29:13 +00:00
|
|
|
"darwin"
|
|
|
|
else throw "unsupported platform";
|
|
|
|
in "${finalAttrs.src.name}/product-mini/platforms/${platform}";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "WebAssembly Micro Runtime";
|
|
|
|
homepage = "https://github.com/bytecodealliance/wasm-micro-runtime";
|
|
|
|
license = licenses.asl20;
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "iwasm";
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ ereslibre ];
|
2024-01-02 11:29:13 +00:00
|
|
|
platforms = platforms.unix;
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|