From 20dec66225036aae54e28e755d28d2bd1e05c0eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Stefanovi=C4=87?= Date: Sat, 10 Nov 2018 14:27:53 +0100 Subject: [PATCH] gnu: Add elogind-next. --- gnu/packages/freedesktop.scm | 130 +++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index 5cc2699ad..723d26873 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -43,6 +43,7 @@ #:use-module (gnu packages acl) #:use-module (gnu packages admin) #:use-module (gnu packages autotools) + #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages boost) #:use-module (gnu packages check) @@ -65,6 +66,7 @@ #:use-module (gnu packages libusb) #:use-module (gnu packages linux) #:use-module (gnu packages m4) + #:use-module (gnu packages pcre) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) #:use-module (gnu packages polkit) @@ -72,6 +74,7 @@ #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) #:use-module (gnu packages python) + #:use-module (gnu packages selinux) #:use-module (gnu packages valgrind) #:use-module (gnu packages w3m) #:use-module (gnu packages web) @@ -346,6 +349,133 @@ the org.freedesktop.login1 interface over the system bus, allowing other parts of a the system to know what users are logged in, and where.") (license license:lgpl2.1+))) +(define-public elogind-next + (let* ((commit "0554def508b3328b70aaa6464886ad51219b9379") + (revision "2") + (version (git-version "240a" revision commit))) + (package + (name "elogind-next") + (version version) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/elogind/elogind") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0xwwrkd20zwqsychf76yd8n8kydk5vsgkx17v3qqbmhnbyq30a42")) + (modules '((guix build utils))) + (snippet + '(begin + (use-modules (guix build utils)) + (substitute* "meson.build" + ;; Clean RUNPATH. + (("install_rpath :") "#install_rpath :") + ;; TODO: To remove $ORIGIN... + ;; from RUNPATH of libexec executables: + ;; we should declare and use + ;; src/share/libshared as proper dependency. + ;; Fix pkttyagent path: + (("join_paths\\(bindir, 'pkttyagent'\\)") + "'\"/run/current-system/profileb/bin/pkttyagent\"'")) + (substitute* "man/meson.build" + ;; Necessary because + ;; there is no internet access + ;; inside the build environment. + (("xsltproc_flags = \\[") + (string-append "xsltproc_flags = [" + " '--novalid',"))) + (substitute* "src/login/elogind.c" + ;; Change PID file path. + (("\"/run/elogind.pid\"") + "\"/var/run/elogind.pid\"")) + #t)))) + (build-system meson-build-system) + (outputs '("out")) + (arguments + `(#:tests? #t + ;; Some tests fail only in chroot build environment: + ;; - https://github.com/elogind/elogind/issues/45 + ;; Some tests assume existence of standard directories: + ;; *** test_copy_bytes FAILS because there is no + ;; /usr/lib/os-release or /etc/os-release file + ;; *** test_chase_symlinks FAILS because there is no + ;; /usr directory + ;; + #:configure-flags + (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 whit shepherd. + (poweroff-path (string-append shepherd "/sbin/shutdown")) + (reboot-path (string-append shepherd "/sbin/reboot"))) + `(,(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 + (delete 'bootstrap)))) + (native-inputs + `(("docbook-xsl" ,docbook-xsl) + ("docbook-xml-4.2" ,docbook-xml-4.2) + ("docbook-xml-4.5" ,docbook-xml) + ("libxml2" ,libxml2) + ("m4" ,m4) + ("pkg-config" ,pkg-config) + ("python" ,python) + ("python-lxml" ,python-lxml) + ("gettext" ,gettext-minimal) + ("gperf" ,gperf) + ("xsltproc" ,libxslt))) + (inputs + `(("acl" ,acl) + ("audit" ,audit) + ("dbus" ,dbus) + ("eudev" ,eudev) + ("glibc" ,glibc) + ("libcap" ,libcap) + ("libseccomp" ,libseccomp) + ("libselinux" ,libselinux) + ("linux-pam" ,linux-pam) + ("pcre2" ,pcre2) + ("polkit" ,polkit) + ("python" ,python) ;; libpython optional input + ("shepherd" ,shepherd) + ("util-linux" ,util-linux))) + (home-page "https://github.com/elogind/elogind") + (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 +of a the system to know what users are logged in, and where.") + (license license:lgpl2.1+)))) + (define-public packagekit (package (name "packagekit") -- 2.19.1