CONFIG: add stub for config.sh/readline (#3427)

- add homebrew support for readline in foamConfigurePaths
This commit is contained in:
Mark Olesen
2025-08-28 16:57:51 +02:00
parent d8250512f6
commit 19caabbd56
2 changed files with 59 additions and 1 deletions

View File

@ -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}"

27
etc/config.sh/readline Normal file
View File

@ -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=...
#------------------------------------------------------------------------------