[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Desktops on non-x86_64 systems
From: |
Ludovic Courtès |
Subject: |
Desktops on non-x86_64 systems |
Date: |
Sat, 27 Nov 2021 23:36:03 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Hello Guix!
As you may know, librsvg 2.50 on ‘core-updates-frozen’ depends on Rust.
However mrustc, which we use to build the first Rust compiler, currently
only works on x86_64. This means that ~28% of the packages on
‘core-updates-frozen’ are x86_64-only (vs. ~15% on ‘master’).
Among these, the most problematic missing packages are desktop
environments: Xfce, GNOME, etc. So far our “pledge”, encoded in
‘etc/release-manifest.scm’, was that all the desktop environments would
be available on x86_64 and i686, so that one could install Guix System
just the same way on both. Currently this is no longer possible on
‘core-updates-frozen’, and I think that’s a problem.
The patch below does something unorthodox: it reintroduces librsvg 2.40
(written in C) and uses it selectively so we can have a desktop
environment with Xfce on i686. It’s not enough to get GDM though;
there’s a couple of GNOME packages that depend on librsvg and I haven’t
checked whether they work with the old librsvg.
I think that’s the most realistic way to salvage desktops on i686 for
now. In the future mrustc may well support i686¹, or perhaps GCC-Rust
will be mature enough to replace mrustc, but in both cases we’re talking
about a longer time frame.
What do people think?
Thanks,
Ludo’.
¹ https://github.com/thepowersgang/mrustc/issues/78
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 8e0e750180..cc7fadfe91 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -3617,6 +3617,79 @@ (define-public librsvg
(home-page "https://wiki.gnome.org/LibRsvg")
(license license:lgpl2.1+)))
+(define-public librsvg-2.40
+ ;; This is the last version implemented in C.
+ (package
+ (inherit librsvg)
+ (version "2.40.21")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://gnome/sources/librsvg/"
+ (version-major+minor version)
+ "/librsvg-" version ".tar.xz"))
+ (sha256
+ (base32
+ "1fljkag2gr7c4k5mn798lgf9903xslz8h51bgvl89nnay42qjqpp"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:configure-flags (list "--disable-static")
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'pre-configure
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "gdk-pixbuf-loader/Makefile.in"
+ ;; By default the gdk-pixbuf loader is installed under
+ ;; gdk-pixbuf's prefix. Work around that.
+ (("gdk_pixbuf_moduledir = .*$")
+ (string-append "gdk_pixbuf_moduledir = "
+ "$(prefix)/lib/gdk-pixbuf-2.0/2.10.0/"
+ "loaders\n"))
+ ;; Drop the 'loaders.cache' file, it's in gdk-pixbuf+svg.
+ (("gdk_pixbuf_cache_file = .*$")
+ "gdk_pixbuf_cache_file = $(TMPDIR)/loaders.cache\n"))
+ #t))
+ (add-before 'check 'remove-failing-tests
+ (lambda _
+ (with-directory-excursion "tests/fixtures/reftests"
+ (for-each delete-file
+ '(;; This test fails on i686:
+ "svg1.1/masking-path-04-b.svg"
+ ;; This test fails on armhf:
+ "svg1.1/masking-mask-01-b.svg"
+ ;; This test fails on aarch64:
+ "bugs/777834-empty-text-children.svg")))
+ #t)))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("glib" ,glib "bin") ; glib-mkenums, etc.
+ ("gobject-introspection" ,gobject-introspection))) ; g-ir-compiler, etc.
+ (inputs
+ `(;; XXX: 1.44 causes some test failures, so we stick with 1.42 for
+ ;; this ancient version of librsvg.
+ ("pango" ,pango-1.42)
+ ("libcroco" ,libcroco)
+ ("bzip2" ,bzip2)
+ ("libgsf" ,libgsf)
+ ("libxml2" ,libxml2)))
+ (propagated-inputs
+ ;; librsvg-2.0.pc refers to all of that.
+ `(("cairo" ,cairo)
+ ("gdk-pixbuf" ,gdk-pixbuf)
+ ("glib" ,glib)))
+ (synopsis "Render SVG files using Cairo (ancient C version)")
+ (properties '((hidden? . #t)))))
+
+(define* (librsvg-for-system #:optional
+ (system (or (%current-target-system)
+ (%current-system))))
+ ;; Since librsvg 2.50 depends on Rust, and Rust is only correctly support on
+ ;; x86_64, use the ancient C version on other platforms.
+ (if (string-prefix? "x86_64-" system)
+ librsvg
+ librsvg-2.40))
+
+(export librsvg-for-system)
+
(define-public libidl
(package
(name "libidl")
@@ -5538,7 +5611,10 @@ (define-public upower
#:configure-flags (list "--localstatedir=/var"
(string-append "--with-udevrulesdir="
(assoc-ref %outputs "out")
- "/lib/udev/rules.d"))))
+ "/lib/udev/rules.d"))
+
+ ;; FIXME: Test failure on i686-linux.
+ #:tests? #f))
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
@@ -8865,7 +8941,7 @@ (define-public gnome-shell
("evolution-data-server" ,evolution-data-server)
("gcr" ,gcr)
("gdm" ,gdm)
- ("librsvg" ,librsvg)
+ ;; ("librsvg" ,librsvg)
("gjs" ,gjs)
("gtk" ,gtk)
("gnome-autoar" ,gnome-autoar)
@@ -8892,7 +8968,7 @@ (define-public gnome-shell
("upower" ,upower)
;; XXX: These requirements were added in 3.24, but no mention in NEWS.
;; Missing propagation? See also: <https://bugs.gnu.org/27264>
- ("librsvg" ,librsvg)
+ ;; ("librsvg" ,librsvg)
("geoclue" ,geoclue)))
(synopsis "Desktop shell for GNOME")
(home-page "https://wiki.gnome.org/Projects/GnomeShell")
diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm
index 35a992dcf7..7ea5f19a8d 100644
--- a/gnu/packages/gstreamer.scm
+++ b/gnu/packages/gstreamer.scm
@@ -681,7 +681,7 @@ (define-public gst-plugins-good
("bzip2" ,bzip2)
("cairo" ,cairo)
("flac" ,flac)
- ("librsvg" ,librsvg)
+ ("librsvg" ,(librsvg-for-system))
("glib" ,glib)
("glib-networking" ,glib-networking)
("glu" ,glu)
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index e8ac0b79bb..b69fa372d9 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1417,7 +1417,7 @@ (define-public guile-rsvg
("libtool" ,libtool)
("texinfo" ,texinfo)))
(inputs `(("guile" ,guile-3.0)
- ("librsvg" ,librsvg)
+ ("librsvg" ,(librsvg-for-system))
("guile-lib" ,guile-lib))) ;for (unit-test)
(propagated-inputs `(("guile-cairo" ,guile-cairo)))
(synopsis "Render SVG images using Cairo from Guile")
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 06f3e3aabc..a63676a04b 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -633,7 +633,7 @@ (define-public xfce4-xkb-plugin
("pkg-config" ,pkg-config)))
(inputs
`(("garcon" ,garcon)
- ("librsvg" ,librsvg)
+ ("librsvg" ,(librsvg-for-system))
("libwnck" ,libwnck)
("libx11" ,libx11)
("libxfce4ui" ,libxfce4ui)
diff --git a/gnu/system/examples/lightweight-desktop.tmpl
b/gnu/system/examples/lightweight-desktop.tmpl
index d4330ecc8e..510db263f5 100644
--- a/gnu/system/examples/lightweight-desktop.tmpl
+++ b/gnu/system/examples/lightweight-desktop.tmpl
@@ -3,7 +3,7 @@
;; environments.
(use-modules (gnu) (gnu system nss))
-(use-service-modules desktop)
+(use-service-modules desktop sddm xorg)
(use-package-modules bootloaders certs emacs emacs-xyz ratpoison suckless wm
xorg)
@@ -53,7 +53,12 @@
;; Use the "desktop" services, which include the X11
;; log-in service, networking with NetworkManager, and more.
- (services %desktop-services)
+ ;; Remove the GDM service and use the SDDM display manager
+ ;; instead.
+ (services
+ (modify-services (append (list (service sddm-service-type))
+ %desktop-services)
+ (delete gdm-service-type)))
;; Allow resolution of '.local' host names with mDNS.
(name-service-switch %mdns-host-lookup-nss))