summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2024-01-04 11:17:34 +0200
committerEfraim Flashner <efraim@flashner.co.il>2024-02-20 13:57:13 +0200
commit980190846b8a5f16fdf0b29d528ea35ed3f26463 (patch)
treea182cb023ef2f6fec263e15d4ebb2040ef521995 /gnu/packages
parent59aa37d88f975519e776d68513ba462edc37e71b (diff)
downloadguix-980190846b8a5f16fdf0b29d528ea35ed3f26463.tar.gz
gnu: Add rust-softbuffer-0.3.
* gnu/packages/crates-graphics.scm (rust-softbuffer-0.3): New variable.

Change-Id: Ib40844b520d990335baa4f38aebe91151c787127
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/crates-graphics.scm90
1 files changed, 89 insertions, 1 deletions
diff --git a/gnu/packages/crates-graphics.scm b/gnu/packages/crates-graphics.scm
index 7b42ec588c..9d48980344 100644
--- a/gnu/packages/crates-graphics.scm
+++ b/gnu/packages/crates-graphics.scm
@@ -46,7 +46,11 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages version-control)
-  #:use-module (gnu packages video))
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages vulkan)
+  #:use-module (gnu packages xdisorg)
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages xorg))
 
 ;;;
 ;;; Please: Try to add new module packages in alphabetic order.
@@ -3197,6 +3201,90 @@ applications.")
        #:cargo-development-inputs
        (("rust-smithay-client-toolkit" ,rust-smithay-client-toolkit-0.16))))))
 
+(define-public rust-softbuffer-0.3
+  (package
+    (name "rust-softbuffer")
+    (version "0.3.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "softbuffer" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0j199d8zg964324sppk1gnkq2361ivay7ykrlm71npg8v3ma4vc2"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-as-raw-xcb-connection" ,rust-as-raw-xcb-connection-1)
+                       ("rust-bytemuck" ,rust-bytemuck-1)
+                       ("rust-cfg-aliases" ,rust-cfg-aliases-0.1)
+                       ("rust-cocoa" ,rust-cocoa-0.25)
+                       ("rust-core-graphics" ,rust-core-graphics-0.23)
+                       ("rust-drm" ,rust-drm-0.10)
+                       ("rust-fastrand" ,rust-fastrand-2)
+                       ("rust-foreign-types" ,rust-foreign-types-0.5)
+                       ("rust-js-sys" ,rust-js-sys-0.3)
+                       ("rust-log" ,rust-log-0.4)
+                       ("rust-memmap2" ,rust-memmap2-0.9)
+                       ("rust-objc" ,rust-objc-0.2)
+                       ("rust-raw-window-handle" ,rust-raw-window-handle-0.5)
+                       ("rust-redox-syscall" ,rust-redox-syscall-0.4)
+                       ("rust-rustix" ,rust-rustix-0.38)
+                       ("rust-tiny-xlib" ,rust-tiny-xlib-0.2)
+                       ("rust-wasm-bindgen" ,rust-wasm-bindgen-0.2)
+                       ("rust-wayland-backend" ,rust-wayland-backend-0.3)
+                       ("rust-wayland-client" ,rust-wayland-client-0.31)
+                       ("rust-wayland-sys" ,rust-wayland-sys-0.31)
+                       ("rust-web-sys" ,rust-web-sys-0.3)
+                       ("rust-windows-sys" ,rust-windows-sys-0.48)
+                       ("rust-x11rb" ,rust-x11rb-0.12))
+       #:cargo-development-inputs
+       (("rust-colorous" ,rust-colorous-1)
+        ("rust-criterion" ,rust-criterion-0.4)
+        ("rust-image" ,rust-image-0.24)
+        ("rust-instant" ,rust-instant-0.1)
+        ("rust-rayon" ,rust-rayon-1)
+        ("rust-rustix" ,rust-rustix-0.38)
+        ("rust-wasm-bindgen-test" ,rust-wasm-bindgen-test-0.3)
+        ("rust-winit" ,rust-winit-0.28)
+        ("rust-winit-test" ,rust-winit-test-0.1))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'configure 'add-absolute-library-references
+           (lambda* (#:key inputs vendor-dir #:allow-other-keys)
+             (substitute* (find-files vendor-dir "\\.rs$")
+               (("libX11\\.so")
+                (search-input-file inputs "lib/libX11.so"))
+               (("libX11-xcb\\.so")
+                (search-input-file inputs "lib/libX11-xcb.so"))
+               ;; Lots of libraries from rust-x11-dl and others.
+               (("libX[[:alpha:]]*\\.so" all)
+                (search-input-file inputs (string-append "lib/" all))))))
+         (add-before 'check 'pre-check
+           (lambda* (#:key native-inputs inputs #:allow-other-keys)
+             ;; Most tests require an X server.
+             (let ((xvfb (search-input-file (or native-inputs inputs)
+                                            "bin/Xvfb"))
+                   (display ":1"))
+               (setenv "DISPLAY" display)
+               (system (string-append xvfb " " display " &"))))))))
+    (inputs (list libx11
+                  libxcursor
+                  libxext
+                  libxft
+                  libxi
+                  libxinerama
+                  libxmu
+                  libxpresent
+                  libxrandr
+                  libxscrnsaver
+                  libxt
+                  libxtst))
+    (native-inputs (list xorg-server-for-tests))
+    (home-page "https://github.com/rust-windowing/softbuffer")
+    (synopsis "Cross-platform software buffer")
+    (description "Cross-platform software buffer.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-tiff-0.9
   (package
     (name "rust-tiff")