nixpkgs/pkgs/by-name/wa/wamr/package.nix
Rafael Fernández López ade11f7e27 wamr: 2.2.0 -> 2.4.1
Co-Authored-By: Winter <winter@winter.cafe>
Co-authored-by: Bot_wxt1221 <3264117476@qq.com>
2025-08-07 08:12:36 +02:00

58 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "wamr";
version = "2.4.1";
src = fetchFromGitHub {
owner = "bytecodealliance";
repo = "wasm-micro-runtime";
tag = "WAMR-${finalAttrs.version}";
hash = "sha256-OGgd+HpzI3BMi3MuZUFyDuGVml4NeLMHu3ePgzWuIMY=";
};
nativeBuildInputs = [ cmake ];
cmakeFlags = [
"-DWAMR_BUILD_SIMD=0"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinSdkVersion}"
];
postPatch =
let
# Can't use `sourceRoot` because we need the entire
# source tree to be writable, as the CMake scripts
# write to it.
sourceDir =
let
platform =
if stdenv.hostPlatform.isLinux then
"linux"
else if stdenv.hostPlatform.isDarwin then
"darwin"
else
throw "unsupported platform";
in
"product-mini/platforms/${platform}";
in
''
cd ${sourceDir}
'';
meta = with lib; {
description = "WebAssembly Micro Runtime";
homepage = "https://github.com/bytecodealliance/wasm-micro-runtime";
license = licenses.asl20;
mainProgram = "iwasm";
maintainers = with maintainers; [ ereslibre ];
platforms = platforms.unix;
};
})