summaryrefslogtreecommitdiff
path: root/gnu/packages/graphics.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/graphics.scm')
-rw-r--r--gnu/packages/graphics.scm90
1 files changed, 90 insertions, 0 deletions
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 678e916b7c..ec1b490819 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -3089,6 +3089,96 @@ to be able to write cross-platform applications.
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="
+ #$(package-source bx))
+ (string-append "BIMG_DIR="
+ #$(package-source bimg))
+ (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 (list mesa mesa-headers vulkan-headers))
+ (home-page "https://bkaradzic.github.io/bgfx/overview.html")
+ (synopsis "Cross-platform, graphics API agnostic,
+\"Bring Your Own Framework\" rendering library")
+ (description
+ "bgfx is a Cross-platform, graphics API agnostic rendering library
+providing the same graphics APIs over
+@itemize
+@item Direct3D 11
+@item Direct3D 12
+@item GNM (only for licensed PS4 developers, search DevNet forums for source)
+@item Metal
+@item OpenGL 2.1
+@item OpenGL 3.1+
+@item OpenGL ES 2
+@item OpenGL ES 3.1
+@item Vulkan
+@item WebGL 1.0
+@item WebGL 2.0
+@end itemize")
+ (license license:bsd-2))))
+
(define-public gpaint
(package
(name "gpaint")