-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
93 lines (70 loc) · 3.4 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
name openjdk22-graalvm
categories java devel
maintainers {breun.nl:nils @breun} openmaintainer
platforms {darwin any}
# This port uses prebuilt binaries; 'NoMirror' makes sure MacPorts doesn't mirror/distribute these third-party binaries
license GPL-2 NoMirror
# This port uses prebuilt binaries for a particular architecture; they are not universal binaries
universal_variant no
# https://github.com/graalvm/graalvm-ce-builds/releases
supported_archs x86_64 arm64
version 22.0.1
set build 8
revision 0
description GraalVM Community Edition based on OpenJDK 22
long_description GraalVM is a universal virtual machine for running applications written in JavaScript, Python, Ruby, R,\
JVM-based languages like Java, Scala, Groovy, Kotlin, Clojure, and LLVM-based languages such as C and C++.
master_sites https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${version}/
if {${configure.build_arch} eq "x86_64"} {
distname graalvm-community-jdk-${version}_macos-x64_bin
checksums rmd160 2e0d1339308e6f1b8a7c2ba44d486eabfb08fc4d \
sha256 553c2dff3febd45f917e45f4dd620c194d8225bc28d13f5545ddffea9eeb30f8 \
size 290983419
} elseif {${configure.build_arch} eq "arm64"} {
distname graalvm-community-jdk-${version}_macos-aarch64_bin
checksums rmd160 4a4f0072289b0035989a7ace7b84ff152f104c40 \
sha256 b96a16359c800374af5fbd3cb685aaa91cfc590ea4be35538c24b37e12c769c0 \
size 303929385
}
worksrcdir graalvm-community-openjdk-${version}+${build}.1
homepage https://www.graalvm.org
livecheck.type none
use_configure no
build {}
variant Applets \
description { Advertise the JVM capability "Applets".} {}
variant BundledApp \
description { Advertise the JVM capability "BundledApp". This is required by some java-based app bundles to recognize and use the JVM.} {}
variant JNI \
description { Advertise the JVM capability "JNI". This is required by some java-based app bundles to recognize and use the JVM.} {}
variant WebStart \
description { Advertise the JVM capability "WebStart".} {}
patch {
foreach var { Applets BundledApp JNI WebStart } {
if {[variant_isset ${var}]} {
reinplace -E "s|^(\[\[:space:\]\]*<string>)CommandLine(</string>)|\\1${var}\\2\\\n\\1CommandLine\\2|" ${worksrcpath}/Contents/Info.plist
}
}
}
test.run yes
test.cmd Contents/Home/bin/java
test.target
test.args -version
# macOS Java tools expect to find Java virtual machines under /Library/Java/JavaVirtualMachines, which is not under ${prefix}.
destroot.violate_mtree yes
set jvms /Library/Java/JavaVirtualMachines
set jdk ${jvms}/jdk-22-oracle-graalvm-community.jdk
destroot {
xinstall -m 755 -d ${destroot}${prefix}${jdk}
copy ${worksrcpath}/Contents ${destroot}${prefix}${jdk}
# macOS Java tools expect to find Java virtual machines under /Library/Java/JavaVirtualMachines, so let's create a symlink there
xinstall -m 755 -d ${destroot}${jvms}
ln -s ${prefix}${jdk} ${destroot}${jdk}
}
notes "
If you have more than one JDK installed you can make ${name} the default\
by adding the following line to your shell profile:
export JAVA_HOME=${jdk}/Contents/Home
"