From ecc304df445bae378c503d9c870683e4fdd45039 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Mon, 18 Jul 2022 08:09:10 +0200 Subject: [PATCH 1/2] glib: add command man pages This change adds man pages for commands provided by glib. Namely, the $bin output now includes man pages (section 1) for: gapplication gdbus gio gsettings The $dev output for: gdbus-codegen gio-querymodules glib-compile-resources glib-compile-schemas glib-genmarshal glib-gettextize glib-mkenums gobject-query gresource gtester-report gtester --- pkgs/development/libraries/glib/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 8fb12fc0203a..7d7df5c312c2 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -1,5 +1,5 @@ { config, lib, stdenv, fetchurl, gettext, meson, ninja, pkg-config, perl, python3 -, libiconv, zlib, libffi, pcre, libelf, gnome, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45 +, libiconv, zlib, libffi, pcre, libelf, gnome, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45, libxslt # use util-linuxMinimal to avoid circular dependency (util-linux, systemd, glib) , util-linuxMinimal ? null , buildPackages @@ -124,7 +124,7 @@ stdenv.mkDerivation rec { (buildPackages.meson.override { withDarwinFrameworksGtkDocPatch = stdenv.isDarwin; }) - ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 libxml2 + ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 libxml2 libxslt ]; propagatedBuildInputs = [ zlib libffi gettext libiconv ]; @@ -135,6 +135,8 @@ stdenv.mkDerivation rec { "-Dgtk_doc=${boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}" "-Dnls=enabled" "-Ddevbindir=${placeholder "dev"}/bin" + ] ++ optionals (!stdenv.isDarwin) [ + "-Dman=true" # broken on Darwin ]; NIX_CFLAGS_COMPILE = toString [ @@ -171,6 +173,15 @@ stdenv.mkDerivation rec { cp -r ${buildPackages.glib.devdoc} $devdoc ''; + # Move man pages to the same output as their binaries (needs to be + # done after preFixupHooks which moves man pages too - in + # _multioutDocs) + postFixup = '' + for i in $dev/bin/*; do + moveToOutput "share/man/man1/''${i##*/}.1.*" "$dev" + done + ''; + checkInputs = [ tzdata desktop-file-utils shared-mime-info ]; preCheck = optionalString doCheck '' From 0cbedad03fd3bb506158e1e4b7c93eb49a21c119 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Mon, 18 Jul 2022 08:55:55 +0200 Subject: [PATCH 2/2] glib: move bash completions to right outputs Previously, bash completion scripts were installed in the "out" output, which didn't contain any binaries. With this change, the completion scripts are installed in the outputs containing the corresponding binaries. Namely, gapplication, gdbus, gio, and gsettings completion scripts go to $bin, and gresource to $dev. The result is that the completions work out of the box, when the binaries are available to the user. --- pkgs/development/libraries/glib/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index 7d7df5c312c2..0316deee7bcc 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -169,6 +169,12 @@ stdenv.mkDerivation rec { # This file is *included* in gtk3 and would introduce runtime reference via __FILE__. sed '1i#line 1 "${pname}-${version}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \ -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c + for i in $bin/bin/*; do + moveToOutput "share/bash-completion/completions/''${i##*/}" "$bin" + done + for i in $dev/bin/*; do + moveToOutput "share/bash-completion/completions/''${i##*/}" "$dev" + done '' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' cp -r ${buildPackages.glib.devdoc} $devdoc '';