Skip to content

Commit

Permalink
Make published macOS wheels portable (#78)
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 authored Aug 26, 2022
1 parent 7f148d8 commit 649a7f5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build JPY distributions

on:
pull_request:
branches: [ 'master' ]
branches: [ 'master', 'release/v*' ]
push:
branches: [ 'master', 'release/v*' ]

Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# jpy Changelog

## Version 0.11.1
* [#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).
* Publish release to Maven Central with group id `org.jpyconsortium` and artifact id `jpy`. Java-8 compatible jars.
Expand Down
2 changes: 1 addition & 1 deletion jpyutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
__author__ = "Norman Fomferra (Brockmann Consult GmbH) and contributors"
__copyright__ = "Copyright 2015-2018 Brockmann Consult GmbH and contributors"
__license__ = "Apache 2.0"
__version__ = "0.11.0"
__version__ = "0.11.1"


# Setup a dedicated logger for jpyutil.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<groupId>org.jpyconsortium</groupId>
<artifactId>jpy</artifactId>
<version>0.11.0</version>
<version>0.11.1</version>
<packaging>jar</packaging>
<name>Java-Python Bridge</name>

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 649a7f5

Please sign in to comment.