Skip to content

Commit 565e8b6

Browse files
authored
Merge pull request #241 from bgilbert/drop-java
Drop OpenSlide Java
2 parents bb1c735 + 6faab1d commit 565e8b6

14 files changed

Lines changed: 18 additions & 169 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ on:
2525
description: Override OpenSlide with this openslide_repo ref
2626
required: false
2727
type: string
28-
openslide_java_repo:
29-
description: Override OpenSlide Java with this repo
30-
required: false
31-
type: string
32-
openslide_java_ref:
33-
description: Override OpenSlide Java with this openslide_java_repo ref
34-
required: false
35-
type: string
3628
openslide_bin_repo:
3729
description: Use openslide-bin from this repo
3830
required: false
@@ -93,21 +85,11 @@ jobs:
9385
fetch-depth: 0
9486
path: override/openslide
9587
persist-credentials: false
96-
- name: Check out OpenSlide Java
97-
if: inputs.openslide_java_repo != ''
98-
uses: actions/checkout@v4
99-
with:
100-
repository: ${{ inputs.openslide_java_repo }}
101-
ref: ${{ inputs.openslide_java_ref }}
102-
# make sure "git describe" works
103-
fetch-depth: 0
104-
path: override/openslide-java
105-
persist-credentials: false
10688
- name: Collect overrides
107-
if: inputs.openslide_repo != '' || inputs.openslide_java_repo != ''
89+
if: inputs.openslide_repo != ''
10890
run: tar cf overrides.tar override
10991
- name: Upload overrides
110-
if: inputs.openslide_repo != '' || inputs.openslide_java_repo != ''
92+
if: inputs.openslide_repo != ''
11193
uses: actions/upload-artifact@v4
11294
with:
11395
name: build-overrides
@@ -196,12 +178,12 @@ jobs:
196178
rm -r "${{ needs.sdist.outputs.archive_base }}" \
197179
"${{ needs.sdist.outputs.archive }}"
198180
- name: Download overrides
199-
if: inputs.openslide_repo != '' || inputs.openslide_java_repo != ''
181+
if: inputs.openslide_repo != ''
200182
uses: actions/download-artifact@v4
201183
with:
202184
name: build-overrides
203185
- name: Unpack overrides
204-
if: inputs.openslide_repo != '' || inputs.openslide_java_repo != ''
186+
if: inputs.openslide_repo != ''
205187
run: tar xf overrides.tar && rm overrides.tar
206188
- name: Build
207189
id: build

artifacts/meson.build

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ artifacts = [
4242
env : env,
4343
),
4444
openslide.get_variable('openslide_headers'),
45-
openslide_java.get_variable('openslide_jar'),
4645
meson.project_source_root() / 'CHANGELOG.md',
4746
]
4847

@@ -72,7 +71,6 @@ postprocess = find_program('postprocess-binary.py')
7271
foreach bin : [
7372
libopenslide,
7473
openslide.get_variable('slidetool'),
75-
openslide_java.get_variable('openslide_jni'),
7674
]
7775
name = fs.name(bin.full_path())
7876
artifacts += custom_target(

artifacts/postprocess-binary.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class Args(TypedArgs):
116116
# filter out acceptable symbols
117117
sym
118118
for sym in syms
119-
if not sym.startswith('openslide_') and sym != 'JNI_OnLoad'
119+
if not sym.startswith('openslide_')
120120
]
121121
if syms:
122122
raise Exception(f'Unexpected exports in {args.file}: {syms}')
@@ -141,16 +141,12 @@ class Args(TypedArgs):
141141
break
142142
else:
143143
raise Exception("Couldn't read LC_RPATH")
144-
if args.file.name.endswith('.jnilib'):
145-
new_rpath = '@loader_path'
146-
else:
147-
new_rpath = '@loader_path/../lib'
148144
subprocess.check_call(
149145
[
150146
os.environ['INSTALL_NAME_TOOL'],
151147
'-rpath',
152148
old_rpath,
153-
new_rpath,
149+
'@loader_path/../lib',
154150
args.output,
155151
]
156152
)

artifacts/write-bdist.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,10 @@ class Args(TypedArgs):
6666
with arc:
6767
for path in args.artifacts:
6868
name = path.name
69-
if re.search(
70-
'\\.(lib|(dylib|jnilib)(\\.dSYM)?|so[.0-9]*(\\.debug)?)$', name
71-
):
69+
if re.search('\\.(lib|dylib(\\.dSYM)?|so[.0-9]*(\\.debug)?)$', name):
7270
arcdir = arc.base / 'lib'
7371
elif name.endswith('.h'):
7472
arcdir = arc.base / 'include' / 'openslide'
75-
elif name.endswith('.jar'):
76-
if meson_host() == 'windows':
77-
arcdir = arc.base / 'bin'
78-
else:
79-
arcdir = arc.base / 'lib'
8073
elif name in (
8174
'CHANGELOG.md',
8275
'VERSIONS.md',

bintool

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ class BuildParams:
147147
return False
148148

149149
with self.lock():
150-
if has_api('winbuild', [1, 2]):
150+
if has_api('winbuild', [1, 2, 3]):
151151
plat: Platform = MesonPlatform(
152152
self, 'windows', 'x64', cross=True
153153
)
154-
elif has_api('linux', [1]):
154+
elif has_api('linux', [1, 2]):
155155
plat = MesonPlatform(self, 'linux', 'x86_64', cross=False)
156156
elif sys.platform == 'darwin':
157157
# no container image to check for
@@ -474,7 +474,6 @@ class SmokeTester(ABC):
474474
class BDistSmokeTester(SmokeTester):
475475
def _parse(self) -> str:
476476
self._name = BDistName(Path(self._fh.name).name)
477-
self._java_libdir = 'bin' if self._name.system == 'windows' else 'lib'
478477
return self._name.system
479478

480479
def _unpack(self, dir: Path) -> None:
@@ -497,22 +496,6 @@ class BDistSmokeTester(SmokeTester):
497496
stdout=subprocess.DEVNULL,
498497
)
499498

