summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Tai <atai@atai.org>2024-04-22 22:51:50 -0700
committerGuix Patches Tester <>2024-04-23 10:04:19 +0200
commit4463afbc75918b5cd08c2cfe6d4b59f7934c1279 (patch)
treedf8de725b1fc3e18fd13288fa1e451f229ae53ef
parentb1356c3d031bc45a018de66b8af06075b1b6aa8c (diff)
downloadguix-patches-issue-50054.tar
guix-patches-issue-50054.tar.gz
gnu: Add bgfx.issue-50054
* gnu/packages/graphics.scm (bgfx): New variable. Change-Id: I2737803c838229ed04fbfe30d0e67749444d871b
-rw-r--r--gnu/packages/graphics.scm85
1 files changed, 85 insertions, 0 deletions
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 88e01b46bf..dce66f63ec 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -3017,6 +3017,91 @@ Bgfx graphics library.")
Bgfx graphics library.")
(license license:bsd-2))))
+(define-public bgfx
+ (let ((commit "932302d8f460e514b933deba8c0e575a00f0bcd6")
+ (revision "1"))
+ (package
+ (name "bgfx")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/bkaradzic/bgfx")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (modules '((guix build utils)))
+ (sha256
+ (base32 "0by2is3qzbhg0m3wv7np28l6k9hm0lr5ybc2z7fc5c8x3afqcxzr"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:tests? #f ;there are no tests
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+
+ (replace 'build
+ (lambda _
+ (for-each (lambda (target)
+ (invoke "make"
+ "-j"
+ (number->string (parallel-job-count))
+ target
+
+ (string-append "BX_DIR="
+ #$(this-package-input
+ "bx-sources"))
+ (string-append "BIMG_DIR="
+ #$(this-package-input
+ "bimg-sources"))
+ (string-append "NINJA="
+ #$(this-package-native-input
+ "ninja")
+ "/bin/ninja")
+ (string-append "GENIE="
+ #$(this-package-native-input
+ "genie")
+ "/bin/genie")))
+ (list "linux-release64" "tools"))))
+ ;; (replace 'check
+ ;; (lambda _
+ ;; (invoke "make" "test")))
+ (replace 'install
+ (lambda _
+ (for-each (lambda (f)
+ (install-file f
+ (string-append #$output
+ "/bin")))
+ (find-files "./tools/bin/linux"))
+ (for-each (lambda (f)
+ (install-file f
+ (string-append #$output
+ "/lib")))
+ (find-files ".build/linux64_gcc" "\\.a$"))
+ (for-each (lambda (f)
+ (install-file f
+ (string-append #$output
+ "/lib")))
+ (find-files ".build/linux64_gcc" "\\.so$"))
+ (copy-recursively "include/bgfx"
+ (string-append #$output
+ "/include/bgfx"))))
+
+ )))
+ (native-inputs (list genie ninja))
+ (inputs `(("bx-sources" ,(package-source bx))
+ ("bimg-sources" ,(package-source bimg))
+ ("mesa" ,mesa)
+ ("mesa-headers" ,mesa-headers)
+ ("vulkan-headers" ,vulkan-headers)))
+ (home-page "https://bkaradzic.github.io/bgfx/overview.html")
+ (synopsis "Cross-platform rendering library")
+ (description
+ "bgfx is a cross-platform, graphics API agnostic,
+Bring Your Own Engine/Framework' style rendering library supporting Direct3D,
+OpenGL/OpenGL ES, Metal, Vulkan and WebGL.")
+ (license license:bsd-2))))
+
(define-public gpaint
(package
(name "gpaint")