Re: [OUTREACHY]: Integration of desktop environments into GNU Guix

2020-08-11 Thread Raghav Gururajan
@Danny

> Please find the attached patch for gnome-shell. Also I have attached
> revised patches for mutter and gdm.

OOPS! Sent you the wrong ones. Here are the correct ones.

Regards,
RG.

From 4956005520e03defb583fbad14c307c552b59d12 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan 
Date: Mon, 10 Aug 2020 02:07:39 -0400
Subject: [PATCH 64/66] gnu: mutter: Update package definition.

* gnu/packages/gnome.scm (mutter) [version]: Update to 3.36.5.
[source][sha256]: Modify base32.
[arguments]<#:configure-flags>[-Dgles2_libname]: New flag.
[-Degl_device]: New flag.
[-Dwayland_eglstream]: New flag.
[-Dinstalled_tests]: New flag.
[-Dxwayland_grab_default_access_rules]: New flag.
[-Dc_link_args]: Modify flag.
<#:tests?>: Remove argument.
<#:phases>['fix-build-with-mesa-20]: Remove phase.
['check]: Remove phase.
['custom-check]: New phase.
[native-inputs]: Add adwaita-icon-theme, python-wrapper and ruby.
Remove autoconf, automake and libtool.
[propagated-inputs]: Add graphene, wayland and libxi. Remove xinput.
Move gdk-pixbuf+svg, libinput, eudev, libxcomposite, libxdamage, libxext,
libxkbcommon and libxrandr to ...
[inputs]: ... here. Add dbus, freetype, fribidi, libdrm, sysprof, egl-wayland,
wayland-protocols, libxau, libxcb, libxcursor, libxinerama and libxrender.
Remove zenity.
[synopsis]: Modify.
[description]: Modify.
[home-page]: Modify.
---
 gnu/packages/gnome.scm | 215 +++--
 1 file changed, 120 insertions(+), 95 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index dfb65826fc..81e0cce794 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -118,6 +118,7 @@
   #:use-module (gnu packages gnuzilla)
   #:use-module (gnu packages geo)
   #:use-module (gnu packages gperf)
+  #:use-module (gnu packages graphics)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages gsasl)
   #:use-module (gnu packages gstreamer)
@@ -8618,114 +8619,138 @@ in commandline and shell scripts.")
 (define-public mutter
   (package
 (name "mutter")
-(version "3.34.2")
-(source (origin
-  (method url-fetch)
-  (uri (string-append "mirror://gnome/sources/" name "/"
-  (version-major+minor version) "/"
-  name "-" version ".tar.xz"))
-  (sha256
-   (base32
-"0b8bz5kvs7rlwvqsg87cf6jhrrj95vgd1l235mjx8rip35ipfvrd"
-;; NOTE: Since version 3.21.x, mutter now bundles and exports forked
-;; versions of cogl and clutter.  As a result, many of the inputs,
-;; propagated-inputs, and configure flags used in cogl and clutter are
-;; needed here as well.
+(version "3.36.5")
+(source
+ (origin
+   (method url-fetch)
+   (uri
+(string-append "mirror://gnome/sources/" name "/"
+   (version-major+minor version) "/"
+   name "-" version ".tar.xz"))
+   (sha256
+(base32 "1py7sqrpvg2qvswxclshysx7hd9jk65i6cwqsagd6rg6rnjhblp0"
 (build-system meson-build-system)
 (arguments
- '(;; XXX: All mutter tests fail with the following error:
-   ;;   Settings schema 'org.gnome.mutter' is not installed
-   #:tests? #f
-   #:glib-or-gtk? #t
+ `(#:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
#:configure-flags
-   ;; TODO: Enable profiler when Sysprof is packaged.
-   (list "-Dprofiler=false"
- ;; Otherwise, the RUNPATH will lack the final path component.
- (string-append "-Dc_link_args=-Wl,-rpath="
-(assoc-ref %outputs "out") "/lib:"
-(assoc-ref %outputs "out") "/lib/mutter-5")
-
- ;; The following flags are needed for the bundled clutter
- (string-append "-Dxwayland_path="
-(assoc-ref %build-inputs "xorg-server-xwayland")
-"/bin/Xwayland")
-
- ;; the remaining flags are needed for the bundled cogl
- (string-append "-Dopengl_libname="
-(assoc-ref %build-inputs "mesa")
-"/lib/libGL.so"))
-   #:phases (modify-phases %standard-phases
-  (add-after 'unpack 'fix-build-with-mesa-20
-(lambda _
-  ;; Mimic upstream commit a444a4c5f58ea516ad for
-  ;; compatibility with Mesa 20.  Remove for 3.36.
-  (substitute* '("src/backends/meta-egl-ext.h"
- "src/backends/meta-egl.c"
- "src/backends/meta-egl.h")
-(("#include " all)
- (string-append all "\n#include ")))
-  (substitute* "cogl/cogl/meson.build"
-(("#include " all)
- (string-append all "\\n#include ")))
- 

Re: [OUTREACHY]: Integration of desktop environments into GNU Guix

2020-08-11 Thread Raghav Gururajan
@Danny

> I will send you the patch for gnome-shell shortly.

Please find the attached patch for gnome-shell. Also I have attached
revised patches for mutter and gdm.

Regards,
RG.
From 4956005520e03defb583fbad14c307c552b59d12 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan 
Date: Mon, 10 Aug 2020 02:07:39 -0400
Subject: [PATCH 64/66] gnu: mutter: Update package definition.

* gnu/packages/gnome.scm (mutter) [version]: Update to 3.36.5.
[source][sha256]: Modify base32.
[arguments]<#:configure-flags>[-Dgles2_libname]: New flag.
[-Degl_device]: New flag.
[-Dwayland_eglstream]: New flag.
[-Dinstalled_tests]: New flag.
[-Dxwayland_grab_default_access_rules]: New flag.
[-Dc_link_args]: Modify flag.
<#:tests?>: Remove argument.
<#:phases>['fix-build-with-mesa-20]: Remove phase.
['check]: Remove phase.
['custom-check]: New phase.
[native-inputs]: Add adwaita-icon-theme, python-wrapper and ruby.
Remove autoconf, automake and libtool.
[propagated-inputs]: Add graphene, wayland and libxi. Remove xinput.
Move gdk-pixbuf+svg, libinput, eudev, libxcomposite, libxdamage, libxext,
libxkbcommon and libxrandr to ...
[inputs]: ... here. Add dbus, freetype, fribidi, libdrm, sysprof, egl-wayland,
wayland-protocols, libxau, libxcb, libxcursor, libxinerama and libxrender.
Remove zenity.
[synopsis]: Modify.
[description]: Modify.
[home-page]: Modify.
---
 gnu/packages/gnome.scm | 215 +++--
 1 file changed, 120 insertions(+), 95 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index dfb65826fc..81e0cce794 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -118,6 +118,7 @@
   #:use-module (gnu packages gnuzilla)
   #:use-module (gnu packages geo)
   #:use-module (gnu packages gperf)
+  #:use-module (gnu packages graphics)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages gsasl)
   #:use-module (gnu packages gstreamer)
@@ -8618,114 +8619,138 @@ in commandline and shell scripts.")
 (define-public mutter
   (package
 (name "mutter")
-(version "3.34.2")
-(source (origin
-  (method url-fetch)
-  (uri (string-append "mirror://gnome/sources/" name "/"
-  (version-major+minor version) "/"
-  name "-" version ".tar.xz"))
-  (sha256
-   (base32
-"0b8bz5kvs7rlwvqsg87cf6jhrrj95vgd1l235mjx8rip35ipfvrd"
-;; NOTE: Since version 3.21.x, mutter now bundles and exports forked
-;; versions of cogl and clutter.  As a result, many of the inputs,
-;; propagated-inputs, and configure flags used in cogl and clutter are
-;; needed here as well.
+(version "3.36.5")
+(source
+ (origin
+   (method url-fetch)
+   (uri
+(string-append "mirror://gnome/sources/" name "/"
+   (version-major+minor version) "/"
+   name "-" version ".tar.xz"))
+   (sha256
+(base32 "1py7sqrpvg2qvswxclshysx7hd9jk65i6cwqsagd6rg6rnjhblp0"
 (build-system meson-build-system)
 (arguments
- '(;; XXX: All mutter tests fail with the following error:
-   ;;   Settings schema 'org.gnome.mutter' is not installed
-   #:tests? #f
-   #:glib-or-gtk? #t
+ `(#:glib-or-gtk? #t ; To wrap binaries and/or compile schemas
#:configure-flags
-   ;; TODO: Enable profiler when Sysprof is packaged.
-   (list "-Dprofiler=false"
- ;; Otherwise, the RUNPATH will lack the final path component.
- (string-append "-Dc_link_args=-Wl,-rpath="
-(assoc-ref %outputs "out") "/lib:"
-(assoc-ref %outputs "out") "/lib/mutter-5")
-
- ;; The following flags are needed for the bundled clutter
- (string-append "-Dxwayland_path="
-(assoc-ref %build-inputs "xorg-server-xwayland")
-"/bin/Xwayland")
-
- ;; the remaining flags are needed for the bundled cogl
- (string-append "-Dopengl_libname="
-(assoc-ref %build-inputs "mesa")
-"/lib/libGL.so"))
-   #:phases (modify-phases %standard-phases
-  (add-after 'unpack 'fix-build-with-mesa-20
-(lambda _
-  ;; Mimic upstream commit a444a4c5f58ea516ad for
-  ;; compatibility with Mesa 20.  Remove for 3.36.
-  (substitute* '("src/backends/meta-egl-ext.h"
- "src/backends/meta-egl.c"
- "src/backends/meta-egl.h")
-(("#include " all)
- (string-append all "\n#include ")))
-  (substitute* "cogl/cogl/meson.build"
-(("#include " all)
- (string-append all "\\n#include ")))
-  

Re: File search progress: database review and question on triggers

2020-08-11 Thread Ricardo Wurmus


Pierre Neidhardt  writes:

> Pierre Neidhardt  writes:
>
>> Ricardo Wurmus  writes:
>>
>>> I’m not suggesting to use updatedb, but I think it can be instructive to
>>> look at how the file database is implemented there.  We don’t have to
>>> use SQlite if it is much slower and heavier than a custom inverted
>>> index.
>>
>> Good call, I'll benchmark against an inverted index.
>>
>> Some cost may also be induced by the Guix store queries, not sure if we
>> can optimize these.
>
> With an s-exp based file, or a trivial text-based format, the downside
> is that it needs a bit of extra work to only load select entries,
> e.g. just the entries matching a specific Guix version.
>
> Would you happen to know a serialization library that allows for loading
> only a select portion of a file?

I don’t know of any suitable file format, but a generated offset index
at the beginning of the file could be useful.  You’d read the first
expression and then seek to the specified byte offset (after the
position of the index expression) where you then read the target
expression.  This can easily be generated and it can be extended without
having to rewrite the whole file.

But perhaps that’s premature optimization.

-- 
Ricardo



Re: File search progress: database review and question on triggers

2020-08-11 Thread Pierre Neidhardt
Ricardo Wurmus  writes:

> Oof.  The updatedb hack above takes 6 seconds on my i7-6500U CPU @
> 2.50GHz with SSD.
>
> I’m not suggesting to use updatedb, but I think it can be instructive to
> look at how the file database is implemented there.  We don’t have to
> use SQlite if it is much slower and heavier than a custom inverted
> index.

Good call, I'll benchmark against an inverted index.

Some cost may also be induced by the Guix store queries, not sure if we
can optimize these.

--
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature


Re: File search progress: database review and question on triggers

2020-08-11 Thread Ricardo Wurmus


Pierre Neidhardt  writes:

> 3. Size of the database:
>I've persisted all locally-present store items for my current Guix version
>and it produced a database of 72 MiB.  It compresses down to 8 MiB
>in zstd.

For comparison, my laptop’s store contains 1,103,543 files, excluding
.links 691,994.  The updatedb database for all of them is 86MB and takes
~6 seconds to generate:

time updatedb \
 --localpaths=/gnu/store \
 --findoptions='( -path /gnu/store/.links -o -name *.drv -o -name 
*.chroot ) -prune -o -type f -print' \
 --output=/tmp/dbfile

locate -d /tmp/dbfile ecxc0800

(This could be further tweaked to exclude links…)

>The worse case is around (number of guix generations) x ~100 MiB.

This seems a little excessive.

> 4. Indexing speed:
>The above items took some 20 minutes to complete (on my rather
>powerful machine).

Oof.  The updatedb hack above takes 6 seconds on my i7-6500U CPU @
2.50GHz with SSD.

I’m not suggesting to use updatedb, but I think it can be instructive to
look at how the file database is implemented there.  We don’t have to
use SQlite if it is much slower and heavier than a custom inverted
index.

-- 
Ricardo



Re: File search progress: database review and question on triggers

2020-08-11 Thread Pierre Neidhardt
Hi Mathieu,

Thanks for you comments!
Answers below.

>> 3. Size of the database:
>>I've persisted all locally-present store items for my current Guix version
>>and it produced a database of 72 MiB.  It compresses down to 8 MiB in 
>> zstd.
>>
>>But since we can have multiple Guix versions, this means that the
>>packages have one entry per store path, so we might end up with more
>>entries than that as the number of Guix generations grows.
>
> I'm not sure we actually need to save the full history. I think we could
> just store that the package X produces [Y1, Y2, ...]  executable files. Then
> on package X update, the executable files list could be refreshed.

Maybe you are missing some context.  The original discussion is there:
https://lists.gnu.org/archive/html/guix-devel/2020-01/msg00019.html.

Unlike Nix, we would like to do more than just index executable files.
Indeed, it's very useful to know where to find, say, a C header, a .so
library, a TeXlive .sty file, etc.

However, as you hinted, maybe it's unnecessary to save the file listings of
the packages for every Guix versions.  Maybe we could only store the
"diffs" between the Guix generations.  I don't know if SQLite supports
this.  If not, it sounds like a rather complex thing to do.

But really, if the compressed database over multiple Guix generations is
<100 MiB, then size is not a big problem.

>>Question: Should we include empty directories in the database?  I'm 
>> tempted
>>to answer no.
>
> I would also say no, and also exclude non-executable files.

See above, I think we would lose a lot in not including non-executable files.

>>Question: This bounds us to the SQLite syntax for pattern matching.  Is 
>> it a
>>problem?
>>It seems powerful enough in practice.  But maybe we can use regular
>>expression in SQLite as well?
>
> From the UI perspective, we already have "guix search" that expects a
> regex. If we were to include a "guix file-search" command, then I think
> it would make sense that it uses the same regex syntax.

I found out that SQLite has a REGEXP operator, I'll see if it works well enough.

>> 7. Have substitute servers distribute database content.  When the user 
>> performs
>>a file search, Guix asks the substitute server for a database update.  
>> Only
>>the diff should be sent over the network, not the whole thing since it 
>> might
>
> If I understand correctly, you are proposing to create local databases
> that would be kept in sync with a master database populated by the CI
> server. This seems a bit complex.
>
> What about extending Cuirass database to add the two tables you are
> proposing. Then, each time a package is built, if the version is
> updated, the "Files" table would be updated.
>
> Then we could add an HTTP interface such as "/search/file?query=libxxx"
> to Cuirass, that would directly query the database. In Guix itself, we
> could add the counterpart in the (guix ci) module.

The problem with this approach is that it would not work offline.  In my
opinion, this is a big limitation.  I'd rather have a local database.

Besides, we need a local database for non-official, locally-built
packages anyways (which Cuirass would not know about).  Since this is a
requirement, the only piece that'd be missing is database synchronization.

Thoughts?

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature


Re: [OUTREACHY]: Integration of desktop environments into GNU Guix

2020-08-11 Thread Raghav Gururajan
@Danny

Please find the attached patches.

I will send you the patch for gnome-shell shortly.

NOTE: I am not done with some of these packages yet. Have to fix
run-time issues.

@Others

Please find the following git-log.

*** START ***

commit 17b9cce3c19b092225759e6a1b51e7bcf330a4ce
Author: Raghav Gururajan 
Date:   Tue Aug 11 04:36:54 2020 -0400

gnu: gdm: Update package definition.

* gnu/packages/gnome.scm (gdm) [version]: Update to 3.36.3.
[source][sha256]: Modify base32.
[patches][gdm-default-session.patch]: Remove patch.
[outputs]: New output "help".
[arguments]<#:configure-flags>[--disable-static]: New flag.
[--enable-gdm-xsession]: New flag.
[--enable-ipv6]: New flag.
[--with-help-dir]: New flag.
[--with-systemdsystemunitdir]: New flag.
[--with-default-path]: Modify flag.
[--with-xevie]: New flag.
[--without-plymouth]: Remove flag.
[--localstatedir]: Remove flag.
[--sbindir]: Remove flag.
<#:phases>['pre-configure]: Modify phase.
['install-placeholder-desktop-entry]: Remove phase.
['link-autostart-files]: Remove phase.
[native-inputs]: Add check.
[inputs]: Add glib, audit, keyutils, libice, libselinux, plymouth,
tcp-wrappers, libx11, libxau, libxcb, libxdmcp, libext and libxinerama.
Remove check.
[synopsis]: Modify.
[description]: Modify.

* gnu/packages/patches/gdm-default-session.patch: Remove file.

* gnu/local.mk (gdm-default-session.patch): Remove reference.

commit ae30bf6af1397b1b3f7b43ab6435f637fe6d42a7
Author: Raghav Gururajan 
Date:   Mon Aug 10 02:07:39 2020 -0400

gnu: mutter: Update package definition.

* gnu/packages/gnome.scm (mutter) [version]: Update to 3.36.4.
[source][sha256]: Modify base32.
[arguments]<#:configure-flags>[-Dgles2_libname]: New flag.
[-Degl_device]: New flag.
[-Dwayland_eglstream]: New flag.
[-Dinstalled_tests]: New flag.
[-Dxwayland_grab_default_access_rules]: New flag.
[-Dxwayland_initfd]: New flag.
[-Dc_link_args]: Modify flag.
<#:phases>['fix-build-with-mesa-20]: Remove phase.
[native-inputs]: Add adwaita-icon-theme, python-wrapper and ruby.
Remove autoconf, automake and libtool.
[propagated-inputs]: Add graphene, wayland and libxi. Remove xinput.
Move gdk-pixbuf+svg, libinput, eudev, libxcomposite, libxdamage,
libxext,
libxkbcommon and libxrandr to ...
[inputs]: ... here. Add dbus, freetype, fribidi, libdrm, sysprof,
egl-wayland,
wayland-protocols, libxau, libxcb, libxcursor, libxinerama and
libxrender.
Remove zenity.
[synopsis]: Modify.
[description]: Modify.
[home-page]: Modify.

commit 004c8bbf589b502dfbb36c7d33ddfc76a440ab20
Author: Raghav Gururajan 
Date:   Tue Aug 11 06:21:31 2020 -0400

gnu: gjs: Update package definition.

* gnu/packages/gnome.scm (gjs) [version]: Update to 1.64.4.
[source][sha256]: Modify base32.
[build-system]: Change from glib-or-gtk to meson.
[arguments]<#:glib-or-gtk?>: New argument.
<#:phases>['pre-check]: Modify phase.
[propagated-inputs]: Replace mozjs-60 with mozjs-68.

commit ae436932c96b4f9f5308580de8999cca4a56b32b
Author: Kei Kebreau 
Date:   Tue Apr 21 11:10:24 2020 -0400

gnu: Add mozjs-68.

* gnu/packages/gnuzilla.scm (mozjs-68): New variable.

commit c45f292b09227203a37545a7d653852a3f1150bf
Author: Raghav Gururajan 
Date:   Mon Aug 10 00:05:11 2020 -0400

gnu: Add egl-wayland.

* gnu/packages/graphics.scm (egl-wayland): New variable.

commit 4a9eb027bf23e24063dd23bffa1edc3b5da6e637
Author: Raghav Gururajan 
Date:   Sun Aug 9 23:55:18 2020 -0400

gnu: Add eglexternalplatform.

* gnu/packages/graphics.scm (eglexternalplatform): New variable.

commit 032db56f8ab3587d4527c56bd3f8c0901ca1f595
Author: Raghav Gururajan 
Date:   Sun Aug 9 07:32:10 2020 -0400

gnu: wayland-protocols: Update package definition.

* gnu/packages/freedesktop.scm (wayland-protocols) [version]: Update
to 1.20.
[source][sha256]: Modify base32.
[description]: Modify.

commit ea024bd3e36c5b164c665f8836d05ccb696274f8
Author: Raghav Gururajan 
Date:   Sun Aug 9 07:16:35 2020 -0400

gnu: wayland: Update package definition.

* gnu/packages/freedesktop.scm (wayland) [version]: Update to 1.18.0.
[source][sha256]: Modify base32.
[build-system]: Change from gnu to meson.
[outputs]: New output "doc".
[arguments]<#:parallel-tests?>: Remove argument.
<#:phases>['patch-docbook-xml]: New phase.
['move-doc]: New phase.
[native-inputs]: Move here docbook-xml and docbook-xsl from ...
[inputs]: ... here. Move libffi to ...
[propagated-inputs]: ... here.
[synopsis]: Modify.
[description]: Modify.
[license]: Change from x11 to expat.

commit 0d43e161b7631272f0ac0bed695f18d196451eb9
Author: Raghav Gururajan 
Date:   Sun Aug 9 02:18:24 2020 -0400

gnu: totem: Update package definition.

* gnu/packages/gnome.scm (totem): Update package definition.
   

Re: File search progress: database review and question on triggers

2020-08-11 Thread Mathieu Othacehe


Hello Pierre,

Thanks for sharing your progress. A few remarks below.

> 3. Size of the database:
>I've persisted all locally-present store items for my current Guix version
>and it produced a database of 72 MiB.  It compresses down to 8 MiB in zstd.
>
>But since we can have multiple Guix versions, this means that the
>packages have one entry per store path, so we might end up with more
>entries than that as the number of Guix generations grows.

I'm not sure we actually need to save the full history. I think we could
just store that the package X produces [Y1, Y2, ...]  executable files. Then
on package X update, the executable files list could be refreshed.

>Question: Should we include empty directories in the database?  I'm tempted
>to answer no.

I would also say no, and also exclude non-executable files.

>Question: This bounds us to the SQLite syntax for pattern matching.  Is it 
> a
>problem?
>It seems powerful enough in practice.  But maybe we can use regular
>expression in SQLite as well?

>From the UI perspective, we already have "guix search" that expects a
regex. If we were to include a "guix file-search" command, then I think
it would make sense that it uses the same regex syntax.

> Next points I'd like to address:
>
> 6. Automatically persist the database entry when building a package.
>Any idea where I should plug that in?
>
> 7. Have substitute servers distribute database content.  When the user 
> performs
>a file search, Guix asks the substitute server for a database update.  Only
>the diff should be sent over the network, not the whole thing since it 
> might

If I understand correctly, you are proposing to create local databases
that would be kept in sync with a master database populated by the CI
server. This seems a bit complex.

What about extending Cuirass database to add the two tables you are
proposing. Then, each time a package is built, if the version is
updated, the "Files" table would be updated.

Then we could add an HTTP interface such as "/search/file?query=libxxx"
to Cuirass, that would directly query the database. In Guix itself, we
could add the counterpart in the (guix ci) module.

WDYT?

Thanks,

Mathieu



Re: bug#27149: perl for arm-linux-gnueabihf

2020-08-11 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

>>> *guix build --target=arm-linux-gnueabihf* *perl* fails with the following
>>> output: https://pastebin.com/QF0xKAmR

This has been fixed by #40698.

Thanks,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com