From patchwork Fri Jan 24 16:22:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hartmut Goebel X-Patchwork-Id: 19971 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 A977817B42; Fri, 24 Jan 2020 16:24:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 4A41F17A7B for ; Fri, 24 Jan 2020 16:24:11 +0000 (GMT) Received: from localhost ([::1]:44238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv1kg-0001pY-QP for patchwork@mira.cbaines.net; Fri, 24 Jan 2020 11:24:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37245) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv1ka-0001oq-FS for guix-patches@gnu.org; Fri, 24 Jan 2020 11:24:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv1kZ-0000d9-34 for guix-patches@gnu.org; Fri, 24 Jan 2020 11:24:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iv1kZ-0000cy-09 for guix-patches@gnu.org; Fri, 24 Jan 2020 11:24:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iv1kY-00013O-TI for guix-patches@gnu.org; Fri, 24 Jan 2020 11:24:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39269] [PATCH 1/2] guix: qt-build-system: Add phase `check-setup`. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 24 Jan 2020 16:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39269 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39269@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15798829863960 (code B ref -1); Fri, 24 Jan 2020 16:24:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Jan 2020 16:23:06 +0000 Received: from localhost ([127.0.0.1]:54677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv1je-00011o-8K for submit@debbugs.gnu.org; Fri, 24 Jan 2020 11:23:06 -0500 Received: from lists.gnu.org ([209.51.188.17]:44678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv1jc-00011h-VR for submit@debbugs.gnu.org; Fri, 24 Jan 2020 11:23:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37072) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv1jb-0001ht-Ez for guix-patches@gnu.org; Fri, 24 Jan 2020 11:23:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv1ja-0000C9-3C for guix-patches@gnu.org; Fri, 24 Jan 2020 11:23:03 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:49596) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iv1jZ-0000Au-Q1 for guix-patches@gnu.org; Fri, 24 Jan 2020 11:23:02 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4844F06lL1z1qqkj for ; Fri, 24 Jan 2020 17:23:00 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4844F06gChz1qrYp for ; Fri, 24 Jan 2020 17:23:00 +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 ACrWFcit2i7D for ; Fri, 24 Jan 2020 17:22:59 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-188-174-59-130.dynamic.mnet-online.de [188.174.59.130]) (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 for ; Fri, 24 Jan 2020 17:22:59 +0100 (CET) Received: from localhost.fritz.box (lenashee.fritz.box [192.168.110.31]) by hermia.goebel-consult.de (Postfix) with ESMTP id 61C5D6031C for ; Fri, 24 Jan 2020 17:22:57 +0100 (CET) From: Hartmut Goebel Date: Fri, 24 Jan 2020 17:22:52 +0100 Message-Id: <1430436b83e4aaea89de3d1cdd4613b935e39cb5.1579880425.git.h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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" X-getmail-retrieved-from-mailbox: Patches * guix/build/qt-build-system.scm (check-setup): New function. (%standard-phases): Add as new phase `check-setup before `check. * doc/guix.texi (Build System)[qt-build-system]: Describe the new phase. --- doc/guix.texi | 25 +++++++++++++++++++++---- guix/build/qt-build-system.scm | 14 +++++++++++++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index d674b9484f..71365c5269 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47,7 +47,7 @@ Copyright @copyright{} 2017 Thomas Danckaert@* Copyright @copyright{} 2017 humanitiesNerd@* Copyright @copyright{} 2017 Christopher Allan Webber@* Copyright @copyright{} 2017, 2018, 2019 Marius Bakke@* -Copyright @copyright{} 2017, 2019 Hartmut Goebel@* +Copyright @copyright{} 2017, 2019, 2020 Hartmut Goebel@* Copyright @copyright{} 2017, 2019 Maxim Cournoyer@* Copyright @copyright{} 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice@* Copyright @copyright{} 2017 George Clemmer@* @@ -6447,10 +6447,24 @@ Which Perl package is used can be specified with @code{#:perl}. This variable is exported by @code{(guix build-system qt)}. It is intended for use with applications using Qt or KDE. -This build system adds the phase @code{qt-wrap} to the ones defined by -@code{cmake-build-system}, after the @code{install} phase. +This build system adds the following two phases to the ones defined by +@code{cmake-build-system}: -This phase searches for Qt5 plugin paths, QML paths and some XDG in the inputs +@table @code +@item check-setup +The phase @code{check-setup} prepares the environment for running +the checks as commonly used by Qt test programs. +For now this only sets some environment variables: +@code{QT_QPA_PLATFORM=offscreen}, +@code{DBUS_FATAL_WARNINGS=0} and +@code{CTEST_OUTPUT_ON_FAILURE=1}. + +This phase is added before the @code{check} phase. +It's a separate phase to ease adjusting if necessary. + +@item qt-wrap +The phase @code{qt-wrap} +searches for Qt5 plugin paths, QML paths and some XDG in the inputs and output. In case some path is found, all programs in the output's @file{bin/}, @file{sbin/}, @file{libexec/} and @file{lib/libexec/} directories are wrapped in scripts defining the necessary environment variables. @@ -6460,6 +6474,9 @@ by listing their names in the @code{#:qt-wrap-excluded-outputs} parameter. This is useful when an output is known not to contain any Qt binaries, and where wrapping would gratuitously add a dependency of that output on Qt, KDE, or such. + +This phase is added after the @code{install} phase. +@end table @end defvr @defvr {Scheme Variable} r-build-system diff --git a/guix/build/qt-build-system.scm b/guix/build/qt-build-system.scm index be2b808901..005157b0a4 100644 --- a/guix/build/qt-build-system.scm +++ b/guix/build/qt-build-system.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2014 Federico Beffa ;;; Copyright © 2014, 2015 Ludovic Courtès ;;; Copyright © 2018 Mark H Weaver -;;; Copyright © 2019 Hartmut Goebel +;;; Copyright © 2019, 2020 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -36,6 +36,17 @@ ;; ;; Code: +(define* (check-setup #:rest args) + ;; Make Qt render "offscreen". In many cases this allows to run tests + ;; without starting a X11 server. + (setenv "QT_QPA_PLATFORM" "offscreen") + ;; Qt/KDE tests often need dbus (`dbus-launch …`) which is not fully + ;; set-up the the build container. + (setenv "DBUS_FATAL_WARNINGS" "0") + ;; Set here to ease overwriting 'check (even if set there, too) + (setenv "CTEST_OUTPUT_ON_FAILURE" "1") + #t) + (define (variables-for-wrapping base-directories) (define (collect-sub-dirs base-directories subdirectory) @@ -101,6 +112,7 @@ add a dependency of that output on Qt." (define %standard-phases (modify-phases cmake:%standard-phases + (add-before 'check 'check-setup check-setup) (add-after 'install 'qt-wrap wrap-all-programs))) (define* (qt-build #:key inputs (phases %standard-phases)