From patchwork Tue Jun 8 16:19:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tony O X-Patchwork-Id: 30033 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4D97327BC81; Tue, 8 Jun 2021 18:08:46 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6B64D27BC78 for ; Tue, 8 Jun 2021 18:08:41 +0100 (BST) Received: from localhost ([::1]:37448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqfDU-0007sk-CI for patchwork@mira.cbaines.net; Tue, 08 Jun 2021 13:08:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqeTO-00030h-Qy for guix-patches@gnu.org; Tue, 08 Jun 2021 12:21:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48058) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqeTO-0008Ml-Js for guix-patches@gnu.org; Tue, 08 Jun 2021 12:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lqeTO-0005mO-Hh for guix-patches@gnu.org; Tue, 08 Jun 2021 12:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48924] Add systemd Resent-From: Tony O Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Jun 2021 16:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48924 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 48924@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.162316921122121 (code B ref -1); Tue, 08 Jun 2021 16:21:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jun 2021 16:20:11 +0000 Received: from localhost ([127.0.0.1]:59604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqeSS-0005kS-AN for submit@debbugs.gnu.org; Tue, 08 Jun 2021 12:20:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:52696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqeSP-0005jr-O2 for submit@debbugs.gnu.org; Tue, 08 Jun 2021 12:20:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqeSP-0002Ow-Fh for guix-patches@gnu.org; Tue, 08 Jun 2021 12:20:01 -0400 Received: from mail-0201.mail-europe.com ([51.77.79.158]:58341 helo=mail-02.mail-europe.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqeSM-0007te-Aw for guix-patches@gnu.org; Tue, 08 Jun 2021 12:20:01 -0400 Date: Tue, 08 Jun 2021 16:19:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fron.io; s=protonmail; t=1623169175; bh=of4tfGn/bZLk3Q2R11HLepPfNlTLZ/2IHWvOLPoqxgA=; h=Date:To:From:Reply-To:Subject:From; b=A8W5+RRuD1NnRzHMV3dBkOOWdbjuVjJmTFbhLHQ7y4tpwA5TW6rcVEliiqHsfHEMz q3Js3e9Xmm2/JuVoWSM9ESeFGNmulm5sA3oQKXaRCb7ath6RaOx44jyjPZHMFjwJyz iLUFz4WpkFFcfcPuIe37IliEVmMy4mwcqfWAhBMI= From: Tony O Message-ID: MIME-Version: 1.0 Received-SPF: pass client-ip=51.77.79.158; envelope-from=me@fron.io; helo=mail-02.mail-europe.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Tue, 08 Jun 2021 13:08:33 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Tony O Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello. Unsure what the conventional prelude here is, see attached my patch to add systemd to (gnu packages freedesktop) for use as a library in other packages. Thanks --- ix/ixmpp libera From f2c7d9f76ab8f2dcaaf8d4fdfb1f050fdb04c588 Mon Sep 17 00:00:00 2001 From: Tony Olagbaiye Date: Tue, 8 Jun 2021 17:15:02 +0100 Subject: [PATCH] gnu: Add systemd --- gnu/packages/freedesktop.scm | 222 +++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index e4ea951c41..03db4deee8 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -24,6 +24,7 @@ ;;; Copyright © 2020 Raghav Gururajan ;;; Copyright © 2021 Brendan Tildesley ;;; Copyright © 2021 pineapples +;;; Copyright © 2021 bqv ;;; ;;; This file is part of GNU Guix. ;;; @@ -55,6 +56,7 @@ #:use-module (gnu packages) #:use-module (gnu packages acl) #:use-module (gnu packages admin) + #:use-module (gnu packages aidc) #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages bash) @@ -63,10 +65,12 @@ #:use-module (gnu packages cmake) #:use-module (gnu packages compression) #:use-module (gnu packages cryptsetup) + #:use-module (gnu packages curl) #:use-module (gnu packages databases) #:use-module (gnu packages disk) #:use-module (gnu packages docbook) #:use-module (gnu packages documentation) + #:use-module (gnu packages elf) #:use-module (gnu packages fontutils) #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) @@ -74,6 +78,8 @@ #:use-module (gnu packages gl) #:use-module (gnu packages glib) ;intltool #:use-module (gnu packages gnome) + #:use-module (gnu packages gnunet) + #:use-module (gnu packages gnupg) #:use-module (gnu packages gperf) #:use-module (gnu packages graphviz) #:use-module (gnu packages gstreamer) @@ -81,6 +87,7 @@ #:use-module (gnu packages image) #:use-module (gnu packages language) #:use-module (gnu packages libffi) + #:use-module (gnu packages libidn) #:use-module (gnu packages libunwind) #:use-module (gnu packages libusb) #:use-module (gnu packages linux) @@ -89,6 +96,7 @@ #:use-module (gnu packages networking) #:use-module (gnu packages nss) #:use-module (gnu packages package-management) + #:use-module (gnu packages pcre) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) #:use-module (gnu packages pkg-config) @@ -98,6 +106,7 @@ #:use-module (gnu packages python-xyz) #:use-module (gnu packages samba) #:use-module (gnu packages sqlite) + #:use-module (gnu packages tls) #:use-module (gnu packages valgrind) #:use-module (gnu packages video) #:use-module (gnu packages w3m) @@ -2266,6 +2275,219 @@ fallback to generic Systray support if none of those are available.") "libportal provides GIO-style async APIs for most Flatpak portals.") (license license:lgpl2.1+)))) +(define-public systemd + (package + (name "systemd") + (version "247") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/systemd/systemd/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0h66cq7ymm419cjyg0gla18ni4y8qf9fsav9ysgacjik4xxny53p")))) + (build-system meson-build-system) + (arguments + `(#:tests? #f ;FIXME: The disable-broken-tests phase is ineffective. + #:configure-flags + (let ((bash (assoc-ref %build-inputs "bash")) + (coreutils (assoc-ref %build-inputs "coreutils")) + (kbd (assoc-ref %build-inputs "kbd")) + (kmod (assoc-ref %build-inputs "kmod")) + (util-linux (assoc-ref %build-inputs "util-linux")) + + (out (assoc-ref %outputs "out"))) + (list (string-append "-Dkill-path=" coreutils "/bin/kill") + (string-append "-Dkmod-path=" kmod "/bin/kmod") + (string-append "-Dsulogin-path=" util-linux "/bin/sulogin") + (string-append "-Dmount-path=" util-linux "/bin/mount") + (string-append "-Dumount-path=" util-linux "/bin/umount") + (string-append "-Dloadkeys-path=" kbd "/bin/loadkeys") + (string-append "-Dsetfont-path=" kbd "/bin/setfont") + (string-append "-Ddebug-shell=" bash "/bin/sh") + + ;; XXX: Can we reuse %ntp-servers here? + (string-append "-Dntp-servers=" + (string-join (map (lambda (n) + (string-append (number->string n) + ".guix.pool.ntp.org")) + '(0 1 2 3)) + ",")) + + ;; Use localhost for DNS with fallback to Quad9 (instead of Google). + "-Ddns-servers=127.0.0.1,::1,9.9.9.10,2620:fe::10" + + ;; FIXME: "Attempt to load external entity http://docbook.sf.net". + "-Dman=false" + + ;; Don't install SysV compatibility scripts. + "-Dsysvinit-path=" + "-Dsysvrcnd-path=" + + (string-append "-Dbashcompletiondir=" out "/etc/bash_completion.d") + (string-append "-Dsysconfdir=" out "/etc") + (string-append "-Drootprefix=" out) + (string-append "-Drootlibdir=" out "/lib") + (string-append "-Ddbuspolicydir=" out "/etc/dbus-1/system.d") + (string-append "-Dpamconfdir=" out "/etc/pam.d"))) + #:phases (modify-phases %standard-phases + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((bash (assoc-ref inputs "bash")) + (coreutils (assoc-ref inputs "coreutils")) + (glibc (assoc-ref inputs "glibc")) + (util-linux (assoc-ref inputs "util-linux")) + + (out (assoc-ref outputs "out"))) + + (substitute* '("src/core/swap.c" + "src/fsck/fsck.c" + "src/journal/cat.c" + "src/nspawn/nspawn.c" + "src/nspawn/nspawn-setuid.c") + (("/bin/sh") (string-append bash "/bin/sh")) + (("/bin/bash") (string-append bash "/bin/bash")) + (("/bin/cat") (string-append coreutils "/bin/cat")) + (("/bin/echo") (string-append coreutils "/bin/echo")) + (("/bin/getent") (string-append glibc "/bin/getent")) + (("/sbin/fsck") (string-append util-linux "/sbin/fsck")) + (("/sbin/swapon") (string-append util-linux "/sbin/swapon")) + (("/sbin/swapoff") (string-append util-linux "/sbin/swapoff"))) + (substitute* "src/journal/catalog.c" + (("/usr/lib/systemd/catalog") + (string-append out "/lib/systemd/catalog"))) + #t))) + (add-after 'patch-paths 'fix-install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; Don't create /var/lib/systemd during install. + (substitute* "meson.build" + ((".*mkdir_p\\.format\\(systemdstatedir\\)\\)") "")) + ;; Nor /var/lib/systemd/catalog. + (substitute* "catalog/meson.build" + (("journalctl --update-catalog") "journalctl --version")) + ;; Likewise for /var/log/journal. + (substitute* '("src/journal/meson.build" + "src/journal-remote/meson.build") + (("/var/log/journal") "/tmp/journal")) + ;; Create the hwdb in out/etc/udev/hwdb.d, not /etc/udev. + (substitute* "hwdb.d/meson.build" + (("systemd-hwdb update") + (string-append "systemd-hwdb -r " out + "/etc/udev/hwdb.d update"))) + #t))) + (add-before 'configure 'set-runpath + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; We need out/lib and out/lib/systemd in RUNPATH. + (setenv "LDFLAGS" (string-append "-Wl,-rpath=" out "/lib," + "-rpath=" out "/lib/systemd")) + #t))) + (add-before 'check 'disable-broken-tests + (lambda _ + (delete-file "test-network") ;requires loopback + (delete-file "test-engine") ;requires cgroups + (delete-file "test-unit-name") ;likewise + (delete-file "test-unit-file") ;likewise + (delete-file "test-copy") ;FIXME + (delete-file "test-condition") ;requires containers + (delete-file "test-mount-util") ;requires /sys + (delete-file "test-exec-util") ;FIXME + (delete-file "test-xattr-util") ;FIXME + (delete-file "test-fs-util") ;requires /var/tmp + (delete-file "test-stat-util") ;FIXME + (delete-file "test-user-util") ;needs "root" user + (delete-file "test-path-lookup") ;expects systemd paths + (delete-file "test-namespace") ;requires containers + ;(delete-file "test-bpf") ;requires cgroups + (delete-file "test-fileio") ;FIXME + (delete-file "test-time-util") ;FIXME tzdata + (delete-file "test-date") ;likewise + (delete-file "test-calendarspec") ;likewise + (delete-file "test-cgroup-util") ;requires cgroup (duh) + (delete-file "test-strv") ;FIXME + (delete-file "test-path-util") ;FIXME /bin/sh + (delete-file "test-path") ;requires cgroup + (delete-file "test-sched-prio") ;requires cgroup + (delete-file "test-id128") ;FIXME + (delete-file "test-journal-flush") ;FIXME + (delete-file "test-bus-creds") ;requires cgroup + (delete-file "test-login") ;FIXME + (delete-file "test-dhcp-client") ;requires network + (delete-file "test-dhcp6-client") ;likewise + #t)) + (add-before 'install 'fix-install + (lambda _ + (setenv "DESTDIR" "/") + #t)) + (add-after 'install 'fix-environment-symlink + (lambda* (#:key outputs #:allow-other-keys) + ;; The install phase creates this dangling symlink: + ;; lib/environment.d/00-environment.conf -> ../../etc/environment + ;; ...which causes the 'fix-runpath' phase to error out. + ;; XXX: This should probably use /etc/environment instead. + (mkdir-p (string-append (assoc-ref outputs "out") + "/etc/environment")) + #t)) + (add-before 'strip 'add-shared-lib + (lambda* (#:key outputs #:allow-other-keys) + (link (string-append (assoc-ref outputs "out") + "/lib/systemd/libsystemd-shared-247.so") + (string-append (assoc-ref outputs "out") + "/lib/libsystemd-shared-247.so")) + #t))))) + (native-inputs + `(("docbook-xml" ,docbook-xml) + ("docbook-xsl" ,docbook-xsl) + ("gettext" ,gettext-minimal) + ("gperf" ,gperf) + ("lxml" ,python-lxml) + ("m4" ,m4) + ("pkg-config" ,pkg-config) + ("xsltproc" ,libxslt))) + (inputs + `(("acl" ,acl) + ("audit" ,audit) + ("bash" ,bash) + ("bzip2" ,bzip2) + ("coreutils" ,coreutils) + ("cryptsetup" ,cryptsetup) + ("curl" ,curl) + ("dbus" ,dbus) + ;; TODO: Add gnu-efi for bootloader functionality. + ("elfutils" ,elfutils) + ("glib" ,glib) + ("glibc" ,glibc) + ("gnutls" ,gnutls) + ("kbd" ,kbd) + ("kmod" ,kmod) + ("libcap" ,libcap) + ("libgcrypt" ,libgcrypt) + ("libidn2" ,libidn2) + ("libmicrohttpd" ,libmicrohttpd) + ("libseccomp" ,libseccomp) + ("libxkbcommon" ,libxkbcommon) + ("linux-pam" ,linux-pam) + ("lz4" ,lz4) + ("pcre2" ,pcre2) + ("python" ,python) + ("qrencode" ,qrencode) + ("util-linux" ,util-linux) + ("xz" ,xz) + ("zlib" ,zlib))) + (home-page "https://www.freedesktop.org/wiki/Software/systemd/") + (synopsis "System and service manager") + (description + "@code{systemd} is a suite of basic building blocks for a Linux system. +It provides a system and service manager that runs as PID 1 and starts the +rest of the system. systemd provides aggressive parallelization capabilities, +uses socket and D-Bus activation for starting services, offers on-demand +starting of daemons, keeps track of processes using Linux control groups, +maintains mount and automount points, and implements an elaborate transactional +dependency-based service control logic.") + (license license:lgpl2.1+))) + (define-public xdg-desktop-portal (package (name "xdg-desktop-portal") -- 2.32.0