From patchwork Fri Sep 23 05:00:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42857 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 73B6A27BBEA; Fri, 23 Sep 2022 06:03:10 +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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,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 42AB227BBE9 for ; Fri, 23 Sep 2022 06:03:09 +0100 (BST) Received: from localhost ([::1]:38458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obaqC-0003W3-CN for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:03:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obap8-0003Uf-S7 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39954) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obap8-00023h-Jk for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obap8-00054O-F0 for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 01/15] gnu: tigervnc-server: Use new style inputs, gexps. References: <20220923045855.29728-1-maxim.cournoyer@gmail.com> In-Reply-To: <20220923045855.29728-1-maxim.cournoyer@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 23 Sep 2022 05:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58014@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58014-submit@debbugs.gnu.org id=B58014.166390926319279 (code B ref 58014); Fri, 23 Sep 2022 05:02:02 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:03 +0000 Received: from localhost ([127.0.0.1]:38998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoB-00050s-1T for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:03 -0400 Received: from mail-qv1-f41.google.com ([209.85.219.41]:42664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obao9-000506-Ap for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:02 -0400 Received: by mail-qv1-f41.google.com with SMTP id z9so8321686qvn.9 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=zzUlnA7Y46Eisz/HaRw0DchIBCDeXLtulhccEFvKbRU=; b=ZAGAbx1IMBc/5Y+LR1u2s48MMEqNqBl/pIpTJJIlcc2USkc2FdOdXYanp62Pip/66T X/kuzYba8vxYJc8/nsUmgCHZo12eL51y3E9SSliHuRyRYiamI++zUHrhXL6TPqFlP2si 4AipzAUFXzdt2cmwDViEoVMxexCIoq6Xv0skyxmcBOU3uNJan6h4thjO3FLiAP3gpq/Q 0hiqgZRtJysVr5njC+yqr1BiUpSMhjilc0wjMS9VuXfcCnxzC721KHGD+CqEMwnj9Qix //Y5V1BAGV2fA2MZIR8tLr86uBLa5hvoSPWT4bI7yIYXEkGxlYNkuTf0Kel/+SW4+phV Uvbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=zzUlnA7Y46Eisz/HaRw0DchIBCDeXLtulhccEFvKbRU=; b=vrj118URgbGKZvtW9xVQmp4iFEa3/6Q8C6OCjYc8itWOXzidVgo6a9vkHyRlaxJkN5 ecS+Lwz8UMqSYfbQYya0zEqjvQmB+uaNOX08ycC85NCcd1w8RJf240dD6caJdvkdijMP iShz1vdEF/y1XhHKBJjdDkZGE/FIhdXrFH9CAmN0MGrM1t5mndc1+kkU3wnqs/5P4HIl 35gqz1exn0OdkRa9WUTsy6ioDOM7pvH50Uv1VeMxIRu59Vshr7gosFtVINPqtWddjqgR +ZRFYi+tBkHVjsAQLFWy2p0ZK1oH3l1xDp54g8hZL/yN6HEKWbFQ5Q2MHQAGGjbfgy/V 5mSA== X-Gm-Message-State: ACrzQf2utqN7Runp53MdCQaJJLm3gxkPc2KYdBd6FhLzlrEhxUW2hzT9 wDVsL0JA8JBiHWWvc8zxp8g6PBZgos4= X-Google-Smtp-Source: AMsMyM7y52glPAuAuPiuxEaEndabiy8RUF7lhAofxVr5Xq3JMbwFAkDXeeqhdyPIS4nAUeL0exjoJg== X-Received: by 2002:a05:6214:194b:b0:4ac:814e:938c with SMTP id q11-20020a056214194b00b004ac814e938cmr5391083qvk.67.1663909254410; Thu, 22 Sep 2022 22:00:54 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id de4-20020a05620a370400b006bbb07ebd83sm5263534qkb.108.2022.09.22.22.00.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:00:54 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:28 -0400 Message-Id: <20220923050042.29893-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/vnc.scm (%tigervnc-client-source): New variable. (tigervnc-server): Move input fields after arguments. [native-inputs]: Use new style and 'modify-inputs'. Do not add tigervnc-client regular inputs. [configure-flags]: Use gexps, cons* instead of append. [phases]: Use gexps. {check}: Replace smiley with an explanatory comment. {copy-tvnc-xserver}: Adjust default Makefile variables, which simplifies needed bindings in other phases. {build-tigervnc, build, install-tigervnc-aux, install}: Remove let*-bound variables. {build-tigervnc, build}: Honor PARALLEL-BUILD?. --- gnu/packages/vnc.scm | 162 ++++++++++++++++++++----------------------- 1 file changed, 76 insertions(+), 86 deletions(-) diff --git a/gnu/packages/vnc.scm b/gnu/packages/vnc.scm index 84c84aec76..18244b3334 100644 --- a/gnu/packages/vnc.scm +++ b/gnu/packages/vnc.scm @@ -25,6 +25,7 @@ (define-module (gnu packages vnc) #:use-module (guix build-system cmake) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix gexp) @@ -207,6 +208,8 @@ (define-public tigervnc-client application which is needed to connect to VNC servers.") (license license:gpl2)))) +(define %tigervnc-client-source (package-source tigervnc-client)) + ;; A VNC server is, in fact, an X server so it seems like a good idea ;; to build on the work already done for xorg-server package. This is ;; not entirely compatible with the recommendation in BUILDING.txt @@ -221,47 +224,27 @@ (define-public tigervnc-server (inherit xorg-server) (name "tigervnc-server") (version (package-version tigervnc-client)) - (native-inputs - `(("tigervnc-src" ,(package-source tigervnc-client)) - ("autoconf" ,autoconf) - ("automake" ,automake) - ("libtool" ,libtool) - ("gettext-minimal" ,gettext-minimal) - ("font-util" ,font-util) - ("cmake" ,cmake) - ("perl" ,perl) - ,@(package-native-inputs tigervnc-client) - ,@(package-inputs tigervnc-client) - ,@(package-native-inputs xorg-server))) - (inputs - (modify-inputs (package-inputs xorg-server) - (prepend perl coreutils xauth))) - (propagated-inputs - (modify-inputs (package-propagated-inputs xorg-server) - (prepend xauth))) (arguments (substitute-keyword-arguments (package-arguments xorg-server) ((#:configure-flags flags) - `(append '("--with-pic" ; Taken from BUILDING.txt - "--without-dtrace" - "--disable-static" - "--disable-dri2" - "--disable-xinerama" - "--disable-xvfb" - "--disable-xnest" - "--disable-xorg" - "--disable-dmx" - "--disable-xwin" - "--disable-xephyr" - "--disable-kdrive" - ;; "--disable-config-dbus" ; This was a warning. - "--disable-config-hal" - "--disable-config-udev" - "--disable-dri2" - ;; "--enable-install-libxf86config" ; This, too, was a warning. - "--enable-glx") - (delete "--enable-xephyr" ,flags))) + #~(cons* "--with-pic" ; Taken from BUILDING.txt + "--without-dtrace" + "--disable-static" + "--disable-dri2" + "--disable-xinerama" + "--disable-xvfb" + "--disable-xnest" + "--disable-xorg" + "--disable-dmx" + "--disable-xwin" + "--disable-xephyr" + "--disable-kdrive" + "--disable-config-hal" + "--disable-config-udev" + "--disable-dri2" + "--enable-glx" + (delete "--enable-xephyr" #$flags))) ((#:modules modules) `(append '((ice-9 ftw) (ice-9 match) @@ -269,55 +252,62 @@ (define-public tigervnc-server (guix build gnu-build-system)) modules)) ((#:phases phases) - `(modify-phases ,phases - (delete 'check) ;) - (add-after 'unpack 'copy-tvnc-xserver - (lambda _ - (let* - ((tvnc-src (assoc-ref %build-inputs "tigervnc-src")) - (tvnc-xserver (string-append tvnc-src "/unix/xserver"))) - (copy-recursively tvnc-xserver ".")))) - (add-after 'copy-tvnc-xserver 'patch-xserver - (lambda _ - (invoke "patch" "-p1" "-i" - (string-append (assoc-ref %build-inputs "tigervnc-src") - "/unix/xserver21.1.1.patch")) - (invoke "autoreconf" "-fiv"))) - (add-before 'build 'build-tigervnc - (lambda _ - (let* ((out (assoc-ref %outputs "out")) - (tvnc-src (assoc-ref %build-inputs "tigervnc-src")) - (tvnc-build (string-append (getcwd) "/tigervnc-build"))) - (mkdir-p tvnc-build) - (with-directory-excursion tvnc-build - (invoke "cmake" "-G" "Unix Makefiles" - (string-append "-DCMAKE_INSTALL_PREFIX=" out) - tvnc-src) - (invoke "make" "-j" (number->string (parallel-job-count))))))) - (replace 'build - (lambda _ - (let* ((tvnc-src (assoc-ref %build-inputs "tigervnc-src")) - (tvnc-build (string-append (getcwd) "/tigervnc-build")) - (srcarg (string-append "TIGERVNC_SRCDIR=" tvnc-src)) - (buildarg (string-append "TIGERVNC_BUILDDIR=" tvnc-build))) - (invoke "make" srcarg buildarg "-j" - (number->string (parallel-job-count)))))) - (add-before 'install 'install-tigervnc-aux - (lambda _ - (let* ((out (assoc-ref %outputs 'out)) - (tvnc-src (assoc-ref %build-inputs "tigervnc-src")) - (tvnc-build (string-append (getcwd) "/tigervnc-build")) - (srcarg (string-append "TIGERVNC_SRCDIR=" tvnc-src)) - (buildarg (string-append "TIGERVNC_BUILDDIR=" tvnc-build))) - (with-directory-excursion (string-append tvnc-build "/unix") - (invoke "make" srcarg buildarg "install"))))) - (replace 'install - (lambda* _ - (let* ((tvnc-src (assoc-ref %build-inputs "tigervnc-src")) - (tvnc-build (string-append (getcwd) "/tigervnc-build")) - (srcarg (string-append "TIGERVNC_SRCDIR=" tvnc-src)) - (buildarg (string-append "TIGERVNC_BUILDDIR=" tvnc-build))) - (invoke "make" "install" srcarg buildarg)))))))) + #~(modify-phases #$phases + (delete 'check) ;no test suite + (add-after 'unpack 'copy-tvnc-xserver + (lambda* (#:key inputs #:allow-other-keys) + (copy-recursively (search-input-directory inputs "unix/xserver") + ".") + ;; Adjust Makefile variables default values to simplify usage. + (substitute* "hw/vnc/Makefile.am" + (("(TIGERVNC_SRCDIR=).*" _ head) + (string-append head #$%tigervnc-client-source "\n")) + (("(TIGERVNC_BUILDDIR=).*" _ head) + (string-append head (getcwd) "/tigervnc-build\n"))))) + (add-after 'copy-tvnc-xserver 'patch-xserver + (lambda* (#:key inputs #:allow-other-keys) + (invoke "patch" "-p1" "-i" + (search-input-file inputs "unix/xserver21.1.1.patch")) + (invoke "autoreconf" "-fiv"))) + (add-before 'build 'build-tigervnc + (lambda* (#:key parallel-build? #:allow-other-keys) + (mkdir-p "tigervnc-build") + (with-directory-excursion "tigervnc-build" + (invoke "cmake" "-G" "Unix Makefiles" + (string-append "-DCMAKE_INSTALL_PREFIX=" #$output) + #$%tigervnc-client-source) + (invoke "make" "-j" (number->string (if parallel-build? + (parallel-job-count) + 1)))))) + (replace 'build + (lambda* (#:key parallel-build? #:allow-other-keys) + (invoke "make" "-j" (number->string (if parallel-build? + (parallel-job-count) + 1))))) + (add-before 'install 'install-tigervnc-aux + (lambda _ + (invoke "make" "-C" "tigervnc-build/unix" "install"))) + (replace 'install + (lambda _ + (invoke "make" "install"))))))) + (native-inputs + (modify-inputs (append (package-native-inputs xorg-server) + (package-native-inputs tigervnc-client)) + (append %tigervnc-client-source + autoconf + automake + libtool + gettext-minimal + font-util + cmake + perl))) + (inputs + (modify-inputs (append (package-inputs xorg-server) + (package-inputs tigervnc-client)) + (prepend perl coreutils xauth))) + (propagated-inputs + (modify-inputs (package-propagated-inputs xorg-server) + (prepend xauth))) (description "TigerVNC is a client/server implementation of VNC (Virtual Network Computing). It provides enough performance to run even 3D and video applications. It also provides extensions for advanced authentication methods