Subject: Re: [PATCH] gnu: Add bgfx

From: Leo Prikler <[email-masked]>
Date: Sat, 14 Aug 2021 11:43:01 +0200

Hi,

Am Samstag, den 14.08.2021, 01:35 -0700 schrieb Andy Tai:
> * gnu/packages/graphics.scm (bgfx): New variable
> ---
>  gnu/packages/graphics.scm | 38
> ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
> 
> diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
> index 38feb27c87..53ac12f731 100644
> --- a/gnu/packages/graphics.scm
> +++ b/gnu/packages/graphics.scm
> @@ -2000,3 +2000,41 @@ Some feature highlights:
>  such as VR and AR on mobile, PC/desktop, and any other device.
> Monado aims to be
>  a complete and conforming implementation of the OpenXR API made by
> Khronos.")
>      (license license:boost1.0)))
> +
> +(define-public bgfx
> +  (let ((commit "65513d08541ab1ead814f2c97d0502c8d13eae68")
> +        (revision "0"))
> +    (package
> +      (name "bgfx")
> +      (version
> +       (git-version "0" revision commit))
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri
> +          (git-reference
> +           (url "https://github.com/bkaradzic/bgfx.cmake")
> +           (commit commit)
> +           ;; Fetch git submodules
> +           (recursive? #t)))
The use of submodules is discouraged because it's often hard to reason
about them.  This is such a case.  bgfx and the other submodules each
vendor a bunch of dependencies on top of the binaries that e.g. bx
ships as part of their tools repo.  
> +         (file-name (git-file-name name version))
> +         (sha256
> +          (base32
> +           "1k18230zw3v2l0vgz5xi0l23fa0686yx0jd6hkvvvwp3zlakqp7n")))
> )
> +      (build-system cmake-build-system)
> +      (arguments
> +       `(#:tests? #f)) ;; no tests
> +      (inputs
> +       `(("glslang" ,glslang)
> +         ("libxcb" ,libxcb)
> +         ("opengl" ,mesa)
> +         ("vulkan-loader" ,vulkan-loader)))
> +      (native-inputs
> +       `(("pkg-config" ,pkg-config)
> +         ("vulkan-headers" ,vulkan-headers)))
> +      (home-page "https://github.com/bkaradzic/bgfx")
> +      (synopsis  "Cross-platform, graphics API agnostic. rendering
> library")
A dot too much :)
> +      (description "bgfx is a cross-platform, graphics API agnostic,
> +'Bring Your Own Engine/Framework' style rendering library supporting
> Direct3D,
> +OpenGL, Metal, Vulkan and WebGL.")
> +      (license (list license:expat license:cc0)))))