From patchwork Mon Sep 4 20:58:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 53443 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 0AA4127BBE2; Mon, 4 Sep 2023 22:00:27 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5D47C27BBE9 for ; Mon, 4 Sep 2023 22:00:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdGg0-0005F2-KY; Mon, 04 Sep 2023 17:00:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdGfy-0005Ei-DK for guix-patches@gnu.org; Mon, 04 Sep 2023 17:00:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qdGfx-0006ZS-Sg for guix-patches@gnu.org; Mon, 04 Sep 2023 17:00:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qdGfx-0005kE-Qz; Mon, 04 Sep 2023 17:00:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65745] [PATCH] gnu: yelp: Provide dependencies to display "man:" URIs. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: liliana.prikler@gmail.com, maxim.cournoyer@gmail.com, rg@raghavgururajan.name, guix-patches@gnu.org Resent-Date: Mon, 04 Sep 2023 21:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65745 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65745@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Luis Felipe , Liliana Marie Prikler , Maxim Cournoyer , Raghav Gururajan X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Liliana Marie Prikler , Maxim Cournoyer , Raghav Gururajan Received: via spool by submit@debbugs.gnu.org id=B.169386115621990 (code B ref -1); Mon, 04 Sep 2023 21:00:01 +0000 Received: (at submit) by debbugs.gnu.org; 4 Sep 2023 20:59:16 +0000 Received: from localhost ([127.0.0.1]:52773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdGfE-0005ib-At for submit@debbugs.gnu.org; Mon, 04 Sep 2023 16:59:16 -0400 Received: from lists.gnu.org ([2001:470:142::17]:52190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdGfA-0005iN-Kl for submit@debbugs.gnu.org; Mon, 04 Sep 2023 16:59:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdGf4-00056M-Uc for guix-patches@gnu.org; Mon, 04 Sep 2023 16:59:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdGf3-0006Ub-SI; Mon, 04 Sep 2023 16:59:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=+sHD8L4FzZapgSd2vkJ652YpoDEKGNW/dORG0PHhw8Y=; b=NtMns7B3dHEc3o wT6irnbfi8fNaJMY2RLJKdULwLnLLgtjxNKnfH/CEON1W5dcyhb7aha5Y71gifXP8ArTXE6W2YKz5 NDhRgq+mbdlm0qCAZVzSHSQsPQyJ2jSMGbclrYbwf/379Qx6AO+/44ToBNDF4A7WwOTL+OHiBHOAR DTlN1/ha4AZ6eMjqeG7VjGW1SrIXIkQEBRnBJ5kbapTGZSPniKNum/2EXUwmaL0kDZ4NcI4ogydmm ZoSwgQHJtgFyKOvMnWctLTYM+QG8HMUzyYXpX9m60BW4kmur2BFjQHZ8yQdidOaxsLZm0JuOHUOvU uhDv4SXudnaF6H2+ncKw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 4 Sep 2023 22:58:55 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Previously a command like the following one would fail to display the expected man page: guix shell yelp coreutils man-db -C \ --expose=/tmp/.X11-unix --expose=/run/user \ --expose=/var/run/dbus --expose=/etc/machine-id \ -E ^DISPLAY -- yelp man:ls * gnu/packages/gnome.scm (yelp)[arguments]: New field. [inputs]: Add 'man-db' and its "groff-minimal" input. Reported-by: Luis Felipe --- gnu/packages/gnome.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) Hi! Initially I wanted to fix support for URLs like “info:coreutils”, which Luis also reported on the Fediverse as being broken. However, after much debugging I got lost in a maze of callbacks and threads and opaque objects and eventually gave up. Someone™ should take another look. For the record, this is how I went on my debugging journey: guix shell yelp coreutils man-db info-reader \ --with-debug-info=yelp gdb --pure -E ^DISPLAY -- \ gdb --args /bin/sh yelp info:coreutils Ludo’. base-commit: 1af35bbb25b122cafddfd2f69b644d46c4beff85 diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 3b80692e90..894d77d7ba 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -7336,6 +7336,31 @@ (define-public yelp (base32 "0h9vf4fx056imjf8ibmn03wg1c3hniipy1nsm2jqi62lp1m19c95")))) (build-system glib-or-gtk-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'set-man-file-name + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Create a wrapper for 'man' that knows where to find + ;; 'groff' and 'gunzip'. + (define libexecdir + (string-append #$output "/libexec/yelp")) + (define wrapper + (string-append libexecdir "/man")) + + (mkdir-p libexecdir) + (symlink (search-input-file inputs "bin/man") wrapper) + (wrap-program wrapper + `("PATH" ":" = + ,(map (lambda (program) + (dirname (search-input-file inputs program))) + '("bin/groff" "bin/gunzip")))) + + ;; Have Yelp use that 'man' wrapper instead of searching + ;; for 'man' in $PATH. + (substitute* "libyelp/yelp-man-parser.c" + (("\"man\"") + (string-append "\"" wrapper "\"")))))))) (native-inputs (list `(,glib "bin") ; for glib-genmarshal, etc. intltool @@ -7347,6 +7372,8 @@ (define-public yelp (list gsettings-desktop-schemas libhandy libxslt + man-db ;for URIs like "man:ls" + (lookup-package-input man-db "groff-minimal") ;ditto sqlite webkitgtk yelp-xsl))