From 0eee6c1b2f8607c55360eef6316952b0f5375451 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 27 Oct 2020 11:33:25 +0000 Subject: gnu: Add fractal. * gnu/packages/gnome-xyz.scm (fractal): New variable. --- gnu/packages/gnome-xyz.scm | 206 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm index b867acde71..33f5599e02 100644 --- a/gnu/packages/gnome-xyz.scm +++ b/gnu/packages/gnome-xyz.scm @@ -181,6 +181,212 @@ the Obsidian icon theme.") ") (license license:gpl3))) +(define-public fractal + (package + (name "fractal") + (version "4.2.2") ; later versions have an odd + ; dependency on rust-sourceview4 and + ; rust-either + (source + (origin + (method url-fetch) + (uri (string-append + "https://gitlab.gnome.org/GNOME/fractal/uploads/" + "9f2b34d98cfe3c002f3afbfcbf14bc7c/" + "fractal-" version ".tar.xz")) + (sha256 + (base32 + "1zviqc0wkvqslajjd0rmdn1dn926w6i5aplcc26y01vs15jrl39j")))) + (build-system cargo-build-system) + (arguments + `(#:imported-modules (,@%cargo-build-system-modules + ,@%meson-build-system-modules) + #:modules (,@%cargo-build-system-modules + ((guix build meson-build-system) #:prefix meson:)) + #:cargo-inputs + (("rust-clap" ,rust-clap-2) + ("rust-gio" ,rust-gio-0.8) + ;; ("rust-either" + ;; ,(package + ;; (inherit rust-either-1) + ;; (name "rust-either") + ;; (version "1.5.99") + ;; (source + ;; (origin + ;; (method git-fetch) + ;; (uri (git-reference + ;; (url "https://github.com/danigm/either.git") + ;; (commit "60c99bc0723491e2dfd42bbe9b485c5f9323e96b"))) + ;; (file-name (git-file-name name version)) + ;; (sha256 + ;; (base32 + ;; "1s1x4njm1dxdbdspg6vhcv378z6skb5yqzj3kbnvw4aayqwgssrf")))) + ;; (arguments + ;; `(,@(package-arguments rust-either-1) + ;; #:features ("serde_untagged"))))) + ("rust-fractal-matrix-api" ,rust-fractal-matrix-api) + ("rust-cairo-rs" ,rust-cairo-rs-0.8) + ("rust-comrak" ,rust-comrak) + ("rust-chrono" ,rust-chrono-0.4) + ("rust-directories" ,rust-directories-2) + ("rust-dirs" ,rust-dirs-2.0) + ("rust-fragile" ,rust-fragile-1) + ("rust-gdk" ,rust-gdk) + ("rust-gdk-pixbuf" ,rust-gdk-pixbuf-0.9) + ("rust-gio" ,rust-gio-0.9) + ("rust-gtk" ,rust-gtk) + ("rust-gettext-rs" ,rust-gettext-rs-0.5) + ("rust-gstreamer-editing-services" ,rust-gstreamer-editing-services) + ("rust-gstreamer-player" ,rust-gstreamer-player) + ("rust-gstreamer-pbutils" ,rust-gstreamer-pbutils) + ("rust-glib" ,rust-glib-0.9) + ("rust-html2pango" ,rust-html2pango) + ("rust-itertools" ,rust-itertools-0.9) + ("rust-lazy-static" ,rust-lazy-static-1) + ("rust-letter-avatar" ,rust-letter-avatar) + ("rust-libhandy" ,rust-libhandy) + ("rust-log" ,rust-log-0.4) + ("rust-loggerv" ,rust-loggerv) + ("rust-md5" ,rust-md5-0.7) + ("rust-mdl" ,rust-mdl) + ("rust-pango" ,rust-pango-0.9) + ("rust-pangocairo" ,rust-pangocairo-0.8) + ("rust-rand" ,rust-rand-0.7) + ("rust-regex" ,rust-regex-1) + ("rust-secret-service" ,rust-secret-service) + ("rust-serde-json" ,rust-serde-json-1) + ("rust-sourceview4" ,rust-sourceview4-0.1) + ("rust-gspell" ,rust-gspell) + ("rust-gtk-sys" ,rust-gtk-sys) + ) + #:phases + (modify-phases (@ (guix build cargo-build-system) %standard-phases) + (add-after 'unpack 'patch + (lambda _ + (substitute* "scripts/cargo.sh" + (("RELEASE MODE") + "RELEASE MODE $PWD") + (("cargo build") + "cargo build -vv")) + (substitute* "meson.build" + (("'Cargo\\.lock',\n") + "")) + (substitute* "fractal-gtk/Cargo.toml" + ;; either, a changed version is used + (("git = \"https:\\/\\/github\\.com\\/danigm\\/either\\.git\"") + "version = \"1.5.99\"") + (("rev = \"60c99bc0723491e2dfd42bbe9b485c5f9323e96b\"\n") + "") + ;; gettext-rs, a needlessly changed version is used + (("git = \"https:\\/\\/github\\.com\\/danigm\\/gettext-rs\"") + "version = \"0.5.0\"") + (("branch = \"no-gettext\"\n") + "") + ;; sourceview4 + (("git = \"https:\\/\\/gitlab\\.gnome\\.org\\/World\\/Rust\\/sourceview4-rs\\.git\"") + "version = \"0.2.0\"") + (("rev = \"fa8819fa7ecbe56f44d951656d3825f468915754\"\n") + "") + ;; gstreamer + ;; (("gst_player]\n") ; Hack to identify just the + ;; ; gstreamer-player version + ;; "gst_player]") + ;; (("gst]\n") + ;; "gst]") + ;; (("gstreamer-pbutils = \"0.15.1\"") + ;; "gstreamer-pbutils = \"0.16.3\"") + (("itertools = \"0.8.2\"") + "itertools = \"0.9.0\"")) + ;; (substitute* "fractal-gtk/Cargo.toml" + ;; (("gst_player]version = \"0.15.3\"") + ;; "gst_player]\nversion = \"0.16.3\"") + ;; (("gst]version = \"0.15.3\"") + ;; "gst]\nversion = \"0.16.4\"")) + #t)) + (replace 'configure + (lambda args + (peek "CWD" (getcwd)) + (mkdir-p "target/cargo-home") + (with-directory-excursion "target/cargo-home" + (apply + (assoc-ref (@ (guix build cargo-build-system) %standard-phases) + 'configure) + args) + + ;; rust-either isn't handled properly because it's a Git + ;; repository for the source + (copy-recursively + (assoc-ref %build-inputs "rust-either") + (string-append "guix-vendor/rust-either-1.5.99.crate"))))) + (add-before 'configure 'configure-meson + (lambda args + (let ((source-dir (getcwd))) + (apply (assoc-ref meson:%standard-phases 'configure) + (append args + '(#:build-type "release" + #:configure-flags ()))) + (delete-file (string-append source-dir + "/Cargo.lock"))))) + (add-before 'patch-cargo-checksums 'hack + (lambda _ + (copy-recursively "target/cargo-home/.cargo" ".cargo") + ;; found a virtual manifest at + ;; `/tmp/guix-build-fractal-4.4.0.drv-0/build/target/cargo-home/guix-vendor/fractal-4.4.0.tar.xz/Cargo.toml` + ;; instead of a package manifest + + (delete-file-recursively + "target/cargo-home/guix-vendor/fractal-4.2.2.tar.xz") + #t)) + (add-before 'build 'enable-unstable-features + (lambda _ + (setenv "RUSTC_BOOTSTRAP" "1") + #t)) + (replace 'build + (assoc-ref meson:%standard-phases 'build)) + (delete 'check) + (replace 'patch-cargo-checksums + (lambda _ + ((assoc-ref (@ (guix build cargo-build-system) %standard-phases) + 'patch-cargo-checksums) + #:vendor-dir "target/cargo-home/guix-vendor") + #t)) + (replace 'install + (assoc-ref meson:%standard-phases 'install)) + (add-after 'install 'wrap + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (wrap-program (string-append out "/bin/fractal") + `("XDG_DATA_DIRS" prefix (,(string-append out "/share"))))) + #t))))) + (inputs + `(("openssl" ,openssl) + ("dbus" ,dbus) + ("glib" ,glib) + ("glib:bin" ,glib "bin") ; for glib-compile-resources + ("cairo" ,cairo) + ("gdk-pixbuf" ,gdk-pixbuf) + ("gtk+" ,gtk+) + ("gtk+" ,gtk+ "bin") ; for gtk-update-icon-cache + ("libhandy" ,libhandy-0.0) + ("gtksourceview" ,gtksourceview) + ("gspell" ,gspell) + ("gstreamer" ,gstreamer) + ("gst-plugins-base", gst-plugins-base) + ("gst-plugins-bad" ,gst-plugins-bad) + ("gst-editing-services" ,gst-editing-services) + ("gettext" ,gettext-minimal))) + (native-inputs + `(("rust" ,rust) + ("rust:cargo" ,rust "cargo") + ("meson" ,meson) + ("pkg-config" ,pkg-config) + ("ninja" ,ninja))) + (home-page "https://github.com/watchexec/watchexec") + (synopsis "Executes commands in response to file modifications") + (description + "") + (license license:asl2.0))) + (define-public gnome-shell-extension-appindicator (package (name "gnome-shell-extension-appindicator") -- cgit v1.2.3