From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UK8TLiAX+GBSoQAAgWs5BA (envelope-from ) for ; Wed, 21 Jul 2021 14:46:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YLfIKSAX+GDQcwAAB5/wlQ (envelope-from ) for ; Wed, 21 Jul 2021 12:46:24 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F03E01544 for ; Wed, 21 Jul 2021 14:46:23 +0200 (CEST) Received: from localhost ([::1]:37090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6BcF-0001vL-3W for larch@yhetil.org; Wed, 21 Jul 2021 08:46:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6Bay-0000mM-HW for guix-patches@gnu.org; Wed, 21 Jul 2021 08:45:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53093) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6Baw-0004Sj-CZ for guix-patches@gnu.org; Wed, 21 Jul 2021 08:45:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m6Baw-0007m9-BS for guix-patches@gnu.org; Wed, 21 Jul 2021 08:45:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49456] [PATCH] gnu: Add modules. References: <20210707085932.20751-1-i.gankevich@spbu.ru> In-Reply-To: <20210707085932.20751-1-i.gankevich@spbu.ru> Resent-From: Ivan Gankevich Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 21 Jul 2021 12:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49456 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49456@debbugs.gnu.org Cc: Ivan Gankevich Received: via spool by 49456-submit@debbugs.gnu.org id=B49456.162687149929867 (code B ref 49456); Wed, 21 Jul 2021 12:45:02 +0000 Received: (at 49456) by debbugs.gnu.org; 21 Jul 2021 12:44:59 +0000 Received: from localhost ([127.0.0.1]:36406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6Bas-0007lf-J1 for submit@debbugs.gnu.org; Wed, 21 Jul 2021 08:44:59 -0400 Received: from mail.spbu.ru ([195.70.197.23]:52895 helo=cgp2.pu.ru) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6Bap-0007lM-9z for 49456@debbugs.gnu.org; Wed, 21 Jul 2021 08:44:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=spbu.ru; s=20180812; bh=jiLef6AvnR1o83uZVDfj9wDpjuPKmSbI78gU3xdujBM=; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject :Cc:To:From; b=Ndv1xaKDvWuO+C9DlOKrfwW1qA1vy5o8YWGxJ0Lbg23iRUqrzg+i7khCjUECCv AE4mH4y2jkWFqz0q0UDusWqj6DpxSi44tdk1wBsAybtbpBPbXVWvYg0f3wfIHmSEHTecUODcGq8Ll KXJuAWdYwwFCAivIUnZttinY1v5ao/Gfx3siD72BrYke3lV7+dUKasN2IOd9uJBydmtZ8V2I9ayOT do07ZHE7HuLuDj9AQhQWZgFkZJ1VRaL9yVGXurR01g0WwJAy5gOqo/lsuphQiTY6xo2bUxTU8qNHW ijw/ybSOZkqdPBDAdVlij7BHAKJ8oOc0mx33fvLWE6ZdDG0Gw== Received: from [172.27.221.159] (account st018947@spbu.ru HELO localhost.localdomain) by spbu.ru (CommuniGate Pro SMTP 6.2.15) with ESMTPSA id 173233908; Wed, 21 Jul 2021 15:44:47 +0300 From: Ivan Gankevich Date: Wed, 21 Jul 2021 15:27:38 +0300 Message-Id: <20210721122736.17604-1-i.gankevich@spbu.ru> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626871584; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=9e5KejRKUO98yygKbEcnlNbCWUwLKo3SCeI6TpO32pc=; b=J5rgqrpRtYs7pF89IchIm3L/UWPc9x4rJ8gf5ilDZhv3fH7cGBCui3g/MCZ0MLMohX0xn0 yweVZjNzegRDDP//B52cftb2Obnbf0OITlghZ/vyLiQe3s66jhvTCMV4vIXWMaUd4yh2S3 7mmohDgNP9b9FtOuVGNMtzBP8xKg5OfVBYUTb3omXMio5tDB/x/cOJFX88hIKeE+GAq6Yr AFQk4DUpZpZv0WZLtj4KTf0sM/SYhCl5s1tNMU6ysMe0ox3tFUKDvINCWuMCjhSNMhzF9d NAKbH/UTs/gL5s1/BksvgbVjBXLpQoIfuVWRUOWAP9oITN8eVNx2gfGF1D9gPQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626871584; a=rsa-sha256; cv=none; b=Y2kemdwxSPOqZv56bArAh224Hz/vWwEixNe1HkUL/E2GQ2uKHWfkw2x8TMFYOYYDz9YzH0 fSqzFGZQl8TeJ/dDxc+rVOsjcQno/06Pbo87nHCEDdHe+FDcXyjHCzGFQCSGa4TGxvSaCl 8pvHFvxXFmvy7eXL1lVzs0JYa2mtI3efCvrvTrsS5+/a4gccnk23a6mhJZflx/9/kTNAId IeDsKJcsG05Hm4zF8K9KTrRfaT7d/HIXZBRMCWYL5dGsrirb8o2sXAcuyTflglVQ70Y79u UxMLokttE+2uQaL+REzK2vRtHhLbiHW2qT6LMSh2U7ClP8hVHro9JxvbMPtE0A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spbu.ru header.s=20180812 header.b=Ndv1xaKD; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 1.08 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spbu.ru header.s=20180812 header.b=Ndv1xaKD; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: F03E01544 X-Spam-Score: 1.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: acslPdCKIUMH * gnu/packages/package-management.scm (modules): New variable. --- gnu/packages/package-management.scm | 109 ++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index c2c7846630..d3dc8e593b 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2020 Jesse Gibbons ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2020 Vincent Legoll +;;; Copyright © 2021 Ivan Gankevich ;;; ;;; This file is part of GNU Guix. ;;; @@ -52,6 +53,7 @@ #:use-module (gnu packages crypto) #:use-module (gnu packages curl) #:use-module (gnu packages databases) + #:use-module (gnu packages dejagnu) #:use-module (gnu packages dbm) #:use-module (gnu packages docbook) #:use-module (gnu packages file) @@ -64,6 +66,7 @@ #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) #:use-module (gnu packages hurd) + #:use-module (gnu packages less) #:use-module (gnu packages libedit) #:use-module (gnu packages linux) #:use-module (gnu packages lisp) @@ -83,6 +86,7 @@ #:use-module (gnu packages serialization) #:use-module (gnu packages sqlite) #:use-module (gnu packages ssh) + #:use-module (gnu packages tcl) #:use-module (gnu packages texinfo) #:use-module (gnu packages time) #:use-module (gnu packages tls) @@ -1494,3 +1498,108 @@ It is mainly meant for programmers who develop portable programs or libraries in but could potentially work for end-users of those programs. It also has a translator from R7RS, which allows most R7RS code to run on R6RS implementations.") (license license:gpl3+))) + +(define-public modules + (package + (name "modules") + (version "4.8.0") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/modules/Modules/modules-" + version "/modules-" version ".tar.bz2")) + (sha256 (base32 "1amz8qdqbvfdc8jv0j4720vywbz2gi7l3sr1lh37ilfbxy9lq9g9")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags + (list (string-append "--with-bin-search-path=" + (assoc-ref %build-inputs "tcl") "/bin" ":" + (assoc-ref %build-inputs "procps") "/bin" ":" + (assoc-ref %build-inputs "less") "/bin" ":" + (assoc-ref %build-inputs "coreutils") "/bin") + (string-append "--with-tcl=" (assoc-ref %build-inputs "tcl") "/lib") + "--disable-compat-version") + #:test-target "test" + #:phases + (modify-phases %standard-phases + (add-before 'configure 'patch-scripts-for-python-3 + (lambda _ + ;; Patch the script for python-3. + (substitute* "script/createmodule.py.in" + (("pathkeys.sort\\(\\)") "pathkeys = sorted(pathkeys)") + (("print\\(\"\\\\t\"\\*") "print(\"\\t\"*int") + (("@PYTHON@") (which "python3"))))) + (add-before 'check 'patch-/bin/sh-and-nixbld-groups-in-tests + (lambda _ + (use-modules (srfi srfi-1)) + (let* ((groups-file (string-append (getcwd) "/nixbld-groups")) + (groups-file-z (string-append groups-file "-z")) + (nixbld-groups + (fold + (lambda (id prev) + (catch #t + (lambda () (cons (group:name (getgrnam id)) prev)) + (lambda _ prev))) + '() + (vector->list (getgroups))))) + ;; Simulate "id -G -n" command output. + (call-with-output-file groups-file + (lambda (port) + (display (string-join nixbld-groups " ") port) + (display #\newline port))) + ;; Simulate "id -G -n -z" command output. + (call-with-output-file groups-file-z + (lambda (port) + (for-each + (lambda (group-name) + (display group-name port) + (display #\null port)) + nixbld-groups))) + ;; Generate "modulecmd-test.tcl" before running "make test". + (invoke "make" "modulecmd-test.tcl") + ;; Substitute shell. + (substitute* + '("modulecmd-test.tcl" + "modulecmd.tcl" + "testsuite/modules.70-maint/380-edit.exp" + "compat/init/filter") + (("/bin/sh") (which "sh"))) + ;; Skip tests that use supplementary groups. + (for-each + delete-file + '("testsuite/modules.20-locate/112-hide-user-group.exp" + "testsuite/modules.20-locate/117-forbid-user-group.exp" + "testsuite/modules.20-locate/119-hide-cascading.exp" + "testsuite/modules.50-cmds/140-system.exp" + "testsuite/modules.50-cmds/287-info-usergroups.exp" + "testsuite/modules.50-cmds/440-module-tag.exp" + "testsuite/modules.70-maint/220-config.exp")) + (for-each + (lambda (file) + (substitute* file + (("/bin/sh") (which "bash")) + ;; For some reason "kvm" group cannot be resolved for + ;; "nixbld" user. We replace "id ..." commands with + ;; "cat ..." that simulates them. + (("exec id -G -n -z") (string-append "exec cat " groups-file-z)) + (("exec id -G -n") (string-append "exec cat " groups-file)))) + '("testsuite/modules.00-init/005-init_ts.exp" + "testsuite/install.00-init/005-init_ts.exp" + "modulecmd-test.tcl")))))))) + (native-inputs + `(("dejagnu" ,dejagnu) + ("autoconf" ,autoconf) + ("which" ,which))) + (inputs + `(("tcl" ,tcl) + ("less" ,less) + ("procps" ,procps) + ("coreutils" ,coreutils) + ("python" ,python-3))) + (home-page "http://modules.sourceforge.net/") + (synopsis "Shell environment variables and aliases management") + (description "Modules simplify shell initialization and let users +modify their environment during the session with modulefiles. Modules are +used on high-performance clusters to dynamically add and remove paths +to specific versions of applications.") + (license license:gpl2+))) -- 2.32.0