nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 73 lines 1.7 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 llvmPackages_19, 6 boost, 7 cmake, 8 spdlog, 9 libxml2, 10 libffi, 11 testers, 12}: 13 14let 15 # The supported version is found in the changelog, the documentation does indicate a minimum version but not a maximum. 16 # The project is also using a `flake.nix` so we can retrieve the used llvm version with: 17 # 18 # ```shell 19 # nix eval --inputs-from .# nixpkgs#llvmPackages.libllvm.version 20 # ``` 21 # 22 # > Where `.#` is the flake path were the repo `wasmedge` was cloned at the expected version. 23 llvmPackages = llvmPackages_19; 24in 25llvmPackages.stdenv.mkDerivation (finalAttrs: { 26 pname = "wasmedge"; 27 version = "0.15.0"; 28 29 src = fetchFromGitHub { 30 owner = "WasmEdge"; 31 repo = "WasmEdge"; 32 rev = finalAttrs.version; 33 sha256 = "sha256-P4syb8v3EY/tHwG8FOvR+kgMew/nwG+pG2weN6172go="; 34 }; 35 36 nativeBuildInputs = [ 37 cmake 38 llvmPackages.lld 39 ]; 40 41 buildInputs = [ 42 boost 43 spdlog 44 llvmPackages.llvm 45 libxml2 46 libffi 47 ]; 48 49 cmakeFlags = [ 50 "-DWASMEDGE_BUILD_TESTS=OFF" # Tests are downloaded using git 51 ] 52 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 53 "-DWASMEDGE_FORCE_DISABLE_LTO=ON" 54 ]; 55 56 postPatch = '' 57 echo -n $version > VERSION 58 ''; 59 60 passthru.tests = { 61 version = testers.testVersion { 62 package = finalAttrs.finalPackage; 63 }; 64 }; 65 66 meta = { 67 homepage = "https://wasmedge.org/"; 68 license = with lib.licenses; [ asl20 ]; 69 description = "Lightweight, high-performance, and extensible WebAssembly runtime for cloud native, edge, and decentralized applications"; 70 maintainers = with lib.maintainers; [ dit7ya ]; 71 platforms = lib.platforms.all; 72 }; 73})