From mboxrd@z Thu Jan 1 00:00:00 1970 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 Subject: [bug#39269] [PATCH 1/2] guix: qt-build-system: Add phase `check-setup`. Resent-Message-ID: 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) 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> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 39269@debbugs.gnu.org * 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. =20 -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}: =20 -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=3Doffscreen}, +@code{DBUS_FATAL_WARNINGS=3D0} and +@code{CTEST_OUTPUT_ON_FAILURE=3D1}. + +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/} direc= tories are wrapped in scripts defining the necessary environment variables. @@ -6460,6 +6474,9 @@ by listing their names in the @code{#:qt-wrap-exclu= ded-outputs} parameter. This is useful when an output is known not to contain any Qt binaries, a= nd 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 =20 @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 =C2=A9 2014 Federico Beffa ;;; Copyright =C2=A9 2014, 2015 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2018 Mark H Weaver -;;; Copyright =C2=A9 2019 Hartmut Goebel +;;; Copyright =C2=A9 2019, 2020 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -36,6 +36,17 @@ ;; ;; Code: =20 +(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 =E2=80=A6`) 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) =20 (define (collect-sub-dirs base-directories subdirectory) @@ -101,6 +112,7 @@ add a dependency of that output on Qt." =20 (define %standard-phases (modify-phases cmake:%standard-phases + (add-before 'check 'check-setup check-setup) (add-after 'install 'qt-wrap wrap-all-programs))) =20 (define* (qt-build #:key inputs (phases %standard-phases) --=20 2.21.1