Skip to content

Commit

Permalink
should finally work?
Browse files Browse the repository at this point in the history
  • Loading branch information
GillesDuvert committed Aug 23, 2023
1 parent 7e246ad commit 4a16fb6
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions scripts/build_gdl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ function prep_packages {
pushd ${ROOT_DIR}/PLplot
mkdir build
pushd ${ROOT_DIR}/PLplot/build
cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}/plplot-local -DENABLE_octave=OFF -DENABLE_qt=OFF -DENABLE_lua=OFF -DENABLE_tk=OFF -DENABLE_python=OFF -DENABLE_tcl=OFF -DPLD_xcairo=OFF -DPLD_wxwidgets=ON -DENABLE_wxwidgets=ON -DENABLE_DYNDRIVERS=ON -DENABLE_java=OFF -DPLD_xwin=ON -DENABLE_fortran=OFF
cmake .. -DENABLE_octave=OFF -DENABLE_qt=OFF -DENABLE_lua=OFF \
-DENABLE_tk=OFF -DENABLE_python=OFF -DENABLE_tcl=OFF -DPLD_xcairo=OFF -DPLD_wxwidgets=ON -DENABLE_wxwidgets=ON \
-DENABLE_DYNDRIVERS=ON -DENABLE_java=OFF -DPLD_xwin=ON -DENABLE_fortran=OFF
make
make install
popd
Expand Down Expand Up @@ -440,14 +442,12 @@ function configure_gdl {
export LIBRARY_PATH=$LIBRARY_PATH:/opt/homebrew/opt/llvm/lib
CMAKE_ADDITIONAL_ARGS=( "-DREADLINEDIR=/opt/homebrew/opt/readline"
"-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++"
"-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang"
"-DCMAKE_PREFIX_PATH=${HOME}/plplot-local" )
"-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang" )
else
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/llvm/lib
CMAKE_ADDITIONAL_ARGS=( "-DREADLINEDIR=/usr/local/opt/readline"
"-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++"
"-DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang"
"-DCMAKE_PREFIX_PATH=${HOME}/plplot-local" )
"-DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang" )
fi
fi

Expand Down Expand Up @@ -502,7 +502,6 @@ function install_gdl {
make install || exit 1

cd ${ROOT_DIR}/install
echo "mname="${mname}
echo "ROOT_DIR="${ROOT_DIR}
if [ ${BUILD_OS} == "Windows" ]; then
log "Copying DLLs to install directory..."
Expand Down Expand Up @@ -555,15 +554,12 @@ function test_gdl {
fi
}

# GD: preexisting found_dylib is taken into account in the list. Useful to pass libraries that the resolver do not see
function copy_dylibs_recursive {
install_name_tool -add_rpath $2 $1
for dylib in $(otool -L $1 | grep -e 'local' -e 'rpath' | sed 's; \(.*\);;' |sort|uniq| xargs); do
echo "action: install_name_tool -change $dylib @rpath/$(basename ${dylib}) $1"
for dylib in $(otool -L $1 | grep local | sed 's; \(.*\);;' | xargs); do
install_name_tool -change $dylib @rpath/$(basename ${dylib}) $1
if [[ ! ${found_dylibs[@]} =~ (^|[[:space:]])"$dylib"($|[[:space:]]) ]]; then
found_dylibs+=("${dylib}")
echo $found_dylibs
echo "Copying $(basename ${dylib})..."
cp $dylib $3/
copy_dylibs_recursive $3/$(basename ${dylib}) @executable_path/. $3
Expand Down Expand Up @@ -601,11 +597,11 @@ function pack_gdl {
cp ${GDL_DIR}/resource/gdl.icns Resources/

mkdir Frameworks
#GD: found the need to have plplot libs seen with fixed paths in otool to make he App inependent from the build machine (to export via a DMG)
for dylib in $(otool -l Resources/bin/gdl | grep libplplot | sed -e "s%name %%g;s%(.*)%%g" | xargs); do install_name_tool -change $dylib /usr/local/lib/`basename $dylib` Resources/bin/gdl; done
found_dylibs=()
copy_dylibs_recursive Resources/bin/gdl @executable_path/../../Frameworks Frameworks
# drivers:
for sofile in Resources/share/gnudatalanguage/drivers/*.so ; do copy_dylibs_recursive $sofile @executable_path/../../Frameworks Frameworks; done
echo "dependent libraries added to App's Framework:"
echo $found_dylibs

echo '<?xml version="1.0" encoding="UTF-8"?>' > Info.plist
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> Info.plist
echo '<plist version="1.0">' >> Info.plist
Expand Down

0 comments on commit 4a16fb6

Please sign in to comment.