You've already forked macports-ports
mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
eqwalizer: new port, version 0.25.3
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
# -*- 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
|
||||
PortGroup github 1.0
|
||||
PortGroup java 1.0
|
||||
|
||||
github.setup WhatsApp eqwalizer 0.25.3 v
|
||||
github.tarball_from archive
|
||||
revision 0
|
||||
categories erlang devel
|
||||
maintainers {pguyot @pguyot} openmaintainer
|
||||
license Apache-2
|
||||
|
||||
description A type-checker for Erlang
|
||||
long_description ${description}
|
||||
|
||||
checksums rmd160 f28a45aac84537f2b690cc9af88c00a1030fd51c \
|
||||
sha256 280721884157fa38ab959e87c0031910f067c3b8bf539497edd188def5edd035 \
|
||||
size 600088
|
||||
|
||||
depends_build-append port:erlang \
|
||||
port:sbt
|
||||
|
||||
variant jdk17 conflicts jdk11 description {Build using JDK 17} {
|
||||
depends_build-append port:openjdk17-graalvm
|
||||
java.version 17
|
||||
}
|
||||
|
||||
variant jdk11 conflicts jdk17 description {Build using the older JDK 11} {
|
||||
depends_build-append port:openjdk11-graalvm-native-image
|
||||
java.version 11
|
||||
}
|
||||
|
||||
if {![variant_isset jdk11] && ![variant_isset jdk17]} {
|
||||
default_variants +jdk17
|
||||
}
|
||||
|
||||
pre-fetch {
|
||||
if {![variant_isset jdk11] && ![variant_isset jdk17]} {
|
||||
error "Either +jdk11 or +jdk17 is required"
|
||||
}
|
||||
}
|
||||
|
||||
use_configure no
|
||||
|
||||
# Use standard build to take advantage of JAVA_HOME in build.env
|
||||
build.dir ${worksrcpath}/eqwalizer
|
||||
build.cmd sbt
|
||||
build.env-append SBT_OPTS=-Duser.home=${workpath}/.home
|
||||
build.target assembly
|
||||
|
||||
post-build {
|
||||
# Leaving this stub since we cannot declare global variables in the scope of pre-fetch
|
||||
set graalvm_home /Library/Java/JavaVirtualMachines
|
||||
|
||||
if {[variant_isset jdk17]} {
|
||||
set graalvm_home ${graalvm_home}/openjdk17-graalvm
|
||||
} elseif {[variant_isset jdk11]} {
|
||||
set graalvm_home ${graalvm_home}/openjdk11-graalvm
|
||||
}
|
||||
|
||||
set graalvm_home ${graalvm_home}/Contents/Home
|
||||
|
||||
# https://github.com/WhatsApp/erlang-language-platform/blob/0ae9b6d76ee51c2e17a7e97e379ff2e31b631317/.github/workflows/ci.yml#L102
|
||||
set args "-H:IncludeResources=application.conf"
|
||||
append args " --no-server"
|
||||
append args " --no-fallback"
|
||||
append args " -jar "
|
||||
append args {*}[glob ${worksrcpath}/eqwalizer/target/scala-*/${name}.jar]
|
||||
append args " eqwalizer"
|
||||
|
||||
system -W ${worksrcpath}/eqwalizer "${graalvm_home}/bin/native-image ${args}"
|
||||
}
|
||||
|
||||
destroot {
|
||||
set sharedir ${destroot}${prefix}/share/${name}
|
||||
xinstall -m 0755 -d ${sharedir}
|
||||
xinstall -m 0644 {*}[glob ${worksrcpath}/eqwalizer/target/scala-*/${name}.jar] ${sharedir}/${name}.jar
|
||||
file copy ${worksrcpath}/eqwalizer_support ${sharedir}/eqwalizer_support
|
||||
|
||||
set bindir ${destroot}${prefix}/bin
|
||||
xinstall -m 0755 -d ${bindir}
|
||||
xinstall -m 0755 ${worksrcpath}/eqwalizer/${name} ${bindir}/${name}
|
||||
}
|
||||
Reference in New Issue
Block a user