From 84c70fd18a9f6f9199d287b2fc43b53dfb4926d1 Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Sun, 7 May 2023 14:26:21 +0100 Subject: gnu: Add rust-webbrowser-0.8. * gnu/packages/crates-io.scm (rust-webbrowser-0.8): New variable. (rust-webbrowser-0.5): Inherit from rust-webbrowser-0.8. * gnu/packages/patches/rust-webbrowser-remove-unsupported-os.patch: New file. * gnu/local.mk: Register it. Signed-off-by: Efraim Flashner --- gnu/local.mk | 1 + gnu/packages/crates-io.scm | 39 +++++++++++++++++----- .../rust-webbrowser-remove-unsupported-os.patch | 24 +++++++++++++ 3 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 gnu/packages/patches/rust-webbrowser-remove-unsupported-os.patch (limited to 'gnu') diff --git a/gnu/local.mk b/gnu/local.mk index a882fc883e..dfb8930771 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1870,6 +1870,7 @@ dist_patch_DATA = \ %D%/packages/patches/rust-nettle-disable-vendor.patch \ %D%/packages/patches/rust-nettle-sys-disable-vendor.patch \ %D%/packages/patches/rust-openssl-sys-no-vendor.patch \ + %D%/packages/patches/rust-webbrowser-remove-unsupported-os.patch \ %D%/packages/patches/rust-wl-clipboard-rs-newer-wl.patch \ %D%/packages/patches/rw-igraph-0.10.patch \ %D%/packages/patches/sbc-fix-build-non-x86.patch \ diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index f581902a6c..3547d67fac 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -71399,8 +71399,38 @@ applications.") "Bindings for all Web APIs, a procedurally generated crate from WebIDL.") (license (list license:expat license:asl2.0)))) +(define-public rust-webbrowser-0.8 + (package + (name "rust-webbrowser") + (version "0.8.8") + (source + (origin + (method url-fetch) + (uri (crate-uri "webbrowser" version)) + (file-name (string-append name "-" version ".tar.gz")) + ;; Explicitely remove dependencies for unsupported operating systems, + ;; to avoid pulling many dependencies and causing rust world rebuilds. + (patches (search-patches "rust-webbrowser-remove-unsupported-os.patch")) + (patch-flags '("-p0")) + (sha256 + (base32 "0zk1qidyksspa8pgvq8bh2lyqmmrs0fr5r1qsyhbzrawpn2w972p")))) + (build-system cargo-build-system) + (arguments + `(#:skip-build? #t + #:cargo-inputs (("rust-dirs" ,rust-dirs-4) + ("rust-log" ,rust-log-0.4) + ("rust-url" ,rust-url-2) + ("rust-web-sys" ,rust-web-sys-0.3)))) + (home-page "https://github.com/amodm/webbrowser-rs") + (synopsis "Open URLs in web browsers available on a platform") + (description + "Webbrowser-rs is a Rust library to open URLs in the web browsers +available on a platform.") + (license (list license:expat license:asl2.0)))) + (define-public rust-webbrowser-0.5 (package + (inherit rust-webbrowser-0.8) (name "rust-webbrowser") (version "0.5.5") (source @@ -71416,14 +71446,7 @@ applications.") #:cargo-inputs (("rust-web-sys" ,rust-web-sys-0.3) ("rust-widestring" ,rust-widestring-0.4) - ("rust-winapi" ,rust-winapi-0.3)))) - (home-page - "https://github.com/amodm/webbrowser-rs") - (synopsis "Open URLs in web browsers available on a platform") - (description - "Webbrowser-rs is a Rust library to open URLs in the web browsers -available on a platform.") - (license (list license:expat license:asl2.0)))) + ("rust-winapi" ,rust-winapi-0.3)))))) (define-public rust-webpki-0.22 (package diff --git a/gnu/packages/patches/rust-webbrowser-remove-unsupported-os.patch b/gnu/packages/patches/rust-webbrowser-remove-unsupported-os.patch new file mode 100644 index 0000000000..9fea1e1665 --- /dev/null +++ b/gnu/packages/patches/rust-webbrowser-remove-unsupported-os.patch @@ -0,0 +1,24 @@ +--- Cargo.toml 2023-05-07 13:39:13.029066693 +0100 ++++ Cargo.toml 2023-05-07 13:39:22.545138206 +0100 +@@ -67,21 +67,3 @@ + [target."cfg(target_arch = \"wasm32\")".dependencies.web-sys] + version = "0.3" + features = ["Window"] +- +-[target."cfg(target_os = \"android\")".dependencies.jni] +-version = "0.21" +- +-[target."cfg(target_os = \"android\")".dependencies.ndk-context] +-version = "0.1" +- +-[target."cfg(target_os = \"android\")".dev-dependencies.ndk-glue] +-version = ">= 0.3, <= 0.7" +- +-[target."cfg(target_os = \"ios\")".dependencies.objc] +-version = "0.2.7" +- +-[target."cfg(target_os = \"ios\")".dependencies.raw-window-handle] +-version = "0.5.0" +- +-[target."cfg(target_os = \"macos\")".dependencies.core-foundation] +-version = "0.9" -- cgit 1.4.1