From 19caabbd56005c68af889469e3a376812b7f258d Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 28 Aug 2025 16:57:51 +0200 Subject: [PATCH] CONFIG: add stub for config.sh/readline (#3427) - add homebrew support for readline in foamConfigurePaths --- bin/tools/foamConfigurePaths | 33 ++++++++++++++++++++++++++++++++- etc/config.sh/readline | 27 +++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 etc/config.sh/readline diff --git a/bin/tools/foamConfigurePaths b/bin/tools/foamConfigurePaths index a5a62456a5..285757d220 100755 --- a/bin/tools/foamConfigurePaths +++ b/bin/tools/foamConfigurePaths @@ -120,6 +120,7 @@ Components specified by absolute path -kahip-path DIR Path for 'KAHIP_ARCH_PATH' (overrides -kahip) -metis-path DIR Path for 'METIS_ARCH_PATH' (overrides -metis) -petsc-path DIR Path for 'PETSC_ARCH_PATH' (overrides -petsc) + -readline-path Path for 'READLINE_ARCH_PATH' -scotch-path DIR Path for 'SCOTCH_ARCH_PATH' (overrides -scotch) -gmp-path DIR Path for 'GMP_ARCH_PATH' (in cgal config) @@ -128,7 +129,7 @@ Components specified by absolute path Components specified by homebrew (treat like system locations) Sets version as system, path from brew --prefix -adios-brew, -adios2-brew, -boost-brew, -cgal-brew, - -fftw-brew, -kahip-brew, -metis-brew, -scotch-brew + -fftw-brew, -kahip-brew, -metis-brew, -readline-brew -scotch-brew -with-homebrew Shortcut for selecting all the above @@ -500,6 +501,7 @@ then -fftw-brew \ -kahip-brew \ -metis-brew \ + -readline-brew \ -scotch-brew \ "$@" fi @@ -1174,6 +1176,35 @@ CONFIG_CSH adjusted=true ;; + -readline-path) + # Replace READLINE_ARCH_PATH=... + getOptionValue "$@"; shift "${nOptArgs:-0}" + + if [ -n "$optValue" ] + then + # Remove leading '#config#' marker + removeEtcConfigMarker config.sh/readline READLINE_ARCH_PATH + + replaceEtc config.sh/readline READLINE_ARCH_PATH "\"$optValue\"" + adjusted=true + else + : "${adjusted:=empty}" + fi + ;; + + -readline-brew) + brewName=readline; optValue="${brewName}-system" + + # Remove leading '#config#' marker + removeEtcConfigMarker config.sh/readline READLINE_ARCH_PATH + + # Replace READLINE_ARCH_PATH=... + replaceBrewEtc config.sh/readline READLINE_ARCH_PATH "$brewName" + + # Replaced READLINE_ARCH_PATH=... + adjusted=true + ;; + -scotch | -scotchVersion | --scotchVersion) # Replace SCOTCH_VERSION=... getOptionValue "$@"; shift "${nOptArgs:-0}" diff --git a/etc/config.sh/readline b/etc/config.sh/readline new file mode 100644 index 0000000000..f1690b80ca --- /dev/null +++ b/etc/config.sh/readline @@ -0,0 +1,27 @@ +#----------------------------------*-sh-*-------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | www.openfoam.com +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# Copyright (C) 2025 OpenCFD Ltd. +#------------------------------------------------------------------------------ +# License +# This file is part of OpenFOAM, distributed under GPL-3.0-or-later. +# +# File +# etc/config.sh/readline +# [optional/experimental: not sourced by OpenFOAM-*/etc/bashrc] +# +# Description +# Example setup for READLINE locations +# +# The leading '#config#' marker provides an edit point for +# foamConfigurePaths +#------------------------------------------------------------------------------ +# USER EDITABLE PART: Changes made here may be lost with the next upgrade + +#config# export READLINE_ARCH_PATH=... + +#------------------------------------------------------------------------------