Skip to content

Commit

Permalink
Merge pull request ElektraInitiative#3761 from mpranj/enablejni
Browse files Browse the repository at this point in the history
actions: enable jni plugin
  • Loading branch information
mpranj authored Apr 29, 2021
2 parents 7e9ac3a + 4528240 commit d6f2175
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 65 deletions.
75 changes: 38 additions & 37 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,44 +129,45 @@ mac_task:
- | # Install Homebrew formulas
brew update
brew config
brew install openjdk
brew install antlr
brew install antlr4-cpp-runtime
brew install augeas
brew install bison
brew install boost
brew install clang-format
brew install dbus
brew install openjdk \
antlr \
antlr4-cpp-runtime \
augeas \
bison \
boost \
clang-format \
dbus \
discount \
doxygen \
flex \
glib \
go \
gnupg@2.2 \
gpgme \
gradle \
graphviz \
libev \
libgcrypt \
libgit2 \
libuv \
llvm \
lua \
moreutils \
ninja \
npm \
oclint/formulae/oclint \
openssl \
pkg-config \
qt \
shfmt \
swig \
tree \
xerces-c \
yajl \
yaml-cpp \
zeromq
brew upgrade dbus
brew install discount
brew install doxygen
brew install flex
brew install glib
brew install go
brew install gnupg@2.2
brew install gpgme
brew install gradle
brew install graphviz
brew install libev
brew install libgcrypt
brew install libgit2
brew install libuv
brew install llvm
brew install lua
brew install moreutils
brew install ninja
brew install npm
brew install oclint/formulae/oclint
brew install openssl
brew install pkg-config
brew install qt
brew install shfmt
brew install swig
brew install tree
brew install xerces-c
brew install yajl
brew install yaml-cpp
brew install zeromq
- > # Try to install `checkbashisms` (The file server that hosts the package is unfortunately quite unreliable.)
brew install checkbashisms || >&2 printf 'Warning: Unable to install `checkbashims`\n'
- | # Start D-Bus session bus
Expand Down
42 changes: 19 additions & 23 deletions .github/workflows/macOS_gcc10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ env:
BUILD_TYPE: RelWithDebInfo
# Unfortunately the tests for the Xerces plugin fail: https://travis-ci.org/ElektraInitiative/libelektra/jobs/483331657#L3740
# The curlget tests fail: https://github.com/ElektraInitiative/libelektra/issues/3382
# The tests fail with jni: https://github.com/ElektraInitiative/libelektra/issues/3747
PLUGINS: 'ALL;-xerces;-curlget;-jni'
PLUGINS: 'ALL;-xerces;-curlget'
BINDINGS: 'ALL;-rust'
# Skip homebrew cleanup to avoid issues with removal of packages
HOMEBREW_NO_INSTALL_CLEANUP: 1
Expand Down Expand Up @@ -38,30 +37,27 @@ jobs:
run: |
brew update
brew config
brew install augeas
brew install bison
brew install dbus
brew install discount
brew install flex
brew install gnupg@2.2
brew install gpgme
brew install libev
brew install libgcrypt
brew install libgit2
brew install libuv
brew install lua
brew install ninja
brew install openjdk
brew install qt
brew install swig
brew install yajl
brew install zeromq
brew install augeas \
bison \
dbus \
discount \
flex \
gnupg@2.2 \
gpgme \
libev \
libgcrypt \
libgit2 \
libuv \
lua \
ninja \
qt \
swig \
yajl \
zeromq
brew install --cask adoptopenjdk
- name: Setup Build Environment
run: |
sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
echo "JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk.jdk/Contents/Home" >> $GITHUB_ENV
echo "/usr/local/opt/openjdk/bin" >> $GITHUB_PATH
echo "/usr/local/opt/gnupg@2.2/bin" >> $GITHUB_PATH
gem install test-unit --no-document
pip2 install cheetah # Required by kdb-gen
Expand Down
1 change: 1 addition & 0 deletions doc/news/_preparation_next_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ you up to date with the multi-language support provided by Elektra.
### GitHub Actions

- Pin GnuPG version to 2.2.x. _(Mihael Pranjić)_
- Enable `jni` plugin and fix `JAVA_HOME` detection. _(Mihael Pranjić)_
- <<TODO>>
- <<TODO>>

Expand Down
13 changes: 8 additions & 5 deletions src/plugins/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ include (LibAddBinding)
include (SafeCheckSymbolExists)

if (DEPENDENCY_PHASE)
set (JAVA_HOME $ENV{JAVA_HOME})
if (APPLE)
execute_process (
COMMAND "/usr/libexec/java_home --failfast"
ERROR_QUIET
OUTPUT_VARIABLE JAVA_HOME
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT DEFINED JAVA_HOME)
execute_process (
COMMAND "/usr/libexec/java_home" "--failfast"
ERROR_QUIET
OUTPUT_VARIABLE JAVA_HOME
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif ()
endif ()

find_package (JNI QUIET)
Expand Down

0 comments on commit d6f2175

Please sign in to comment.