From cd3bfcc799453174fbbcf894553762d74b1aa127 Mon Sep 17 00:00:00 2001 From: Petr Hodina Date: Sun, 24 Apr 2022 08:56:06 +0200 Subject: [PATCH v2 19/25] gnu: Add rust-winit-0.26. * gnu/packages/crates-graphics.scm (rust-winit-0.26): New variable. [description]: Add double space after period. (rust-winit-0.20): Inherit from above. (rust-winit-0.24): Remove variable. * gnu/local.mk: Add patch. * gnu/packages/patches/rust-winit-remove-windows-and-ios.patch: New file. diff --git a/gnu/local.mk b/gnu/local.mk index 9bad87710c..7b5c9820bb 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1781,6 +1781,7 @@ dist_patch_DATA = \ %D%/packages/patches/rust-nettle-sys-disable-vendor.patch \ %D%/packages/patches/rust-openssl-sys-no-vendor.patch \ %D%/packages/patches/rust-shell2batch-lint-fix.patch \ + %D%/packages/patches/rust-winit-remove-windows-and-ios.patch \ %D%/packages/patches/rust-wl-clipboard-rs-newer-wl.patch \ %D%/packages/patches/sbc-fix-build-non-x86.patch \ %D%/packages/patches/sbcl-aserve-add-HTML-5-elements.patch \ diff --git a/gnu/packages/crates-graphics.scm b/gnu/packages/crates-graphics.scm index c8d0b56612..9c31b0d415 100644 --- a/gnu/packages/crates-graphics.scm +++ b/gnu/packages/crates-graphics.scm @@ -2925,17 +2925,18 @@ (define-public rust-wayland-sys-0.21 (base32 "0a0ndgkg98pvmkv44yya4f7mxzjaxylknqh64bpa05w0azyv02jj")))))) -(define-public rust-winit-0.24 +(define-public rust-winit-0.26 (package (name "rust-winit") - (version "0.24.0") + (version "0.26.1") (source (origin (method url-fetch) (uri (crate-uri "winit" version)) (file-name (string-append name "-" version ".tar.gz")) + (patches (search-patches "rust-winit-remove-windows-and-ios.patch")) (sha256 - (base32 "15zmpx5ip6ziqhds7md1s0ri0blhxfa8fg1ylg84pf0frrpxlkns")))) + (base32 "0fp7cdh7llbqmm6ga8f6bzk9785jmkbyy1w631hr9faq3n9wqhwv")))) (build-system cargo-build-system) (arguments `(#:skip-build? #t @@ -2950,28 +2951,36 @@ (define-public rust-winit-0.24 ("rust-lazy-static" ,rust-lazy-static-1) ("rust-libc" ,rust-libc-0.2) ("rust-log" ,rust-log-0.4) - ("rust-mio" ,rust-mio-0.6) + ("rust-mint" ,rust-mint-0.5) + ("rust-mio" ,rust-mio-0.8) ("rust-mio-extras" ,rust-mio-extras-2) - ("rust-ndk" ,rust-ndk-0.2) - ("rust-ndk-glue" ,rust-ndk-glue-0.2) - ("rust-ndk-sys" ,rust-ndk-sys-0.2) ("rust-objc" ,rust-objc-0.2) ("rust-parking-lot" ,rust-parking-lot-0.11) ("rust-percent-encoding" ,rust-percent-encoding-2) - ("rust-raw-window-handle" ,rust-raw-window-handle-0.3) + ("rust-raw-window-handle" ,rust-raw-window-handle-0.4) ("rust-serde" ,rust-serde-1) - ("rust-smithay-client-toolkit" ,rust-smithay-client-toolkit-0.12) + ("rust-smithay-client-toolkit" ,rust-smithay-client-toolkit-0.15) ("rust-stdweb" ,rust-stdweb-0.4) ("rust-wasm-bindgen" ,rust-wasm-bindgen-0.2) - ("rust-web-sys" ,rust-web-sys-0.3) ("rust-winapi" ,rust-winapi-0.3) - ("rust-x11-dl" ,rust-x11-dl-2)))) + ("rust-x11-dl" ,rust-x11-dl-2)) + #:cargo-development-inputs + (("rust-console-log" ,rust-console-log-0.2) + ("rust-image" ,rust-image-0.23) + ("rust-simple-logger" ,rust-simple-logger-1)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-version-requirements + (lambda _ + ;; Remove windows and ios, the patch applies to Cargo.toml.orig + (delete-file "Cargo.toml") + (rename-file "Cargo.toml.orig" "Cargo.toml")))))) (inputs - (list rust-wayland-client-0.28)) + (list rust-wayland-client-0.29 rust-wayland-protocols-0.29)) (home-page "https://github.com/rust-windowing/winit") (synopsis "Window creation library") (description - "Winit is a window creation and management library. It can create + "Winit is a window creation and management library. It can create windows and lets you handle events (for example: the window being resized, a key being pressed, a mouse movement, etc.) produced by window. @@ -2983,7 +2992,7 @@ (define-public rust-winit-0.24 (define-public rust-winit-0.20 (package - (inherit rust-winit-0.24) + (inherit rust-winit-0.26) (name "rust-winit") (version "0.20.0-alpha6") (source diff --git a/gnu/packages/patches/rust-winit-remove-windows-and-ios.patch b/gnu/packages/patches/rust-winit-remove-windows-and-ios.patch new file mode 100644 index 0000000000..b04b45e2c4 --- /dev/null +++ b/gnu/packages/patches/rust-winit-remove-windows-and-ios.patch @@ -0,0 +1,60 @@ +This patch is tailor to GNU Guix and removes crates for Windows and IOS +since there is currently no support. +--- winit-0.26.1/Cargo.toml.orig 1973-11-29 22:33:09.000000000 +0100 ++++ winit-0.26.1/Cargo.toml.orig 2022-04-24 08:46:19.456166934 +0200 +@@ -35,55 +35,6 @@ + image = "0.23.12" + simple_logger = "1.9" + +-[target.'cfg(target_os = "android")'.dependencies] +-ndk = "0.5" +-ndk-sys = "0.2.0" +-ndk-glue = "0.5" +- +-[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies] +-objc = "0.2.7" +- +-[target.'cfg(target_os = "macos")'.dependencies] +-cocoa = "0.24" +-core-foundation = "0.9" +-core-graphics = "0.22" +-dispatch = "0.2.0" +- +-[target.'cfg(target_os = "macos")'.dependencies.core-video-sys] +-version = "0.1.4" +-default_features = false +-features = ["display_link"] +- +-[target.'cfg(target_os = "windows")'.dependencies] +-parking_lot = "0.11" +- +-[target.'cfg(target_os = "windows")'.dependencies.winapi] +-version = "0.3.9" +-features = [ +- "combaseapi", +- "commctrl", +- "dwmapi", +- "errhandlingapi", +- "imm", +- "hidusage", +- "libloaderapi", +- "objbase", +- "ole2", +- "processthreadsapi", +- "shellapi", +- "shellscalingapi", +- "shobjidl_core", +- "unknwnbase", +- "winbase", +- "windowsx", +- "winerror", +- "wingdi", +- "winnt", +- "winuser", +- "mmsystem", +- "timeapi" +-] +- + [target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies] + wayland-client = { version = "0.29", default_features = false, features = ["use_system_lib"], optional = true } + wayland-protocols = { version = "0.29", features = [ "staging_protocols"], optional = true } -- 2.35.1