From 79b6b4585329573fa20796c349cf5cbc620d29e0 Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Sat, 14 Nov 2026 09:55:44 -0500 Subject: [PATCH] elogind: split into multiple outputs --- pkgs/by-name/el/elogind/package.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkgs/by-name/el/elogind/package.nix b/pkgs/by-name/el/elogind/package.nix index d3d653d9e9a7..c73a4af5a9fa 100644 --- a/pkgs/by-name/el/elogind/package.nix +++ b/pkgs/by-name/el/elogind/package.nix @@ -28,6 +28,7 @@ docbook_xml_dtd_42, docbook_xml_dtd_45, udevCheckHook, + removeReferencesTo, # Defaulting to false because usually the rationale for using elogind is to # use it in situation where a systemd dependency does not work (especially @@ -49,6 +50,12 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-zPKVD8gXgnjgquHgZ3F8VNIngGGN0i4lQckHokTqtP4="; }; + outputs = [ + "out" + "lib" + "dev" + ]; + nativeBuildInputs = [ meson ninja @@ -67,6 +74,7 @@ stdenv.mkDerivation (finalAttrs: { python3Packages.python python3Packages.jinja2 + removeReferencesTo ] ++ lib.optionals enableSystemd [ # udevCheckHook introduces a dependency on systemdMinimal @@ -87,6 +95,9 @@ stdenv.mkDerivation (finalAttrs: { postPatch = '' substituteInPlace meson.build --replace-fail "install_emptydir(elogindstatedir)" "" substituteInPlace meson.build --replace-fail "bindir / 'pkttyagent'" "'${system}/bin/pkttyagent'" + + # libdir is the lib output, which should only contain libelogind + substituteInPlace meson.build --replace-fail "pkglibdir = libdir / 'elogind'" "pkglibdir = '${placeholder "out"}/lib/elogind'" '' + lib.optionalString (!enableSystemd) '' substituteInPlace ./rules.d/71-seat.rules.in --replace-fail "{{BINDIR}}/udevadm" "${eudev}/bin/udevadm" @@ -122,6 +133,9 @@ stdenv.mkDerivation (finalAttrs: { ''; mesonFlags = [ + "--libexecdir=${placeholder "out"}/libexec" + "--localedir=${placeholder "out"}/share/locale" + (lib.mesonOption "pamlibdir" "${placeholder "out"}/lib/security") (lib.mesonOption "dbuspolicydir" "${placeholder "out"}/share/dbus-1/system.d") (lib.mesonOption "dbussystemservicedir" "${placeholder "out"}/share/dbus-1/system-services") (lib.mesonOption "sysconfdir" "${placeholder "out"}/etc") @@ -132,6 +146,12 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonEnable "xenctrl" false) ]; + # libelogind compiles in sd_path_lookup() defaults under libexec, which would + # create a reference cycle between the out and lib outputs + postFixup = '' + remove-references-to -t "$out" "$lib"/lib/libelogind.so.*.*.* + ''; + meta = { homepage = "https://github.com/elogind/elogind"; description = "systemd project's 'logind', extracted to a standalone package";