Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 36a6277

Browse files
authored
Avoid perl path from build machine appearing in wheel / binary distributions (#800)
In case of wheel, neuron wrapper scripts will set `CORENRN_PERLEXE` variable pointing to perl binary to use. Prefer that over `PERL_EXECUTABLE` found by CMake Fixes #799
1 parent df95cea commit 36a6277

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

extra/nrnivmodl-core.in

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ APP_NAME=$(basename $0)
1919

2020
# directory and parent directory of this script
2121
PARENT_DIR="$(dirname $BASH_SOURCE)/.."
22-
ROOT_DIR=$(@PERL_EXECUTABLE@ -e "use Cwd 'abs_path'; print abs_path('$PARENT_DIR')")
22+
23+
# prefer perl exe set by neuron wrappers in case of wheel
24+
PERL_EXE=${CORENRN_PERLEXE:-@PERL_EXECUTABLE@}
25+
# in case of mac installer, wrapper is not used and hence
26+
# check if binary exist. otherwise, just rely on perl being
27+
# in default $PATH
28+
if [ ! -f "${PERL_EXE}" ]; then PERL_EXE=$(which perl); fi
29+
30+
ROOT_DIR=$(${PERL_EXE} -e "use Cwd 'abs_path'; print abs_path('$PARENT_DIR')")
2331

2432
# default arguments : number of parallel builds and default mod file path
2533
PARALLEL_BUILDS=4

0 commit comments

Comments
 (0)