Skip to content

Instantly share code, notes, and snippets.

@tresf
Last active August 5, 2021 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tresf/62e1cdf7e368ebd3fe94852105848c3a to your computer and use it in GitHub Desktop.
Save tresf/62e1cdf7e368ebd3fe94852105848c3a to your computer and use it in GitHub Desktop.
  1. Install MacOS 10.15.7 Catalina in an Intel Virtual Machine
  2. Install XCode Command Line tools
    xcode-select --install
  3. Extract Xcode_12.4.xip (this can take while)
  4. Copy newly extracted XCode.app to /Applications
  5. Download Xcode_6.2.dmg, XCode (right click), Show package contents
  6. Browse to Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs and copy to /Library/Developer/CommandLineTools/SDKs
  7. Accept the xcodebuild license
    sudo xcodebuild -license
  8. Install Homebrew
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  9. Install dependencies
    brew install maven openjdk cmake
    ###                ^-- TODO: install openjdk@11, configure maven to use it!
    
    # Note, Tigerbrew may work if Homebrew drops support
    # Note, Homebrew is NOT needed, these can all be installed manually if needed
  10. Clone the repository
    git clone https://github.com/java-native/jssc
  11. Setup the SDKROOT

    SDKROOT

    export MACOSX_DEPLOYMENT_TARGET=10.8
    export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.9.sdk 
  12. Build for x86_64:
    mvn -P x86_64
  13. Build for ARM64 (aarch64, M1, etc):
    export MACOSX_DEPLOYMENT_TARGET=11.0
    export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk 
    
    mvn -P aarch64
  14. Copy the binary file to the source tree
    cp target/cmake/jssc.dylib src/main/resources-precompiled/x86_64/
  15. Commit the changes and push to a branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment