all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Tai <lichengtai@gmail.com>
Cc: 50054@debbugs.gnu.org
Subject: [bug#50054] [PATCH] gnu: Add bgfx
Date: Sat, 28 Aug 2021 21:29:46 -0700	[thread overview]
Message-ID: <CAJsg1E9zF591MxhCFekOtheVB0CU2zwNPxD9MKAb=YvV1DFE0A@mail.gmail.com> (raw)
In-Reply-To: <CAJsg1E_56n1URitX-YShd4WnAbKcwr=PaA0__dd-HRFuyweKgw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1679 bytes --]

further update

building the examples and the tools from source

On Sat, Aug 28, 2021 at 8:25 PM Andy Tai <lichengtai@gmail.com> wrote:
>
> updated patch attached:
>
> directly checking out additional source repos rather than relying on
> git submodule
>
> first attempt at removing "nasty" stuff, removing bx/tools/bin
>
> > On Mon, Aug 16, 2021 at 5:52 AM Leo Prikler
> > <leo.prikler@student.tugraz.at> wrote:
> > >
> > > Hi,
> > >
> > > Am Montag, den 16.08.2021, 05:42 -0700 schrieb Andy Tai:
> > > > Leo, by "nasty stuff" you meant non-free stuff (I doubt if there is
> > > > any in a graphics library but will check), or you meant the embedded
> > > > packages that shall be reference to other packages in guix (if
> > > > packaged already)?   I think the embedded copies of other stuff may
> > > > have local customization that may make it impossible to simply build
> > > > with the existing packages in guix.
> > > Nasty stuff are not only already existing packages, but also outdated
> > > versions thereof.  If there are heavily customized versions or packages
> > > not yet included in Guix, then those can be left in (but with a
> > > remark!), though in the long term it would be better to make those
> > > packages work with upstream versions rather than require specific
> > > tweaking.
> > >
> > > The other thing I already mentioned are binaries, which upstream seems
> > > also aware about, see e.g.
> > > https://github.com/bkaradzic/bgfx/commit/caed3f91026bf0e703f1eaf6f622e27b820df86c



-- 
Andy Tai, atai@atai.org
Year 2021 民國110年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能

[-- Attachment #2: 0001-gnu-Add-bgfx.patch --]
[-- Type: text/x-patch, Size: 4490 bytes --]

From f772db933bba365e435e96f9441b5017305c8a04 Mon Sep 17 00:00:00 2001
From: Andy Tai <atai@atai.org>
Date: Sat, 28 Aug 2021 21:27:36 -0700
Subject: [PATCH] gnu: Add bgfx
To: guix-patches@gnu.org

* gnu/packages/graphics.scm (bgfx): New variable
---
 gnu/packages/graphics.scm | 82 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 38feb27c87..3027eac61e 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -2000,3 +2000,85 @@ 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 "b029632186b897a7d65486f9809d65b3eb900abf")
+        (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)))
+         (file-name (git-file-name "bgfx.cmake" version))
+         (sha256
+          (base32
+           "1j19a0ya1mi8vls6696b4zyb573hk8qil9lrzqd2anlrfn2xn395"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:configure-flags
+         '("-DBGFX_BUILD_TOOLS=TRUE"
+           "-DBGFX_BUILD_EXAMPLES=TRUE")
+
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'unpack-submodule-sources
+             (lambda* (#:key inputs #:allow-other-keys)
+               (delete-file-recursively "bx")
+               (delete-file-recursively "bimg")
+               (delete-file-recursively "bgfx")
+
+               (copy-recursively (assoc-ref inputs "bx")
+                                 "./bx")
+               (copy-recursively (assoc-ref inputs "bimg")
+                                 "./bimg")
+               (copy-recursively (assoc-ref inputs "bgfx")
+                                 "./bgfx")
+               ;; delete binaries from upstream git repos
+               (delete-file-recursively "bx/tools/bin")
+               ;; delete extra 3rd party code not needed for bgfx to function on Guix
+               ;; note dear-imgui local copy in bgfx heavily modified from original upstream
+               ;; so we for now can not use the upstream dear-imgui for bgfx
+               (delete-file-recursively "bgfx/3rdparty/dxsdk")
+               #t)))
+
+         #:tests? #f)) ;; no tests
+      (inputs
+       `(("glslang" ,glslang)
+         ("libxcb" ,libxcb)
+         ("opengl" ,mesa)
+         ("vulkan-loader" ,vulkan-loader)))
+      (native-inputs
+       (let ((additional-repo (lambda (url commit name hash)
+                                (origin
+                                  (method git-fetch)
+                                  (uri (git-reference
+                                        (url url)
+                                        (commit commit)))
+                                  (file-name (git-file-name name commit))
+                                  (sha256 (base32 hash))))))
+         `(("bx"
+            ,(additional-repo "https://github.com/bkaradzic/bx"
+                              "9978d894cb54efc0fcb874461f3127cbe8e55b33"
+                              "bx" "0r98x2fdklldvkswda1hld6igzd0kzm21d0fhfdwi6401a718dyx"))
+           ("bimg"
+            ,(additional-repo "https://github.com/bkaradzic/bimg"
+                              "0b6febf2b0ba07f5fd5de6a30acaf7c3afdb9921"
+                              "bimg" "1a0d43ryv6hzssq18ri0rqb1zvqs62x7qp98mdc5qhgbn46bqg9z"))
+           ("bgfx"
+            ,(additional-repo "https://github.com/bkaradzic/bgfx"
+                              "f26885aaed87ce6c39e8862212d62f82ff4a93ac"
+                              "bgfx" "037h4m4kxxl9ii5f7bs8gwihcih0ydzkv5bh0jx1s22g3bbkvkr0"))
+           ("pkg-config" ,pkg-config)
+           ("vulkan-headers" ,vulkan-headers))))
+      (home-page "https://github.com/bkaradzic/bgfx")
+      (synopsis  "Cross-platform, graphics API agnostic, rendering library")
+      (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:bsd-2 license:cc0)))))
-- 
2.33.0


  reply	other threads:[~2021-08-29  4:31 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-14  8:35 [bug#50054] [PATCH] gnu: Add bgfx Andy Tai
     [not found] ` <handler.50054.B.162893018622105.ack@debbugs.gnu.org>
2021-08-14  8:51   ` [bug#50054] Acknowledgement ([PATCH] gnu: Add bgfx) Andy Tai
2021-08-14  9:43 ` [bug#50054] [PATCH] gnu: Add bgfx Leo Prikler
2021-08-14 18:07   ` Andy Tai
2021-08-14 18:24     ` Andy Tai
2021-08-14 18:48       ` Leo Prikler
2021-08-16 12:42         ` Andy Tai
2021-08-16 12:52           ` Leo Prikler
2021-08-29  3:16             ` Andy Tai
2021-08-29  3:25               ` Andy Tai
2021-08-29  4:29                 ` Andy Tai [this message]
2021-08-29 11:41                   ` Leo Prikler
2021-08-29 18:21                     ` Andy Tai
2021-08-29 20:04                       ` Leo Prikler
2021-08-29 23:59                         ` Andy Tai
2021-08-27 17:49 ` [bug#50054] dependency Andy Tai
2021-08-27 18:31   ` Tobias Geerinckx-Rice via Guix-patches via
2024-04-23  5:51 ` [bug#50054] [PATCH v2 0/3] *** Add bgfx and dependencies *** Andy Tai
2024-04-23  5:51   ` [bug#50054] [PATCH v2 1/3] gnu: Add bx Andy Tai
2024-05-13 12:37     ` Ludovic Courtès
2024-04-23  5:51   ` [bug#50054] [PATCH v2 2/3] gnu: Add bimg Andy Tai
2024-04-23  5:51   ` [bug#50054] [PATCH v2 3/3] gnu: Add bgfx Andy Tai
2024-05-13 12:40     ` Ludovic Courtès
2024-05-17  6:17 ` [bug#50054] [PATCH v3 0/3] Add bgfx and dependencies Andy Tai
2024-05-17  6:17   ` [bug#50054] [PATCH v3 1/3] gnu: Add bx Andy Tai
2024-05-17  6:17   ` [bug#50054] [PATCH v3 2/3] gnu: Add bimg Andy Tai
2024-05-17  6:17   ` [bug#50054] [PATCH v3 3/3] gnu: Add bgfx Andy Tai
2024-05-18  6:22 ` [bug#50054] [PATCH v3 0/3] Add bgfx and dependencies Andy Tai
2024-05-18  6:22   ` [bug#50054] [PATCH v3 1/3] gnu: Add bx Andy Tai
2024-05-18  6:22   ` [bug#50054] [PATCH v3 2/3] gnu: Add bimg Andy Tai
2024-05-18  6:22   ` [bug#50054] [PATCH v3 3/3] gnu: Add bgfx Andy Tai
2024-05-27  0:44 ` [bug#50054] ping Andy Tai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJsg1E9zF591MxhCFekOtheVB0CU2zwNPxD9MKAb=YvV1DFE0A@mail.gmail.com' \
    --to=lichengtai@gmail.com \
    --cc=50054@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.