Skip to content

Commit

Permalink
Merge pull request #71 from bgilbert/ffm
Browse files Browse the repository at this point in the history
Switch from JNI to the Foreign Function & Memory API
  • Loading branch information
bgilbert authored Apr 9, 2024
2 parents 6c8c525 + 8fb7c60 commit 873615c
Show file tree
Hide file tree
Showing 13 changed files with 393 additions and 2,294 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
- [ ] Update `CHANGELOG.md` and version in `meson.build`
- [ ] Create and push signed tag
- [ ] Verify that GitHub Actions created a [GitHub release](https://github.com/openslide/openslide-java/releases) with release notes and a source tarball
- [ ] [Update openslide-bin](https://github.com/openslide/openslide-bin/issues/new?labels=release&template=release.md)
- [ ] Update website: `_data/releases.yaml`, `_includes/news.md`
- [ ] Send mail to -announce and -users
- [ ] Post to [forum.image.sc](https://forum.image.sc/c/announcements/10)
42 changes: 36 additions & 6 deletions .github/workflows/java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,59 @@ jobs:
dist-base: ${{ steps.dist.outputs.dist-base }}
strategy:
matrix:
os: [ubuntu-latest, macos-14]
os: [ubuntu-latest, macos-14, windows-latest]
include:
- os: ubuntu-latest
dist: dist
defaults:
run:
shell: bash
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: oracle
java-version: 22
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install libopenslide0-dev ninja-build
sudo apt-get install libopenslide0 ninja-build
# Ubuntu 22.04 packages Meson 0.61
pip install --user meson
- name: Install dependencies (macOS)
if: matrix.os == 'macos-14'
run: brew install meson openslide
run: |
brew install meson openslide
# allow smoke test to find OpenSlide
echo "DYLD_LIBRARY_PATH=/opt/homebrew/lib" >> $GITHUB_ENV
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
env:
GH_TOKEN: ${{ github.token }}
run: |
pip install meson ninja
mkdir -p "c:\\openslide"
cd "c:\\openslide"
release=$(gh release list -R openslide/openslide-bin -L 1 \
--json tagName --exclude-drafts --exclude-pre-releases | \
jq -r .[0].tagName | \
tr -d v)
zipname="openslide-bin-${release}-windows-x64"
gh release download -R openslide/openslide-bin "v${release}" \
--pattern "${zipname}.zip"
7z x ${zipname}.zip
# allow smoke test to find OpenSlide
echo "PATH=c:\\openslide\\${zipname}\\bin;$PATH" >> $GITHUB_ENV
- name: Build
run: |
meson setup builddir --prefix=$HOME
meson setup builddir
meson compile -C builddir
meson install -C builddir
- name: Smoke test
run: java -cp builddir/openslide.jar org.openslide.TestCLI fixtures/small.svs
run: |
java --enable-native-access=ALL-UNNAMED -cp builddir/openslide.jar \
org.openslide.TestCLI fixtures/small.svs
- name: Dist
id: dist
if: matrix.dist
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@ This is a Java binding to [OpenSlide](https://openslide.org/).

## Build requirements

- JDK
- JDK ≥ 22
- Meson ≥ 0.62
- OpenSlide ≥ 3.4.0
- pkg-config


## Runtime requirements

- JRE ≥ 22
- OpenSlide ≥ 3.4.0, in the system's library search path or preloaded with
`System.load()` or `System.loadLibrary()`


## Building

```
meson setup builddir
meson compile -C builddir
meson install -C builddir
```

The JAR will be in `builddir/openslide.jar`.


## License

Expand Down
Loading

0 comments on commit 873615c

Please sign in to comment.