500-
log(f'Checking {desc} Java TestCLI')
501-
subprocess.check_call(
502-
cmd_prefix
503-
+ [
504-
'java',
505-
'-cp',
506-
'openslide.jar',
507-
'-Djava.library.path=.',
508-
'org.openslide.TestCLI',
509-
'',
510-
],
511-
cwd=dir / self._name.base / self._java_libdir,
512-
env={**os.environ, 'OPENSLIDE_DEBUG': 'synthetic'},
513-
stdout=subprocess.DEVNULL,
514-
)
515-
516499

517500
class WheelSmokeTester(SmokeTester):
518501
def _parse(self) -> str:
@@ -582,8 +565,7 @@ def do_sdist(args: Args) -> None:
582565

583566
def do_bdist(args: Args) -> None:
584567
params = BuildParams(args.suffix)
585-
for proj in 'openslide', 'openslide-java':
586-
params.args.append(f'-D{proj}:werror={str(args.werror).lower()}')
568+
params.args.append(f'-Dopenslide:werror={str(args.werror).lower()}')
587569
with params.platform(overrides=True) as platform:
588570
result = platform.bdist()
589571
if platform.system == 'windows':
@@ -707,7 +689,7 @@ def main() -> None:
707689
'-w',
708690
'--werror',
709691
action='store_true',
710-
help='Treat OpenSlide and OpenSlide Java build warnings as errors.',
692+
help='Treat OpenSlide build warnings as errors.',
711693
parser=bdist,
712694
)
713695
sdist.set_defaults(func=do_sdist)

common/software.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -272,17 +272,6 @@ def _sqlite3_license(proj: Project) -> tuple[str, str]:
272272
update_url='https://github.com/openslide/openslide/tags',
273273
update_regex=re.compile('archive/refs/tags/v([0-9.]+)\\.tar'),
274274
),
275-
Project(
276-
id='openslide-java',
277-
display='OpenSlide Java',
278-
primary=True,
279-
licenses=['COPYING.LESSER'],
280-
update_url='https://github.com/openslide/openslide-java/tags',
281-
# Exclude old v1.0.0 tag
282-
update_regex=re.compile(
283-
'archive/refs/tags/v1\\.0\\.0\\.tar.*|.*archive/refs/tags/v([0-9.]+)\\.tar' # noqa: E501
284-
),
285-
),
286275
Project(
287276
id='pcre2',
288277
display='PCRE2',

deps/meson.build

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,5 @@ openslide = subproject(
143143
# We don't run tests, but we still check that they build
144144
'default_library=shared',
145145
'doc=disabled',
146-
'_filter_external_symbols=true',
147-
],
148-
)
149-
openslide_java = subproject(
150-
'openslide-java',
151-
default_options : [
152-
'embed_jni_path=disabled',
153146
],
154147
)

machines/cross-macos-arm64.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[built-in options]
22
prefix = '/'
33
c_args = ['-O2', '-g', '-fstack-protector-strong', '--target=aarch64-apple-macosx11']
4-
c_link_args = ['--target=aarch64-apple-macosx11']
4+
c_link_args = ['--target=aarch64-apple-macosx11', '-Wl,-exported_symbol,_openslide_*']
55
cpp_args = ['-O2', '-g', '-fstack-protector-strong', '--target=aarch64-apple-macosx11']
6-
cpp_link_args = ['--target=aarch64-apple-macosx11']
6+
cpp_link_args = ['--target=aarch64-apple-macosx11', '-Wl,-exported_symbol,_openslide_*']
77
objc_args = ['-O2', '-g', '-fstack-protector-strong', '--target=aarch64-apple-macosx11']
8-
objc_link_args = ['--target=aarch64-apple-macosx11']
8+
objc_link_args = ['--target=aarch64-apple-macosx11', '-Wl,-exported_symbol,_openslide_*']
99
pkg_config_path = ''
1010

1111
[properties]

machines/cross-macos-x86_64.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[built-in options]
22
prefix = '/'
33
c_args = ['-O2', '-g', '-fstack-protector-strong', '--target=x86_64-apple-macosx11']
4-
c_link_args = ['--target=x86_64-apple-macosx11']
4+
c_link_args = ['--target=x86_64-apple-macosx11', '-Wl,-exported_symbol,_openslide_*']
55
cpp_args = ['-O2', '-g', '-fstack-protector-strong', '--target=x86_64-apple-macosx11']
6-
cpp_link_args = ['--target=x86_64-apple-macosx11']
6+
cpp_link_args = ['--target=x86_64-apple-macosx11', '-Wl,-exported_symbol,_openslide_*']
77
objc_args = ['-O2', '-g', '-fstack-protector-strong', '--target=x86_64-apple-macosx11']
8-
objc_link_args = ['--target=x86_64-apple-macosx11']
8+
objc_link_args = ['--target=x86_64-apple-macosx11', '-Wl,-exported_symbol,_openslide_*']
99
pkg_config_path = ''
1010

1111
[properties]

meson.options

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# useful subproject options:
22
# -Dopenslide:version_suffix=foo - append foo to OpenSlide version string
33
# -Dopenslide:werror=true - fail OpenSlide build on warnings
4-
# -Dopenslide-java:werror=true - fail OpenSlide Java build on warnings
54

65
option(
76
'all_systems',

0 commit comments

Comments
 (0)