Skip to content

Commit

Permalink
Make published macOS wheels portable
Browse files Browse the repository at this point in the history
This has the effect of removing the non-portable LC_LOAD_DYLIB and LC_RPATH directives for libjvm.dylib from the .so file.

Fixes #79, see for more details
  • Loading branch information
devinrsmith committed Aug 21, 2022
1 parent 254ed45 commit 22fa89b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# jpy Changelog

## Version 0.11.1.dev0 (in development)
* [#79](https://github.com/jpy-consortium/jpy/issues/79) Produce usable / distributable macosx wheels

## Version 0.11.0
* Publish artifacts to [PyPi](https://pypi.org/project/jpy/). Source tarball and binary wheels for Python 3.6 - 3.10 for Linux, Mac, and Windows (x86_64).
Expand Down
13 changes: 10 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,16 @@
extra_link_args += ['-Xlinker', '-rpath', jvm_dll_dir]
elif platform.system() == 'Darwin':
include_dirs += [os.path.join(jdk_home_dir, 'include', 'darwin')]
library_dirs += [os.path.join(sys.exec_prefix, 'lib')]
extra_link_args += ['-Xlinker', '-rpath', jvm_dll_dir]

if is_ci:
# This has the effect of removing the non-portable LC_LOAD_DYLIB and LC_RPATH directives for libjvm.dylib from the .so files.
# See https://github.com/jpy-consortium/jpy/issues/79 for details.
libraries = None
library_dirs = None
else:
# Remove local build workaround for non-portable macOS wheels
# TODO: https://github.com/jpy-consortium/jpy/issues/80
library_dirs += [os.path.join(sys.exec_prefix, 'lib')]
extra_link_args += ['-Xlinker', '-rpath', jvm_dll_dir]

# ----------- Functions -------------
def _build_dir():
Expand Down

0 comments on commit 22fa89b

Please sign in to comment.