From 1fc15762a10ab1ac47736300bec82c4caa70b78a Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Wed, 18 Sep 2024 22:31:04 +0100 Subject: [PATCH] chapel: use altinstall python@3.12 --- Formula/c/chapel.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Formula/c/chapel.rb b/Formula/c/chapel.rb index 9b3c075524cd..e6e42f0ce624 100644 --- a/Formula/c/chapel.rb +++ b/Formula/c/chapel.rb @@ -1,10 +1,11 @@ class Chapel < Formula + include Language::Python::Shebang desc "Programming language for productive parallel computing at scale" homepage "https://chapel-lang.org/" url "https://github.com/chapel-lang/chapel/releases/download/2.1.0/chapel-2.1.0.tar.gz" sha256 "72593c037505dd76e8b5989358b7580a3fdb213051a406adb26a487d26c68c60" license "Apache-2.0" - revision 2 + revision 3 head "https://github.com/chapel-lang/chapel.git", branch: "main" bottle do @@ -44,6 +45,12 @@ def install # It should be noted that this will expand to: 'for cmd in python3.12 python3 python python2; do' # in our find-python.sh script. inreplace "util/config/find-python.sh", /^(for cmd in )(python3 )/, "\\1#{python} \\2" + inreplace "third-party/chpl-venv/Makefile", "python3 -c ", "#{python} -c " + + # a lot of scripts have a python3 or python shebang, which does not point to python3.12 anymore + Pathname.glob("**/*.py") do |pyfile| + rewrite_shebang detected_python_shebang, pyfile + end libexec.install Dir["*"] # Chapel uses this ENV to work out where to install. @@ -51,6 +58,7 @@ def install ENV["CHPL_GMP"] = "system" # This ENV avoids a problem where cmake cache is invalidated by subsequent make calls ENV["CHPL_CMAKE_USE_CC_CXX"] = "1" + ENV["CHPL_CMAKE_PYTHON"] = python # don't try to set CHPL_LLVM_GCC_PREFIX since the llvm # package should be configured to use a reasonable GCC