Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
00e9e1b3
Unverified
Commit
00e9e1b3
authored
4 years ago
by
Adam J. Stewart
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Java: add spack external find support (#18006)
parent
1ed70d0e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
var/spack/repos/builtin/packages/jdk/package.py
+16
-3
16 additions, 3 deletions
var/spack/repos/builtin/packages/jdk/package.py
var/spack/repos/builtin/packages/openjdk/package.py
+14
-1
14 additions, 1 deletion
var/spack/repos/builtin/packages/openjdk/package.py
with
30 additions
and
4 deletions
var/spack/repos/builtin/packages/jdk/package.py
+
16
−
3
View file @
00e9e1b3
...
...
@@ -3,11 +3,11 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from
spack.util.prefix
import
Prefix
from
spack
import
*
import
os
import
re
import
llnl.util.tty
as
tty
import
os
from
spack.util.prefix
import
Prefix
class
Jdk
(
Package
):
...
...
@@ -79,6 +79,19 @@ class Jdk(Package):
# can symlink all *.jar files to `prefix.lib.ext`
extendable
=
True
executables
=
[
'
^java$
'
]
@classmethod
def
determine_version
(
cls
,
exe
):
output
=
Executable
(
exe
)(
'
-version
'
,
output
=
str
,
error
=
str
)
# Make sure this is actually Oracle JDK, not OpenJDK
if
'
openjdk
'
in
output
:
return
None
match
=
re
.
search
(
r
'
\(build (\S+)\)
'
,
output
)
return
match
.
group
(
1
).
replace
(
'
+
'
,
'
_
'
)
if
match
else
None
@property
def
home
(
self
):
"""
Most of the time, ``JAVA_HOME`` is simply ``spec[
'
java
'
].prefix``.
...
...
This diff is collapsed.
Click to expand it.
var/spack/repos/builtin/packages/openjdk/package.py
+
14
−
1
View file @
00e9e1b3
...
...
@@ -3,9 +3,9 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from
spack
import
*
import
os
import
platform
import
re
# If you need to add a new version, please be aware that:
...
...
@@ -60,6 +60,19 @@ class Openjdk(Package):
# can symlink all *.jar files to `prefix.lib.ext`
extendable
=
True
executables
=
[
'
^java$
'
]
@classmethod
def
determine_version
(
cls
,
exe
):
output
=
Executable
(
exe
)(
'
-version
'
,
output
=
str
,
error
=
str
)
# Make sure this is actually OpenJDK, not Oracle JDK
if
'
openjdk
'
not
in
output
:
return
None
match
=
re
.
search
(
r
'
\(build (\S+)\)
'
,
output
)
return
match
.
group
(
1
).
replace
(
'
+
'
,
'
_
'
)
if
match
else
None
@property
def
home
(
self
):
"""
Most of the time, ``JAVA_HOME`` is simply ``spec[
'
java
'
].prefix``.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment