From patchwork Sun Aug 29 04:29:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Tai X-Patchwork-Id: 32355 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 23C0027BBE3; Sun, 29 Aug 2021 05:31:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,MISSING_HEADERS, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8F70427BBE1 for ; Sun, 29 Aug 2021 05:31:24 +0100 (BST) Received: from localhost ([::1]:34572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKCTb-0008HD-HY for patchwork@mira.cbaines.net; Sun, 29 Aug 2021 00:31:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKCTH-0008Gf-9H for guix-patches@gnu.org; Sun, 29 Aug 2021 00:31:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKCTH-0000j5-1v for guix-patches@gnu.org; Sun, 29 Aug 2021 00:31:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mKCTG-0003DN-3Z for guix-patches@gnu.org; Sun, 29 Aug 2021 00:31:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50054] [PATCH] gnu: Add bgfx Resent-From: Andy Tai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 29 Aug 2021 04:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50054 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch Cc: 50054@debbugs.gnu.org Received: via spool by 50054-submit@debbugs.gnu.org id=B50054.163021143912307 (code B ref 50054); Sun, 29 Aug 2021 04:31:02 +0000 Received: (at 50054) by debbugs.gnu.org; 29 Aug 2021 04:30:39 +0000 Received: from localhost ([127.0.0.1]:55272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKCSo-0003CJ-L3 for submit@debbugs.gnu.org; Sun, 29 Aug 2021 00:30:38 -0400 Received: from mail-il1-f174.google.com ([209.85.166.174]:36421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKCSi-0003Bt-L9 for 50054@debbugs.gnu.org; Sun, 29 Aug 2021 00:30:33 -0400 Received: by mail-il1-f174.google.com with SMTP id x5so12046273ill.3 for <50054@debbugs.gnu.org>; Sat, 28 Aug 2021 21:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:cc; bh=YMM75xhzeppNVq1s7EbJ9fyAmt/nCjsupm4nK5o8czI=; b=oOkkC5RVdrtCxwB9c3HKGTmpiizay3Hwst+PeCLfF2H3W6xC6t2AGHeN5BaSnBPARk CK5JnMB3lZXwm6ZhDGPyZ6EIHyIB4XU7m7aiXTutrbrB5TqpSDlKY0fYfP1NXEFzsLrn azGOuiLKwuTcJao2/Qh1xAVNpRBKmZ6BmKkFVA3kDOVtfJZcSrKhf+zrhb2C0WPQJPl9 H9Gdy8Z/4SMT7peS1GC+I7F8IYStoeEh1CY9xS0aaUviOtnw9ZYY4TshVg2KBQQ3Xw3K flE5r9FuJnYCwSsT90412Idr4goOH4L9Nb7ifxznAoJDgKycRjP9CR51SrtaAxA3tmOM KVSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:cc; bh=YMM75xhzeppNVq1s7EbJ9fyAmt/nCjsupm4nK5o8czI=; b=ULr9TyAJAOsdcX7h5N/x2EoT7fSumHljofGHqpkgfIZ9joDzec9qfD8ekBSYcrGJyn yeovwUvG3veOpdQf1j7HWrkmPE6Dn4iavH0tdq5JtS4qsU7Zh/Mg/phpQf1q24K8+dBe NjVL5c1jBOeSh0CAK1TGE7IsXdjwOk5qTDbu9pD9BbqKyGcHVodVC4a+yKXD/SgprbdH 3z4eQEvzJ7cRrZMW0AOExuC4VxTy1Vs0H7TuIB9pi1OA/+ZIGgmDpyX50X5RtDPGG0vI NJt5zIr+cT6QeuCMe6MR3MFK5zH+0qJ9ul+qQkAmwpRCXYdJw0viFO6GzFGD3lhiw3c9 i/sw== X-Gm-Message-State: AOAM531JuPu9VKN5dj74RxV/tyzoaGMlWlMm8RALg3+WR5wRfdlsVuhi pZxSd2QMkVpWcbY8o+OUmOdF5Cj2vRWWyc3xNK6xU2eVdFE= X-Google-Smtp-Source: ABdhPJxm8e+SYsULcNRd7aNqPNvUE/gd7lvEaWwCa6LemjPAxxG+RF+M0qlIvmT9YkYcQsghnZOtqhRxEYeakklpWTk= X-Received: by 2002:a92:a012:: with SMTP id e18mr11323985ili.271.1630211422251; Sat, 28 Aug 2021 21:30:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andy Tai Date: Sat, 28 Aug 2021 21:29:46 -0700 Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches further update building the examples and the tools from source On Sat, Aug 28, 2021 at 8:25 PM Andy Tai 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 > > 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 From f772db933bba365e435e96f9441b5017305c8a04 Mon Sep 17 00:00:00 2001 From: Andy Tai 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