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

Fix OSX setup #364

Merged
merged 11 commits into from
Nov 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 27 additions & 71 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,35 @@
language: python
language: generic

os:
- osx
- linux

env:
- PYTHON_VERSION="2.7" JAVA_VERSION="8"
- PYTHON_VERSION="3.6" JAVA_VERSION="8"
- PYTHON_VERSION="3.7" JAVA_VERSION="8"
- PYTHON_VERSION="2.7" JAVA_VERSION="9"
- PYTHON_VERSION="3.6" JAVA_VERSION="9"
- PYTHON_VERSION="3.7" JAVA_VERSION="9"
- PYTHON_VERSION="2.7" JAVA_VERSION="10"
- PYTHON_VERSION="3.6" JAVA_VERSION="10"
- PYTHON_VERSION="3.7" JAVA_VERSION="10"
- PYTHON_VERSION="2.7" JAVA_VERSION="11"
- PYTHON_VERSION="3.6" JAVA_VERSION="11"
- PYTHON_VERSION="3.7" JAVA_VERSION="11"

matrix:
fast_finish: true
include:
- language: python
os: linux
env:
- PYTHON_VERSION="2.7"
- JAVA_VERSION="8"
- language: python
os: linux
env:
- PYTHON_VERSION="3.6"
- JAVA_VERSION="8"
- language: python
os: linux
env:
- PYTHON_VERSION="3.7"
- JAVA_VERSION="8"
- language: python
os: linux
env:
- PYTHON_VERSION="3.7"
- JAVA_VERSION="8"
- RUN=sdist
- language: python
os: linux
env:
- PYTHON_VERSION="2.7"
- JAVA_VERSION="9"
- language: python
os: linux
env:
- PYTHON_VERSION="3.6"
- JAVA_VERSION="9"
- language: python
os: linux
env:
- PYTHON_VERSION="3.7"
- JAVA_VERSION="9"
- language: python
os: linux
env:
- PYTHON_VERSION="2.7"
- JAVA_VERSION="10"
- language: python
os: linux
env:
- PYTHON_VERSION="3.6"
- JAVA_VERSION="10"
- language: python
os: linux
env:
- PYTHON_VERSION="3.7"
- JAVA_VERSION="10"
- language: python
os: linux
env:
- PYTHON_VERSION="2.7"
- JAVA_VERSION="11"
- language: python
os: linux
env:
- PYTHON_VERSION="3.6"
- JAVA_VERSION="11"
- language: python
os: linux
env:
- PYTHON_VERSION="3.7"
- JAVA_VERSION="11"


install:
- sudo apt-get update
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh

- if [ "$TRAVIS_OS_NAME" = linux ]; then
sudo apt-get update;
MINICONDAVERSION="Linux";
else
MINICONDAVERSION="MacOSX";
fi;
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-$MINICONDAVERSION-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- echo ". $HOME/miniconda/etc/profile.d/conda.sh" >> $HOME/.bashrc
- source $HOME/.bashrc
Expand Down
20 changes: 11 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,15 @@ def compile_native_invocation_handler(*possible_homes):
)]
else:
LIB_LOCATION = 'jre/lib/server/libjvm.dylib'

if isinstance(JRE_HOME, bytes):
JAVA_HOME = dirname(JRE_HOME.decode())
else:
JAVA_HOME = dirname(JRE_HOME)
FULL_LIB_LOCATION = join(JAVA_HOME, LIB_LOCATION)
FULL_LIB_LOCATION = join(FRAMEWORK, LIB_LOCATION)

if not exists(FULL_LIB_LOCATION):
# In that case, the Java version is very likely >=9.
# So we need to modify the `libjvm.so` path.
LIB_LOCATION = 'lib/server/libjvm.dylib'
JAVA_HOME = getenv('JAVA_HOME')
FULL_LIB_LOCATION = join(JAVA_HOME, LIB_LOCATION)
if not exists(FULL_LIB_LOCATION):
# In that case, the Java version is very likely >=9.
# So we need to modify the `libjvm.so` path.
LIB_LOCATION = 'lib/server/libjvm.dylib'

INCLUDE_DIRS = [
'{0}/include'.format(FRAMEWORK),
Expand Down Expand Up @@ -210,6 +208,10 @@ def compile_native_invocation_handler(*possible_homes):
]

if PLATFORM == 'win32':

if isinstance(JRE_HOME, bytes):
JRE_HOME = JRE_HOME.decode()

LIBRARY_DIRS = [
join(JDK_HOME, 'lib'),
join(JRE_HOME, 'bin', 'server')
Expand Down