Subject: [bug#64179] [PATCH] gnu: Add wasm-micro-runtime.

From: Maxim Cournoyer <[email-masked]>
Date: Wed, 06 Sep 2023 09:55:47 -0400

Hi Felix,

Felix Lechner <[email-masked]> writes:

> * gnu/packages/web.scm (wasm-micro-runtime): New variable.

[...]

> +(define-public wasm-micro-runtime
> +  (package
> +    (name "wasm-micro-runtime")
> +    (version "1.2.2")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/bytecodealliance/wasm-micro-runtime")
> +                    (commit (string-append "WAMR-" version))))
> +              (file-name (git-file-name "WAMR" version))
> +              (sha256
> +               (base32
> +                "1mbwaj25798ilhg02447k3c2813xvxd70dwdlr4ha73xxbdgi54f"))))
> +    (build-system cmake-build-system)
> +    (arguments
> +     (list
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (delete 'check)

Instead of deleting the check phase, uses #:tests? #f with an
appropriate comment (e.g.: ';no test suite' if inline).

> +          (replace 'configure
> +            (lambda _
> +              (chdir "product-mini/platforms/linux")
> +              (mkdir-p "build")
> +              (chdir "build")
> +              (invoke "cmake" "--install-prefix" #$output ".."))))))

Instead of overriding configure, missing all the important CMake options
that the default configure phase would use, did you try toa add a phase
like

--8<---------------cut here---------------start------------->8---
            (add-after 'unpack 'chdir
             (lambda _
              (chdir "product-mini/platforms/linux")))
--8<---------------cut here---------------end--------------->8---

It looks like this should do it.

> +    (native-inputs (list
> +                    ccache
> +                    gcc))

I'm pretty sure gcc is not necessary since it's already provided by
cmake-build-system.  ccache seems useless since we always build from
scratch in a clean environment.

Could you try the above suggestions and send a v2?

-- 
Thanks,
Maxim