From 5b06a5d931fc6e484b12f22f57b3f3170be5e761 Mon Sep 17 00:00:00 2001 From: Petr Hodina Date: Sun, 24 Apr 2022 11:12:25 +0200 Subject: [PATCH v2 22/25] gnu: Add rust-glutin-0.28. * gnu/packages/crates-graphics.scm (rust-glutin-0.28): New variable. [home-page]: Update the URL. (rust-glutin-0.22): Inherit from above. * gnu/local.mk: Add patch. * gnu/packages/patches/rust-glutin-remove-windows-ios.patch: New file. diff --git a/gnu/local.mk b/gnu/local.mk index 7b5c9820bb..c8efbe4516 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1774,6 +1774,7 @@ dist_patch_DATA = \ %D%/packages/patches/rustc-1.39.0-src.patch \ %D%/packages/patches/rust-adblock-ignore-live-tests.patch \ %D%/packages/patches/i3status-rust-enable-unstable-features.patch \ + %D%/packages/patches/rust-glutin-remove-windows-ios.patch \ %D%/packages/patches/rust-ndarray-remove-blas-src-dep.patch \ %D%/packages/patches/rust-ndarray-0.13-remove-blas-src.patch \ %D%/packages/patches/rust-ndarray-0.14-remove-blas-src.patch \ diff --git a/gnu/packages/crates-graphics.scm b/gnu/packages/crates-graphics.scm index e22a16f184..d5a698fae1 100644 --- a/gnu/packages/crates-graphics.scm +++ b/gnu/packages/crates-graphics.scm @@ -967,48 +967,50 @@ (define-public rust-gleam-0.6 "Generated OpenGL bindings and wrapper for Servo.") (license (list license:asl2.0 license:expat)))) -(define-public rust-glutin-0.26 +(define-public rust-glutin-0.28 (package (name "rust-glutin") - (version "0.26.0") + (version "0.28.0") (source (origin (method url-fetch) (uri (crate-uri "glutin" version)) (file-name (string-append name "-" version ".tar.gz")) + (patches (search-patches "rust-glutin-remove-windows-ios.patch")) (sha256 - (base32 "18szbh4dixcr7pmymvbrpv21hv0wrpii5w03rv2534bb2ywwpq8s")))) + (base32 "1lpnf61x4jbm55bpdr10k1a1pl3cs719i9y4qibsdj2bajz9vsh0")))) (build-system cargo-build-system) (arguments `(#:cargo-inputs - (("rust-android-glue" ,rust-android-glue-0.2) - ("rust-cgl" ,rust-cgl-0.3) - ("rust-cocoa" ,rust-cocoa-0.23) - ("rust-core-foundation" ,rust-core-foundation-0.9) - ("rust-glutin-egl-sys" ,rust-glutin-egl-sys-0.1) + (("rust-glutin-egl-sys" ,rust-glutin-egl-sys-0.1) ("rust-glutin-emscripten-sys" ,rust-glutin-emscripten-sys-0.1) ("rust-glutin-gles2-sys" ,rust-glutin-gles2-sys-0.1) ("rust-glutin-glx-sys" ,rust-glutin-glx-sys-0.1) ("rust-glutin-wgl-sys" ,rust-glutin-wgl-sys-0.1) ("rust-lazy-static" ,rust-lazy-static-1) - ("rust-libloading" ,rust-libloading-0.6) + ("rust-libloading" ,rust-libloading-0.7) ("rust-log" ,rust-log-0.4) - ("rust-objc" ,rust-objc-0.2) ("rust-osmesa-sys" ,rust-osmesa-sys-0.1) ("rust-parking-lot" ,rust-parking-lot-0.11) - ("rust-wayland-egl" ,rust-wayland-egl-0.28) - ("rust-winapi" ,rust-winapi-0.3) - ("rust-winit" ,rust-winit-0.24)))) + ("rust-wayland-egl" ,rust-wayland-egl-0.29) + ("rust-winit" ,rust-winit-0.26)) + #: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 rust-wayland-egl-0.28)) - (home-page "https://github.com/tomaka/glutin") + (list rust-wayland-client-0.29 rust-wayland-egl-0.29)) + (home-page "https://github.com/rust-windowing/glutin") (synopsis "Cross-platform OpenGL context provider") (description "This package provides an OpenGL context provider.") (license license:asl2.0))) (define-public rust-glutin-0.22 (package - (inherit rust-glutin-0.26) + (inherit rust-glutin-0.28) (name "rust-glutin") (version "0.22.0-alpha5") (source diff --git a/gnu/packages/patches/rust-glutin-remove-windows-ios.patch b/gnu/packages/patches/rust-glutin-remove-windows-ios.patch new file mode 100644 index 0000000000..b3c61028b4 --- /dev/null +++ b/gnu/packages/patches/rust-glutin-remove-windows-ios.patch @@ -0,0 +1,43 @@ +This patch removes crates for Windows and IOS as GNU Guix does not support +building for these platforms. +--- glutin-0.28.0/Cargo.toml.orig 1973-11-29 22:33:09.000000000 +0100 ++++ glutin-0.28.0/Cargo.toml.orig 2022-04-24 13:35:36.333502368 +0200 +@@ -24,38 +24,9 @@ + lazy_static = "1.3" + winit = { version = "0.26", default-features = false } + +-[target.'cfg(target_os = "android")'.dependencies] +-android_glue = "0.2" +-glutin_egl_sys = { version = "0.1.5", path = "../glutin_egl_sys" } +-parking_lot = "0.11" +- + [target.'cfg(target_os = "emscripten")'.dependencies] + glutin_emscripten_sys = { version = "0.1.1", path = "../glutin_emscripten_sys" } + +-[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies] +-objc = "0.2.6" +-glutin_gles2_sys = { version = "0.1.5", path = "../glutin_gles2_sys" } +- +-[target.'cfg(target_os = "macos")'.dependencies] +-cgl = "0.3" +-cocoa = "0.24" +-core-foundation = "0.9" +- +-[target.'cfg(target_os = "windows")'.dependencies.winapi] +-version = "0.3" +-features = [ +- "winnt", +- "winuser", +- "wingdi", +- "libloaderapi", +-] +- +-[target.'cfg(target_os = "windows")'.dependencies] +-libloading = "0.7" +-glutin_wgl_sys = { version = "0.1.5", path = "../glutin_wgl_sys" } +-glutin_egl_sys = { version = "0.1.5", path = "../glutin_egl_sys" } +-parking_lot = "0.11" +- + [target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies] + osmesa-sys = "0.1" + wayland-client = { version = "0.29", features = ["dlopen"], optional = true } -- 2.35.1