From patchwork Sat May 15 09:17:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 29313 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 8A41D27BC81; Sat, 15 May 2021 10:18:47 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4879D27BC78 for ; Sat, 15 May 2021 10:18:47 +0100 (BST) Received: from localhost ([::1]:46904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhqRa-00019F-G3 for patchwork@mira.cbaines.net; Sat, 15 May 2021 05:18:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhqQs-00014v-L3 for guix-patches@gnu.org; Sat, 15 May 2021 05:18:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36012) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhqQs-0002lS-EI for guix-patches@gnu.org; Sat, 15 May 2021 05:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhqQs-0006AP-AV for guix-patches@gnu.org; Sat, 15 May 2021 05:18:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48232] [PATCH v2 1/2] gnu: Add hg-commitsigs. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 May 2021 09:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48232 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48232@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 48232-submit@debbugs.gnu.org id=B48232.162107024323634 (code B ref 48232); Sat, 15 May 2021 09:18:02 +0000 Received: (at 48232) by debbugs.gnu.org; 15 May 2021 09:17:23 +0000 Received: from localhost ([127.0.0.1]:47555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhqQE-000695-OQ for submit@debbugs.gnu.org; Sat, 15 May 2021 05:17:23 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59842 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhqQ9-00068Q-9W for 48232@debbugs.gnu.org; Sat, 15 May 2021 05:17:17 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1621070231; bh=mJraFbxe1UGteJxmO/OyUbstNTgWE1GCWdgXGw6WGBM=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=U5a0Uy9eTBFBBygUlxsaRLAVthfDTN9I3nRAob4bm8vZNj+qm0m4dq5ivhgjJpoRI HzkyuLQMB5aL1YMwn0a/kUcH4Xe7EkJmq42vvK6uAQnbMNbK62Xar6ydfX4rKZK2E7 gqNyBp1li3+LUD17Wlr36ixs8xEFJSv8CqCXKP5g= In-Reply-To: References: <87k0oecj3a.fsf@yoctocell.xyz> Message-Id: Date: Sat, 15 May 2021 11:17:11 +0200 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/version-control.scm (hg-commitsigs): New variable. --- gnu/packages/version-control.scm | 63 ++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 5438f6349c..1e55c73c0c 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -62,6 +62,7 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix hg-download) + #:use-module (guix build python-build-system) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) @@ -88,6 +89,7 @@ #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) + #:use-module (gnu packages gnupg) #:use-module (gnu packages golang) #:use-module (gnu packages groff) #:use-module (gnu packages guile) @@ -1716,6 +1718,67 @@ interface.") history. It implements the changeset evolution concept for Mercurial.") (license license:gpl2))) +(define-public hg-commitsigs + ;; Latest tag is 11 years old. + (let ((changeset "b53eb6862bff") + (revision "0")) + (package + (name "hg-commitsigs") + (version (git-version "0.1.0" revision changeset)) + (source (origin + (method hg-fetch) + (uri (hg-reference + (url "https://foss.heptapod.net/mercurial/commitsigs") + (changeset changeset))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "059gm66q06m6ayl4brsc517zkw3ahmz249b6xm1m32ac5y24wb9x")))) + (build-system copy-build-system) + (arguments + `(#:imported-modules ((guix build python-build-system) + ,@%copy-build-system-modules) + #:modules ((srfi srfi-1) + (guix build python-build-system) + ;; Don't use `%copy-build-system-modules' because + ;; `standard-phases' from (guix build gnu-build-system) + ;; shadows the one from (guix build copy-build-system), + ;; which is the one we actually want. + (guix build copy-build-system) + ((guix build gnu-build-system) #:prefix gnu) + (guix build utils) + (guix build gremlin) + (ice-9 ftw) + (guix elf)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (let ((gpg (string-append (assoc-ref inputs "gnupg") + "/bin/gpg")) + (openssl (string-append (assoc-ref inputs "openssl") + "/bin/openssl"))) + (substitute* "commitsigs.py" + (("b'gpg',") (string-append "b'" gpg "',")) + (("b'openssl',") (string-append "b'" openssl "',"))))))) + #:install-plan + `(("commitsigs.py" ,(string-append "lib/python" + (python-version + (assoc-ref %build-inputs "python")) + "/site-packages/hgext3rd/commitsigs.py"))))) + (native-inputs + `(("python" ,python))) + (inputs + `(("gnupg" ,gnupg) + ("openssl" ,openssl))) + (home-page "https://foss.heptapod.net/mercurial/commitsigs") + (synopsis "Automatic signing of changeset hashes") + (description "This package provides a Mercurial extension for signing +the changeset hash of commits. The signure is embedded directly in the +changeset itself; there won't be any extra commits. Either GnuPG or OpenSSL +can be used for signing.") + (license license:gpl3+)))) + (define-public neon (package (name "neon") From patchwork Sat May 15 09:17:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 29314 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 5945C27BC81; Sat, 15 May 2021 10:19:00 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 12DAE27BC78 for ; Sat, 15 May 2021 10:19:00 +0100 (BST) Received: from localhost ([::1]:47150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhqRn-0001Ju-6X for patchwork@mira.cbaines.net; Sat, 15 May 2021 05:18:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhqQt-000153-1n for guix-patches@gnu.org; Sat, 15 May 2021 05:18:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhqQs-0002lY-Qw for guix-patches@gnu.org; Sat, 15 May 2021 05:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhqQs-0006AW-N9 for guix-patches@gnu.org; Sat, 15 May 2021 05:18:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48232] [PATCH v2 2/2] gnu: mercurial: Patch to make it read HGEXTENSIONPATH. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 May 2021 09:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48232 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48232@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 48232-submit@debbugs.gnu.org id=B48232.162107024323641 (code B ref 48232); Sat, 15 May 2021 09:18:02 +0000 Received: (at 48232) by debbugs.gnu.org; 15 May 2021 09:17:23 +0000 Received: from localhost ([127.0.0.1]:47557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhqQF-000699-2R for submit@debbugs.gnu.org; Sat, 15 May 2021 05:17:23 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59850 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhqQA-00068V-W4 for 48232@debbugs.gnu.org; Sat, 15 May 2021 05:17:19 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1621070233; bh=CdhLDNNOgsKY2MOOLT2Vnxa+njI50RkWb5qstrjiQbY=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=E3+SH3S9deNYLVE+LxV3WeJuXkYJyOl3a1PCYjat/hHn/x/YXySJ0yzdYLFKY3hsg dkrwy4C0oH8VtQmg5Ly1KJljMfp+TB6IPrLDB1hE815gj2VDbLMxCNVZxxjXw44LpG h9j7AtnEV8U+1pihX0wIAAejFG3JJAznkerA6FyM= In-Reply-To: References: <87k0oecj3a.fsf@yoctocell.xyz> Message-Id: Date: Sat, 15 May 2021 11:17:12 +0200 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 Mercurial be able to find third-party extensions installed with Guix, without having to set PYTHONPATH. * gnu/packages/patches/mercurial-hg-extension-path.patch: New file. * gnu/local.mk (dist_patch_DATA): Register the patch. * gnu/packages/version-control.scm (mercurial)[origin](patches): Apply the patch. [native-search-paths]: Add HGEXTENSIONPATH. --- gnu/local.mk | 1 + .../patches/mercurial-hg-extension-path.patch | 29 +++++++++++++++++++ gnu/packages/version-control.scm | 6 ++++ 3 files changed, 36 insertions(+) create mode 100644 gnu/packages/patches/mercurial-hg-extension-path.patch diff --git a/gnu/local.mk b/gnu/local.mk index c3b0274945..afb745a5fc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1412,6 +1412,7 @@ dist_patch_DATA = \ %D%/packages/patches/mcrypt-CVE-2012-4527.patch \ %D%/packages/patches/libmemcached-build-with-gcc7.patch \ %D%/packages/patches/libmhash-hmac-fix-uaf.patch \ + %D%/packages/patches/mercurial-hg-extension-path.patch \ %D%/packages/patches/mesa-skip-tests.patch \ %D%/packages/patches/mescc-tools-boot.patch \ %D%/packages/patches/meson-for-build-rpath.patch \ diff --git a/gnu/packages/patches/mercurial-hg-extension-path.patch b/gnu/packages/patches/mercurial-hg-extension-path.patch new file mode 100644 index 0000000000..d1073dd01c --- /dev/null +++ b/gnu/packages/patches/mercurial-hg-extension-path.patch @@ -0,0 +1,29 @@ +This is needed to make Mercurial read the HGEXTENSIONPATH to detect +third-party extensions. It is called HGEXTENSIONPATH and not +HG_EXTENSION_PATH to keep it consistent with other environment variables for +Mercurial, e.g. HGENCODINGAMBIGUOUS, HGEDITOR ... Hopefully I or someone else +will get this into Mercurial proper. + +diff --git a/mercurial/extensions.py b/mercurial/extensions.py +--- a/mercurial/extensions.py ++++ b/mercurial/extensions.py +@@ -13,6 +13,7 @@ + import imp + import inspect + import os ++import sys + + from .i18n import ( + _, +@@ -108,6 +109,11 @@ + + def _importh(name): + """import and return the module""" ++ # Read HGEXTENSIONSPATH environment variable when import extensions. ++ extension_path = os.getenv("HGEXTENSIONSPATH") ++ if extension_path is not None: ++ for path in extension_path: ++ sys.path.append(path) + mod = __import__(pycompat.sysstr(name)) + components = name.split(b'.') + for comp in components[1:]: diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 1e55c73c0c..c3be5f1c42 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -1614,6 +1614,7 @@ execution of any hook written in any language before every commit.") (method url-fetch) (uri (string-append "https://www.mercurial-scm.org/" "release/mercurial-" version ".tar.gz")) + (patches (search-patches "mercurial-hg-extension-path.patch")) (sha256 (base32 "17rhlmmkqz5ll3k68jfzpcifg3nndbcbc2nx7kw8xn3qcj7nlpgw")))) @@ -1684,6 +1685,11 @@ execution of any hook written in any language before every commit.") ("which" ,which))) (inputs `(("python" ,python))) + ;; Find third-party extensions. + (native-search-paths + (list (search-path-specification + (variable "HGEXTENSIONPATH") + (files '("lib/python3.8/site-packages/hgext3rd"))))) (home-page "https://www.mercurial-scm.org/") (synopsis "Decentralized version control system") (description