From 09b151ecb2b3984335c265932dc6ba3e4fcb318e Mon Sep 17 00:00:00 2001 From: Michael Hines Date: Wed, 16 Dec 2020 14:42:24 -0500 Subject: [PATCH] Lost a file change from 41ec0b2 due to cherry-pick order. --- packaging/python/fix_demo_libnrnmech.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packaging/python/fix_demo_libnrnmech.sh b/packaging/python/fix_demo_libnrnmech.sh index 4e00e23161..54b58085d7 100755 --- a/packaging/python/fix_demo_libnrnmech.sh +++ b/packaging/python/fix_demo_libnrnmech.sh @@ -3,8 +3,8 @@ set -ex # On Mac, update neurondemo libnrnmech to point to relative libnrniv. # neurondemo dlopens ..../release/x86_64/.libs/libnrnmech.so -# Remove the libnrnmech.so symbolic link. -# Copy ..../release/x86_64/libnrnmech.dylib to ...../lib/libnrnmech.so +# Remove the libnrnmech.so if it is a symbolic link +# and copy ..../release/x86_64/libnrnmech.dylib to ...../lib/libnrnmech.so # Rewrite @rpath/libnrniv.dylib to @loader_path/...../lib/libnrniv.dylib instdir=$1 @@ -12,12 +12,10 @@ REL_RPATH=$2 libnrnmech_dir=$instdir/share/nrn/demo/release/x86_64 if test "`uname -s`" = "Darwin" ; then - if test ! -h "$libnrnmech_dir/.libs/libnrnmech.so" ; then - echo "$libnrnmech_dir/.libs/libnrnmech.so is not a symbolic link" - exit 1 + if test -h "$libnrnmech_dir/.libs/libnrnmech.so" ; then + rm -f $libnrnmech_dir/.libs/libnrnmech.so + mv $libnrnmech_dir/libnrnmech.dylib $libnrnmech_dir/.libs/libnrnmech.so fi - rm -f $libnrnmech_dir/.libs/libnrnmech.so - mv $libnrnmech_dir/libnrnmech.dylib $libnrnmech_dir/.libs/libnrnmech.so install_name_tool -change '@rpath/libnrniv.dylib' \ '@loader_path/../../../../../../lib/libnrniv.dylib' \ $libnrnmech_dir/.libs/libnrnmech.so