[bug#33471] gnu: elogind: Update to 239.2.

Message ID CAFBTj=hHnLhhqwrb9K46wdxGHoks2krHwfyB3dmc13YWKzqs=w@mail.gmail.com
State Accepted
Headers show
Series [bug#33471] gnu: elogind: Update to 239.2. | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed

Commit Message

Stefan Stefanović Nov. 24, 2018, 6:10 a.m. UTC
Hello,
Marius.

Thanks to your input and suggestions I managed to simplify the original patch.
I will attach the second patch to this e-mail.

I tried to stick to the suggestions you gave me,
and tried to make this patch as small as possible.
The "--novalid" option is not necessary for this build so, I removed it.
Please comment on this patch, and point out other areas I need to improve.

I will try to test this patch on my main system.
I expect it to work, we will see. ;)

Thank you.

Stefan.

Comments

Stefan Stefanović Nov. 25, 2018, 7:02 a.m. UTC | #1
>Please also make sure "make check-system TESTS=elogind" passes.  I found
>I had to s|/dev/tty1|tty1| in gnu/tests/desktop.scm in my branch.

I forgot to mention that this elogind test passed, after the fix you
provided. Thank you.
I should have replied to this point sooner, sorry about that.

Patch

From f8acb0ba61f6aabc080c7e2ba0b8d0d830bb504a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Stefanovi=C4=87?= <stefanx2ovic@gmail.com>
Date: Sat, 24 Nov 2018 06:40:39 +0100
Subject: [PATCH 2/2] gnu: elogind: Update to 239.2.

* gnu/packages/freedesktop.scm (elogind): Update to 239.2.
[source](patches): Remove elogind-glibc-2.27.patch.
[source](snippet): Remove snippet.
[arguments]:
<#:tests?>: Enable tests.
<#:configure-flags>: Adjust build paths. Disable some tests.
<#:make-flags>: Remove argument.
<#:phases>[patch-locale-header]: Remove phase.
<#:phases>[clean-runpath]: Add phase.
<#:phases>[bootstrap]: Remove phase.
<#:phases>[fix-pkttyagent-path]: Add phase.
<#:phases>[fix-service-file]: Remove phase.
<#:phases>[add-libcap-to-search-path]: Remove phase.
<#:phases>[remove-uaccess-tag]: Remove phase.
<#:phases>[change-pid-file-path]: Add phase.
[build-system]: Switch to meson-build-system.
[native-inputs]: Sort native-inputs list.
Remove gperf package version constraint.
Remove: autoconf, automake, libtool, intltool.
Add: docbook-xml-4.2.
[inputs]: Sort inputs list. Remove: linux-libre-headers.
[synopsis]: Small adjustment.

* gnu/packages/patches/elogind-glibc-2.27.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): Remove patch file.
---
 gnu/local.mk                                  |   1 -
 gnu/packages/freedesktop.scm                  | 139 +++++++-----------
 gnu/packages/patches/elogind-glibc-2.27.patch |  22 ---
 3 files changed, 53 insertions(+), 109 deletions(-)
 delete mode 100644 gnu/packages/patches/elogind-glibc-2.27.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c56278e93..1b1511e54 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -659,7 +659,6 @@  dist_patch_DATA =						\
   %D%/packages/patches/dropbear-CVE-2018-15599.patch		\
   %D%/packages/patches/dvd+rw-tools-add-include.patch 		\
   %D%/packages/patches/elfutils-tests-ptrace.patch		\
