From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qAu5KaFk/F9qXgAA0tVLHw (envelope-from ) for ; Mon, 11 Jan 2021 14:45:53 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id SPBvJaFk/F/EWAAAbx9fmQ (envelope-from ) for ; Mon, 11 Jan 2021 14:45:53 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4ACDB9403E8 for ; Mon, 11 Jan 2021 14:45:53 +0000 (UTC) Received: from localhost ([::1]:50454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyyS8-0007jJ-AA for larch@yhetil.org; Mon, 11 Jan 2021 09:45:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyyPQ-0005su-GN for guix-patches@gnu.org; Mon, 11 Jan 2021 09:43:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44717) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyyPQ-0007Mi-8h for guix-patches@gnu.org; Mon, 11 Jan 2021 09:43:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyyPQ-0003jh-6a for guix-patches@gnu.org; Mon, 11 Jan 2021 09:43:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45787] [PATCH 4/4] guix: qt-utils: Don't include useless inputs in wrapped variables. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 11 Jan 2021 14:43:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45787 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45193@debbugs.gnu.org, 45787@debbugs.gnu.org X-Debbugs-Original-To: 45193@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161037615214270 (code B ref -1); Mon, 11 Jan 2021 14:43:04 +0000 Received: (at submit) by debbugs.gnu.org; 11 Jan 2021 14:42:32 +0000 Received: from localhost ([127.0.0.1]:56255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyyOt-0003i1-U1 for submit@debbugs.gnu.org; Mon, 11 Jan 2021 09:42:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:38562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyyOl-0003hX-5I for submit@debbugs.gnu.org; Mon, 11 Jan 2021 09:42:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyyOj-00055K-7W for guix-patches@gnu.org; Mon, 11 Jan 2021 09:42:21 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:47350) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyyOT-0007GQ-6K for guix-patches@gnu.org; Mon, 11 Jan 2021 09:42:20 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4DDxHY5k2Zz1qskh; Mon, 11 Jan 2021 15:42:01 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4DDxHY5Rw4z1sWcT; Mon, 11 Jan 2021 15:42:01 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id gOf2oiwBGdqu; Mon, 11 Jan 2021 15:42:00 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-188-174-55-154.dynamic.mnet-online.de [188.174.55.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Mon, 11 Jan 2021 15:42:00 +0100 (CET) Received: from lenashee.fritz.box (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 9C67D604EB; Mon, 11 Jan 2021 15:41:44 +0100 (CET) From: Hartmut Goebel Date: Mon, 11 Jan 2021 15:41:44 +0100 Message-Id: X-Mailer: git-send-email 2.21.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=212.18.0.9; envelope-from=h.goebel@crazy-compilers.com; helo=mail-out.m-online.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.35 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 4ACDB9403E8 X-Spam-Score: -1.35 X-Migadu-Scanner: scn0.migadu.com X-TUID: iHVoWDb5pyaY From: Jakub Kądziołka Include only those inputs into XDG_DATA_DIRS having some subdirectory of /share which is typically used by Qt. * guix/build/qt-utils.scm (variables-for-wrapping): Take the output directory as an argument for special handling. Check for subdirectories of /share used by Qt before including inputs in XDG_DATA_DIRS. (wrap-qt-program*): Pass the output directory to variables-for-wrapping. Co-authored-by: Hartmut Goebel --- guix/build/qt-utils.scm | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/guix/build/qt-utils.scm b/guix/build/qt-utils.scm index a03b09f05e..8e6db10ca1 100644 --- a/guix/build/qt-utils.scm +++ b/guix/build/qt-utils.scm @@ -30,25 +30,42 @@ (define %qt-wrap-excluded-inputs '(list "cmake" "extra-cmake-modules" "qttools")) -(define (variables-for-wrapping base-directories) +;; NOTE: Apart from standard subdirectories of /share, Qt also provides +;; facilities for per-application data directories, such as +;; /share/quassel. Thus, we include the output directory even if it doesn't +;; contain any of the standard subdirectories. +(define (variables-for-wrapping base-directories output-directory) - (define (collect-sub-dirs base-directories subdirectory) + (define (collect-sub-dirs base-directories subdirectory-spec) (filter-map (lambda (dir) - (let ((directory (string-append dir subdirectory))) - (if (directory-exists? directory) directory #f))) + (match + subdirectory-spec + ((subdir) + (and (directory-exists? (string-append dir subdir)) + (string-append dir (car subdirectory-spec)))) + ((subdir children) + (and + (or + (and (string=? dir output-directory) + (directory-exists? (string-append dir subdir))) + (or-map + (lambda (kid) (directory-exists? (string-append dir subdir kid))) + children)) + (string-append dir subdir))))) base-directories)) (filter (lambda (var-to-wrap) (not (null? (last var-to-wrap)))) (map - (lambda (var-spec) - (list (first var-spec) (second var-spec) - (collect-sub-dirs base-directories (third var-spec)))) + (match-lambda + ((var kind . subdir-spec) + `(,var ,kind ,(collect-sub-dirs base-directories subdir-spec)))) (list ;; these shall match the search-path-specification for Qt and KDE ;; libraries - '("XDG_DATA_DIRS" suffix "/share") + '("XDG_DATA_DIRS" suffix "/share" ("/applications" "/fonts" + "/icons" "/mime")) '("XDG_CONFIG_DIRS" suffix "/etc/xdg") '("QT_PLUGIN_PATH" prefix "/lib/qt5/plugins") '("QML2_IMPORT_PATH" prefix "/lib/qt5/qml"))))) @@ -66,7 +83,8 @@ inputs)) (let ((vars-to-wrap (variables-for-wrapping - (cons output-dir input-directories)))) + (cons output-dir input-directories) + output-dir))) (when (not (null? vars-to-wrap)) (apply wrap-program program vars-to-wrap)))) -- 2.21.3