From patchwork Fri Sep 23 05:00:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 42859 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 2B9E527BBEA; Fri, 23 Sep 2022 06:03:12 +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 8F6CF27BBE9 for ; Fri, 23 Sep 2022 06:03:11 +0100 (BST) Received: from localhost ([::1]:40208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obaqE-0003YX-ME for patchwork@mira.cbaines.net; Fri, 23 Sep 2022 01:03:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obap9-0003Um-Ou for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obap9-00024f-0d for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1obap8-00054W-Rf for guix-patches@gnu.org; Fri, 23 Sep 2022 01:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58014] [PATCH 02/15] gnu: tigervnc-server: Move source production into origin snippet. 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.166390927019300 (code B ref 58014); Fri, 23 Sep 2022 05:02:02 +0000 Received: (at 58014) by debbugs.gnu.org; 23 Sep 2022 05:01:10 +0000 Received: from localhost ([127.0.0.1]:39001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoH-00051D-P5 for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:10 -0400 Received: from mail-qk1-f177.google.com ([209.85.222.177]:45593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obaoF-00050g-Hl for 58014@debbugs.gnu.org; Fri, 23 Sep 2022 01:01:08 -0400 Received: by mail-qk1-f177.google.com with SMTP id q11so7591269qkc.12 for <58014@debbugs.gnu.org>; Thu, 22 Sep 2022 22:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=7d3RN4pclyNx3ZU8um0Oa9v2Ov9R3zjQr8dtsPISf50=; b=dgYLnxUYzK8wvLEygseOQRiURPBezikkQmabsSxd7crbdKqxuLO5EJE4CyeTUoGFHK iXD8hY5akd2Y+OosF6Ou7G58H/yW41uNlE8EePpQ4rbwXaGi7QmbJWt2ErfDg0FXPrQH h+5J8fJYgEHJfbYaZCo9PFvCkijzz6TWmavZdS8xlE2qU5oQGZw+53Iqb5k9ThRsk4vn rKW0hhuplu7idSL11h/QjVDAjNALg5q5fw/FVRAnuoqqa6W65frXh08W8PUT8rWHP58G a66MKFwx5/baQ8bNPWfR9kATwJYs1gEsnZg5+uQTi0xB5SEOlNDNtz1VTL0j+eL4mbW0 iHXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=7d3RN4pclyNx3ZU8um0Oa9v2Ov9R3zjQr8dtsPISf50=; b=u4FmrXfT4lSwbTZ1sLPQxqFz7h7IenJheT286fZICmts7kry6OPtdeE2A5zc8e58IC y7CwDWYiZIdYgoT/DzVLncRCdlbNt9wkvwgvUmLB00s5AlbwmoFIbdgu8KpwqZ/CBSN4 h9joMN5B0zclxAXSSAll6LI1apPvFhHP17A4S27Or+MbZcejUupFxvJ4ZIk+wNZn9ZRL 99N4VI9LVtxOON+PSV04NI9T3KXkroPcdo0hsuAyVE6Sf90+pfDWMwldByWjRFWyDrTk pkqoz9jykVjnBprlmEwsv1nMu+e54Z3io6M1xjulPybVlfUbz/OCPiLaUnHbsbcBy97U qCeA== X-Gm-Message-State: ACrzQf2QILTE3jCCw7PB6kIZ4Wcx3ALDe4ICp4uQlbp9SxZTxSxbQnNK E3sN6lU4GAj268nBb4RJk/5kZvvTJtE= X-Google-Smtp-Source: AMsMyM7L7n75kahbUuQMP/wY+sH2QWOWA+FpjbQoDAAdlbG8d8D7UQx69fgNCt7x3uqg8PFfdkUWCA== X-Received: by 2002:a05:620a:1651:b0:6cf:468f:aec7 with SMTP id c17-20020a05620a165100b006cf468faec7mr4344781qko.368.1663909261680; Thu, 22 Sep 2022 22:01:01 -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.01.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 22:01:01 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 23 Sep 2022 01:00:29 -0400 Message-Id: <20220923050042.29893-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923050042.29893-1-maxim.cournoyer@gmail.com> References: <20220923050042.29893-1-maxim.cournoyer@gmail.com> 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 This will make it possible to patch command references in source files, and also makes it more transparent as to what sources get used. * gnu/packages/vnc.scm (tigervnc-server): Re-flow comment. [source]: Inherit from xorg-server. Add a snippet. Use a patch to apply the xserver patch. Fix file name. [phases]{copy-tvnc-xserver, patch-xserver}: Delete phases. {build-tigervnc, install-tigervnc-aux}: Adjust accordingly. --- gnu/packages/vnc.scm | 70 ++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/gnu/packages/vnc.scm b/gnu/packages/vnc.scm index 18244b3334..e06dbcceb9 100644 --- a/gnu/packages/vnc.scm +++ b/gnu/packages/vnc.scm @@ -210,20 +210,49 @@ (define-public tigervnc-client (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 -;; where the client is built first, then the source code of the X -;; server is copied into a subdir of the build directory, patched with -;; VNC additions and then build and installed as Xvnc. The procedure -;; was turned around, where TigerVNC code is downloaded and built -;; inside the Guix X server build dir. Also, the VNC patching process -;; for the X server is automated in a straightforward manner. +;; 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 where the client is +;; built first, then the source code of the X server is copied into a subdir +;; of the build directory, patched with VNC additions and then build and +;; installed as Xvnc. The procedure was turned around, where TigerVNC code is +;; downloaded and built inside the Guix X server build dir. Also, the VNC +;; patching process for the X server is automated in a straightforward manner. (define-public tigervnc-server (package (inherit xorg-server) (name "tigervnc-server") (version (package-version tigervnc-client)) + (source + (origin + (inherit (package-source xorg-server)) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Copy the VNC extension into the xorg-server sources. + (copy-recursively #$(file-append %tigervnc-client-source + "/unix/xserver") + ".") + ;; Include a full copy of tigervnc-client sources, so that the + ;; complete sources involved are available and can be edited during + ;; the build. + (copy-recursively #$%tigervnc-client-source "tigervnc-client") + ;; Adjust the VNC extension build system files so that it refers + ;; to it. + (substitute* "hw/vnc/Makefile.am" + (("(TIGERVNC_SRCDIR=).*" _ head) + (string-append head "$(CURDIR)/../../tigervnc-client\n")) + (("(TIGERVNC_BUILDDIR=).*" _ head) + (string-append head + "$(CURDIR)/../../tigervnc-client/build\n"))) + ;; Ensure the Autotools build system gets re-bootstrapped. + (delete-file "configure"))) + ;; Patch the xorg-server build system so that it builds the VNC + ;; extension. + (patches (cons (file-append %tigervnc-client-source + "/unix/xserver21.1.1.patch") + (origin-patches (package-source xorg-server)))) + (file-name (string-append name "-" version ".tar.xz")))) (arguments (substitute-keyword-arguments (package-arguments xorg-server) @@ -254,28 +283,13 @@ (define-public tigervnc-server ((#:phases phases) #~(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" + (mkdir-p "tigervnc-client/build") + (with-directory-excursion "tigervnc-client/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)))))) @@ -286,7 +300,7 @@ (define-public tigervnc-server 1))))) (add-before 'install 'install-tigervnc-aux (lambda _ - (invoke "make" "-C" "tigervnc-build/unix" "install"))) + (invoke "make" "-C" "tigervnc-client/build/unix" "install"))) (replace 'install (lambda _ (invoke "make" "install")))))))