-  %D%/packages/patches/elogind-glibc-2.27.patch			\
   %D%/packages/patches/einstein-build.patch			\
   %D%/packages/patches/emacs-exec-path.patch			\
   %D%/packages/patches/emacs-fix-scheme-indent-function.patch	\
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index afcd63b54..b84c3494a 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -227,7 +227,7 @@  the freedesktop.org XDG Base Directory specification.")
 (define-public elogind
   (package
     (name "elogind")
-    (version "232.4")
+    (version "239.2")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -236,109 +236,76 @@  the freedesktop.org XDG Base Directory specification.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "06qqs6yfcwg8aiinqqvy5374pys6sspmvsrqz93c724hqq38d93z"))
-              (patches (search-patches "elogind-glibc-2.27.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  (use-modules (guix build utils))
-                  (substitute* "Makefile.am"
-                    ;; Avoid validation against DTD because the DTDs for
-                    ;; both doctype 4.2 and 4.5 are needed.
-                    (("XSLTPROC_FLAGS = ") "XSLTPROC_FLAGS = --novalid"))
-                  #t))))
-    (build-system gnu-build-system)
+                "17khwbzqmkfd3hcscs51kzdpvq9p2llm08vbpsdhy9yxgwfzlfa6"))))
+    (build-system meson-build-system)
     (arguments
-     `(#:tests? #f ;FIXME: "make check" in the "po" directory fails.
+     `(#:tests? #t
        #:configure-flags
-       (list (string-append "--with-udevrulesdir="
-                            (assoc-ref %outputs "out")
-                            "/lib/udev/rules.d")
-
-             ;; Let elogind be its own cgroup controller, rather than relying
-             ;; on systemd or OpenRC.  By default, 'configure' makes an
-             ;; incorrect guess.
-             "--with-cgroup-controller=elogind"
-
-             (string-append "--with-rootprefix="
-                            (assoc-ref %outputs "out"))
-             (string-append "--with-rootlibexecdir="
-                            (assoc-ref %outputs "out")
-                            "/libexec/elogind")
-             ;; These are needed to ensure that lto linking works.
-             "RANLIB=gcc-ranlib"
-             "AR=gcc-ar"
-             "NM=gcc-nm")
-       #:make-flags '("PKTTYAGENT=/run/current-system/profile/bin/pkttyagent")
+       (let* ((out (assoc-ref %outputs "out"))
+              (sysconf (string-append out "/etc"))
+              (libexec (string-append out "/libexec/elogind"))
+              (dbuspolicy (string-append out "/etc/dbus-1/system.d"))
+              (shepherd (assoc-ref %build-inputs "shepherd"))
+              (halt-path (string-append shepherd "/sbin/halt"))
+              (kexec-path "") ;; NOTE: We need to package kexec-tools,
+              ;;                       or support kexec with shepherd.
+              (poweroff-path (string-append shepherd "/sbin/shutdown"))
+              (reboot-path (string-append shepherd "/sbin/reboot")))
+         (list
+          (string-append "-Drootprefix=" out)
+          (string-append "-Dsysconfdir=" sysconf)
+          (string-append "-Drootlibexecdir=" libexec)
+          (string-append "-Ddbuspolicydir=" dbuspolicy)
+          (string-append "-Dc_link_args=-Wl,-rpath=" libexec)
+          (string-append "-Dcpp_link_args=-Wl,-rpath=" libexec)
+          (string-append "-Dhalt-path=" halt-path)
+          (string-append "-Dkexec-path=" kexec-path)
+          (string-append "-Dpoweroff-path=" poweroff-path)
+          (string-append "-Dreboot-path=" reboot-path)
+          "-Dcgroup-controller=elogind"
+          ;; Disable some tests.
+          "-Dtests=false"
+          "-Dslow-tests=false"))
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'patch-locale-header
+         (add-after 'unpack 'clean-runpath
            (lambda _
-             ;; Fix compilation with glibc >= 2.26, which removed xlocale.h.
-             ;; This can be removed for elogind 234.
-             (substitute* "src/basic/parse-util.c"
-               (("xlocale\\.h") "locale.h"))
+             (substitute* "meson.build"
+               (("install_rpath :") "#install_rpath :"))
              #t))
-         (replace 'bootstrap
+         (add-after 'unpack 'fix-pkttyagent-path
            (lambda _
-             (invoke "intltoolize" "--force" "--automake")
-             (invoke "autoreconf" "-vif")))
-         (add-before 'build 'fix-service-file
-           (lambda* (#:key outputs #:allow-other-keys)
-             ;; Fix the file name of the 'elogind' binary in the D-Bus
-             ;; '.service' file.
-             (substitute* "src/login/org.freedesktop.login1.service"
-               (("^Exec=.*")
-                (string-append "Exec=" (assoc-ref %outputs "out")
-                               "/libexec/elogind/elogind\n")))
+             (substitute* "meson.build"
+               (("join_paths\\(bindir, 'pkttyagent'\\)")
+                "'\"/run/current-system/profile/bin/pkttyagent\"'"))
              #t))
-         (add-after 'install 'add-libcap-to-search-path
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             ;; Add a missing '-L' for libcap in libelogind.la.  See
-             ;; <https://lists.gnu.org/archive/html/guix-devel/2017-09/msg00084.html>.
-             (let ((libcap (assoc-ref inputs "libcap"))
-                   (out    (assoc-ref outputs "out")))
-               (substitute* (string-append out "/lib/libelogind.la")
-                 (("-lcap")
-                  (string-append "-L" libcap "/lib -lcap")))
-               #t)))
-         (add-after 'unpack 'remove-uaccess-tag
+         (add-after 'unpack 'change-pid-file-path
            (lambda _
-             ;; systemd supports a "uaccess" built-in tag, but eudev currently
-             ;; doesn't.  This leads to eudev warnings that we'd rather not
-             ;; see, so remove the reference to "uaccess."
-             (substitute* "src/login/73-seat-late.rules.in"
-               (("^TAG==\"uaccess\".*" line)
-                (string-append "# " line "\n")))
+             (substitute* "src/login/elogind.c"
+               (("\"/run/elogind.pid\"") "\"/run/systemd/elogind.pid\""))
              #t)))))
     (native-inputs
-     `(("autoconf" ,autoconf)
-       ("automake" ,automake)
-       ("libtool" ,libtool)
-       ("intltool" ,intltool)
-       ("gettext" ,gettext-minimal)
-       ("python" ,python)
+     `(("docbook-xml" ,docbook-xml)
+       ("docbook-xml-4.2" ,docbook-xml-4.2)
        ("docbook-xsl" ,docbook-xsl)
-       ("docbook-xml" ,docbook-xml)
-       ("xsltproc" ,libxslt)
+       ("gettext" ,gettext-minimal)
+       ("gperf" ,gperf)
+       ("libxml2" ,libxml2)             ;for XML_CATALOG_FILES
        ("m4" ,m4)
-       ("libxml2" ,libxml2)                     ;for XML_CATALOG_FILES
        ("pkg-config" ,pkg-config)
-
-       ;; Use gperf 3.0 to work around
-       ;; <https://github.com/wingo/elogind/issues/8>.
-       ("gperf" ,gperf-3.0)))
+       ("python" ,python)
+       ("xsltproc" ,libxslt)))
     (inputs
-     `(("linux-pam" ,linux-pam)
-       ("linux-libre-headers" ,linux-libre-headers)
-       ("libcap" ,libcap)
-       ("shepherd" ,shepherd)                ;for 'halt' and 'reboot', invoked
-                                             ;when pressing the power button
+     `(("acl" ,acl)                     ;to add individual users to ACLs on /dev nodes
        ("dbus" ,dbus)
        ("eudev" ,eudev)
-       ("acl" ,acl)))           ;to add individual users to ACLs on /dev nodes
+       ("libcap" ,libcap)
+       ("linux-pam" ,linux-pam)
+       ("shepherd" ,shepherd)           ;for 'halt' and 'reboot', invoked
+                                        ;when pressing the power button
+       ))
     (home-page "https://github.com/elogind/elogind")
-    (synopsis "User, seat, and session management service")
+    (synopsis "Elogind provides user, seat, and session management service")
     (description "Elogind is the systemd project's \"logind\" service,
 extracted out as a separate project.  Elogind integrates with PAM to provide
 the org.freedesktop.login1 interface over the system bus, allowing other parts
diff --git a/gnu/packages/patches/elogind-glibc-2.27.patch b/gnu/packages/patches/elogind-glibc-2.27.patch
deleted file mode 100644
index 4ade587b5..000000000
--- a/gnu/packages/patches/elogind-glibc-2.27.patch
+++ /dev/null
@@ -1,22 +0,0 @@ 
-Look for memfd_create in sys/mman.h instead of linux/memfd.h.
-Needed to build with glibc-2.27.
-
---- a/configure.ac	1969-12-31 19:00:00.000000000 -0500
-+++ b/configure.ac	2018-03-27 23:54:15.414589005 -0400
-@@ -360,7 +360,7 @@
- # ------------------------------------------------------------------------------
- 
- AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
--AC_CHECK_HEADERS([linux/memfd.h], [], [])
-+AC_CHECK_HEADERS([sys/mman.h], [], [])
- 
- AC_CHECK_HEADERS([printf.h], [have_printf_h=yes], [have_printf_h=no])
- AS_IF([test x$have_printf_h = xyes], [
-@@ -395,6 +395,7 @@
-                 [], [], [[
- #include <sys/types.h>
- #include <unistd.h>
-+#include <sys/mman.h>
- #include <sys/mount.h>
- #include <fcntl.h>
- #include <sched.h>
-- 
2.19.2