From patchwork Wed Feb 7 06:39:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Tropin X-Patchwork-Id: 59872 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 F3C5527BBEB; Wed, 7 Feb 2024 06:44:18 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 5E00F27BBE2 for ; Wed, 7 Feb 2024 06:44:16 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXbey-0007O1-8O; Wed, 07 Feb 2024 01:43:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXbev-0007Nh-VB for guix-patches@gnu.org; Wed, 07 Feb 2024 01:43:50 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rXbev-0004kz-Lu for guix-patches@gnu.org; Wed, 07 Feb 2024 01:43:49 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rXbf7-0005v7-Vv for guix-patches@gnu.org; Wed, 07 Feb 2024 01:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68964] [PATCH] gnu: elixir: Remove wrap for mix. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 07 Feb 2024 06:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68964 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68964@debbugs.gnu.org Cc: Pierre-Henry =?utf-8?b?RnLDtmhyaW5n?= , Liliana Marie Prikler , Andrew Tropin X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170728820922708 (code B ref -1); Wed, 07 Feb 2024 06:44:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Feb 2024 06:43:29 +0000 Received: from localhost ([127.0.0.1]:55607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXbeb-0005uB-0E for submit@debbugs.gnu.org; Wed, 07 Feb 2024 01:43:29 -0500 Received: from lists.gnu.org ([2001:470:142::17]:44006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXbeY-0005tw-Ne for submit@debbugs.gnu.org; Wed, 07 Feb 2024 01:43:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXbeB-0007JU-On for guix-patches@gnu.org; Wed, 07 Feb 2024 01:43:04 -0500 Received: from out-189.mta1.migadu.com ([95.215.58.189]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXbe7-0004bd-RZ for guix-patches@gnu.org; Wed, 07 Feb 2024 01:43:01 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=key1; t=1707288175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=bcCLhOrE5ML3TOMN+I1i3AuiTyd3US3xutK4ExRnZGc=; b=TT8LG/Du9dFr24bSsSXq91Of6dXNDqTqgDSWY/ktSTEyz1hfGmkT5HQ5Ndh91yrcWa9n44 /1J3kO/I5QxdsFXD83aCvziWSPUZAuYRyPFHHz0WfvAXhXaRcgL2rwAxllwa5TXfUQuty1 rSoe6I9p3HNg4qL9S0TuF306TnXe0r4zfeOYM0VrQExqtxg73e7Ejs6MjI1RJkorCTosz6 K8VVNZQOfSwcb4O00oZF33q1pp16OZgO1ID2b/ApUrY8FPsE7lsf+cR+lCel1pIm26u2w2 kwSwFOm2x7+k9WLSte9Q6qQ9B9BaGbQOuxJUYIViIaR81ORyiPrjnECzt/aWpg== Date: Wed, 7 Feb 2024 09:39:22 +0300 Message-ID: <0be1b4f12499d6bf415b4c81971c21ad290cae07.1707287957.git.andrew@trop.in> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=95.215.58.189; envelope-from=andrew@trop.in; helo=out-189.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Reply-to: Andrew Tropin X-ACL-Warn: , Andrew Tropin via Guix-patches X-Patchwork-Original-From: Andrew Tropin via Guix-patches via From: Andrew Tropin Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/elixir.scm (elixir)[#:phases]: Instead of wrapping mix into shell script, which sets environment variables, we patch mix itself and set environmnet variables via elixir code. Change-Id: Ia4643e18fe927491242a0541938b7570bd56fca1 --- gnu/packages/elixir.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) base-commit: cce7a6d2d2b18f51d1fcab67b02a38c11d6f4f2d diff --git a/gnu/packages/elixir.scm b/gnu/packages/elixir.scm index ef8c39d0d7..70a8fad5e8 100644 --- a/gnu/packages/elixir.scm +++ b/gnu/packages/elixir.scm @@ -101,7 +101,18 @@ (define-public elixir (add-after 'install 'wrap-programs (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (programs '("elixir" "elixirc" "iex" "mix"))) + (programs '("elixir" "elixirc" "iex"))) + ;; mix can be sourced as an elixir script by other elixir + ;; program, for example `iex -S mix`, so we should not wrap + ;; mix into shell script. + (substitute* (string-append out "/bin/mix") + (("Mix.start\\(\\)") "\ +~w[GUIX_ELIXIR_LIBS ERL_LIBS] +|> Enum.map(&System.get_env/1) +|> Enum.reject(&is_nil/1) +|> Enum.join(\":\") +|> case do \"\" -> :ok; erl_libs -> System.put_env(\"ERL_LIBS\", erl_libs) end +Mix.start()")) (for-each (lambda (program) (wrap-program (string-append out "/bin/" program) '("ERL_LIBS" prefix ("${GUIX_ELIXIR_LIBS}"))))