Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS - Appears to have NW RFC Library available #58

Closed
codercatdev opened this issue Oct 3, 2018 · 4 comments
Closed

MacOS - Appears to have NW RFC Library available #58

codercatdev opened this issue Oct 3, 2018 · 4 comments

Comments

@codercatdev
Copy link

"OS X and ARM platforms are currently not supported, as SAP NW RFC Library is not available for those platforms"

Could this be opened up to allow for MacOS development?

image

@bsrdjan
Copy link
Member

bsrdjan commented Oct 12, 2018

Yes, as soon I get some free capacity.

@bsrdjan
Copy link
Member

bsrdjan commented Oct 29, 2018

The experimental support is provided in @next 1.0.0-rc4 and perhaps someone could help clarify following.

In which folder should SAP NW RFC Library be installed on MacOS ? Are there best practices, like where such libraries should/must be installed?

After SAP NW RFC Library installed, the node-rfc should be able to find it and I am not sure about optimal solution here.

Using DYLD* environment variables is inconvenient as MacOS SIP removes these variables from sub-processes context. That way, mocha for example, or any other node script with subprocess, is not any more able to find SAP NW RFC Library.

This library can't be bundled and shipped with node-rfc and perhaps the prerequisite could be using fixed location (which one?), the same I am using on test/dev Mac ?

Asked also here. Feedback/ideas from MacOS experts would be helpful. Here the current setup:

skizze

@bsrdjan
Copy link
Member

bsrdjan commented Dec 6, 2018

Clarifications are still ongoing how SAP NW RFC SDK dylibs for MacOS should be best installed on MaOC system. MacOS bindings are provided as of prerelease 6 (just published).
You may download SAP NW RFC SDK into any folder and adjust the rpath in sapnwrfc.node and SAP NW RFC SDK libs, like

install_name_tool --rpath <old-path> <new-path> <file>

@bsrdjan
Copy link
Member

bsrdjan commented Dec 12, 2018

The macOS section added to documentation and here are scripts to show and set remote macOS dylib paths, in SAP NW RFC SDK for macOS:

show_paths.sh

#!/bin/bash
ARG1=${1:--D}
for filename in lib/*.dylib; do
    otool "$ARG1" $filename
    printf "\n"
done

for filename in bin/*; do
    otool "$ARG1" $filename
    printf "\n"
done

set_paths.sh

#!/bin/bash

if [ -z "$SAPNWRFC_HOME" ]; then
    echo "SAPNWRFC_HOME env variable not set. Should point to SAP NWRFC SDK library root"
    exit 1
fi

#
# lib folder fix
#

cd lib
RPATH="$SAPNWRFC_HOME/lib"
for filename in *.dylib; do
    # LC_RPATH
    install_name_tool -add_rpath $RPATH $filename 
    # LC_ID_DYLIB
    install_name_tool -id @rpath/$filename $filename
done
# LC_LOAD_DYLIB
install_name_tool -change libicuuc.50.dylib @rpath/libicuuc.50.dylib libicui18n.50.dylib
install_name_tool -change libicudata.50.dylib @rpath/libicudata.50.dylib libicui18n.50.dylib
install_name_tool -change libicudata.50.dylib @rpath/libicudata.50.dylib libicuuc.50.dylib
cd ..

#
# bin folder fix
#

cd bin
for filename in *; do
    chmod +x $filename
    # LC_RPATH
    install_name_tool -add_rpath $RPATH $filename 
    # LC_ID_DYLIB
    install_name_tool -id @rpath/$filename $filename
    # LC_LOAD_DYLIB
    install_name_tool -change @loader_path/libsapnwrfc.dylib @rpath/libsapnwrfc.dylib $filename
    install_name_tool -change @loader_path/libsapucum.dylib @rpath/libsapucum.dylib $filename
done
cd ..

Please feel free to try and let me know if works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants