From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iAMMNipk/F/UWQAA0tVLHw (envelope-from ) for ; Mon, 11 Jan 2021 14:43:54 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eOviMSpk/F8nCgAAB5/wlQ (envelope-from ) for ; Mon, 11 Jan 2021 14:43:54 +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 DFC989402D4 for ; Mon, 11 Jan 2021 14:43:53 +0000 (UTC) Received: from localhost ([::1]:47152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyyQC-0006Ip-RX for larch@yhetil.org; Mon, 11 Jan 2021 09:43:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyyPR-0005vF-GA for bug-guix@gnu.org; Mon, 11 Jan 2021 09:43:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44720) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyyPR-0007Mr-7e for bug-guix@gnu.org; Mon, 11 Jan 2021 09:43:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyyPR-0003k2-5V for bug-guix@gnu.org; Mon, 11 Jan 2021 09:43:05 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#45193: [PATCH 3/4] build-system: qt: Exclude useless inputs from wrapped variables. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 11 Jan 2021 14:43:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45193 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 45193@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by 45193-submit@debbugs.gnu.org id=B45193.161037613014191 (code B ref 45193); Mon, 11 Jan 2021 14:43:05 +0000 Received: (at 45193) by debbugs.gnu.org; 11 Jan 2021 14:42:10 +0000 Received: from localhost ([127.0.0.1]:56242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyyOX-0003gh-Px for submit@debbugs.gnu.org; Mon, 11 Jan 2021 09:42:10 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:43287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyyON-0003fm-0k for 45193@debbugs.gnu.org; Mon, 11 Jan 2021 09:41:59 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4DDxHV3GTRz1s0fh; Mon, 11 Jan 2021 15:41:58 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4DDxHV2zcpz1sWcT; Mon, 11 Jan 2021 15:41:58 +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 wYeLFDpbTZ93; Mon, 11 Jan 2021 15:41:57 +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:41:57 +0100 (CET) Received: from lenashee.fritz.box (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 940E660493; Mon, 11 Jan 2021 15:41:44 +0100 (CET) From: Hartmut Goebel Date: Mon, 11 Jan 2021 15:41:43 +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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" 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 bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: DFC989402D4 X-Spam-Score: -1.35 X-Migadu-Scanner: scn0.migadu.com X-TUID: zwysTISvwVKJ From: Jakub Kądziołka * guix/build-system/qt.scm (qt-build)[qt-wrap-excluded-inputs]: New argument. * guix/build/qt-utils.scm (%qt-wrap-excluded-inputs): New variable. (wrap-qt-program*)[qt-wrap-excluded-inputs]: New argument. Filter excluded inputs. (wrap-qt-program)[qt-wrap-excluded-inputs]: New argument. (wrap-all-qt-programs)[qt-wrap-excluded-inputs]: New argument. Co-authored-by: Hartmut Goebel --- guix/build-system/qt.scm | 5 +++++ guix/build/qt-utils.scm | 29 ++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/guix/build-system/qt.scm b/guix/build-system/qt.scm index 1bd89bfa4d..e1368db1d9 100644 --- a/guix/build-system/qt.scm +++ b/guix/build-system/qt.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2013 Cyril Roelandt ;;; Copyright © 2017 Ricardo Wurmus ;;; Copyright © 2019 Hartmut Goebel +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,6 +23,8 @@ (define-module (guix build-system qt) #:use-module (guix store) #:use-module (guix utils) + #:use-module ((guix build qt-utils) + #:select (%qt-wrap-excluded-inputs)) #:use-module (guix derivations) #:use-module (guix search-paths) #:use-module (guix build-system) @@ -125,6 +128,7 @@ (phases '(@ (guix build qt-build-system) %standard-phases)) (qt-wrap-excluded-outputs ''()) + (qt-wrap-excluded-inputs %qt-wrap-excluded-inputs) (system (%current-system)) (imported-modules %qt-build-system-modules) (modules '((guix build qt-build-system) @@ -148,6 +152,7 @@ provides a 'CMakeLists.txt' file as its build system." search-paths) #:phases ,phases #:qt-wrap-excluded-outputs ,qt-wrap-excluded-outputs + #:qt-wrap-excluded-inputs ,qt-wrap-excluded-inputs #:configure-flags ,configure-flags #:make-flags ,make-flags #:out-of-source? ,out-of-source? diff --git a/guix/build/qt-utils.scm b/guix/build/qt-utils.scm index 030059522d..a03b09f05e 100644 --- a/guix/build/qt-utils.scm +++ b/guix/build/qt-utils.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 David Craven ;;; Copyright © 2019, 2020, 2021 Hartmut Goebel +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,8 +24,11 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (wrap-qt-program - wrap-all-qt-programs)) + wrap-all-qt-programs + %qt-wrap-excluded-inputs)) +(define %qt-wrap-excluded-inputs + '(list "cmake" "extra-cmake-modules" "qttools")) (define (variables-for-wrapping base-directories) @@ -50,13 +54,16 @@ '("QML2_IMPORT_PATH" prefix "/lib/qt5/qml"))))) -(define* (wrap-qt-program* program #:key inputs output-dir) +(define* (wrap-qt-program* program #:key inputs output-dir + qt-wrap-excluded-inputs) (define input-directories - ;; FIXME: Filter out unwanted inputs, e.g. cmake - (match inputs - (((_ . dir) ...) - dir))) + (filter-map + (match-lambda + ((label . directory) + (and (not (member label qt-wrap-excluded-inputs)) + directory))) + inputs)) (let ((vars-to-wrap (variables-for-wrapping (cons output-dir input-directories)))) @@ -64,18 +71,21 @@ (apply wrap-program program vars-to-wrap)))) -(define* (wrap-qt-program program-name #:key inputs output) +(define* (wrap-qt-program program-name #:key inputs output + (qt-wrap-excluded-inputs %qt-wrap-excluded-inputs)) "Wrap the specified programm (which must reside in the OUTPUT's \"/bin\" directory) with suitably set environment variables. This is like qt-build-systems's phase \"qt-wrap\", but only the named program is wrapped." (wrap-qt-program* (string-append output "/bin/" program-name) - #:output-dir output #:inputs inputs)) + #:output-dir output #:inputs inputs + #:qt-wrap-excluded-inputs qt-wrap-excluded-inputs)) (define* (wrap-all-qt-programs #:key inputs outputs (qt-wrap-excluded-outputs '()) + (qt-wrap-excluded-inputs %qt-wrap-excluded-inputs) #:allow-other-keys) "Implement qt-build-systems's phase \"qt-wrap\": look for executables in \"bin\", \"sbin\" and \"libexec\" of all outputs and create wrappers with @@ -99,7 +109,8 @@ add a dependency of that output on Qt." ((output . output-dir) (unless (member output qt-wrap-excluded-outputs) (for-each (cut wrap-qt-program* <> - #:output-dir output-dir #:inputs inputs) + #:output-dir output-dir #:inputs inputs + #:qt-wrap-excluded-inputs qt-wrap-excluded-inputs) (find-files-to-wrap output-dir)))))) (for-each handle-output outputs) -- 2.21.3