2021-10-26 08:32:52 +02:00
|
|
|
# Copyright 1999-2021 Gentoo Authors
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI=8
|
|
|
|
|
2021-12-11 01:56:05 +01:00
|
|
|
DOTNET_V=5.0
|
|
|
|
DOTNET=net${DOTNET_V}
|
2021-10-26 08:32:52 +02:00
|
|
|
|
|
|
|
DESCRIPTION="Verification-aware programming language"
|
|
|
|
HOMEPAGE="https://dafny-lang.github.io/dafny/"
|
|
|
|
|
|
|
|
if [[ "${PV}" == *9999* ]]; then
|
|
|
|
inherit git-r3
|
|
|
|
EGIT_REPO_URI="https://github.com/dafny-lang/${PN}.git"
|
|
|
|
else
|
2021-12-11 01:56:05 +01:00
|
|
|
SRC_URI="https://github.com/dafny-lang/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
2021-10-26 08:32:52 +02:00
|
|
|
KEYWORDS="~amd64"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# TODO: src_test
|
|
|
|
RESTRICT="network-sandbox test"
|
|
|
|
LICENSE="MIT"
|
|
|
|
SLOT="0"
|
2021-12-11 01:56:05 +01:00
|
|
|
IUSE="debug doc"
|
2021-10-26 08:32:52 +02:00
|
|
|
|
|
|
|
DEPEND="
|
|
|
|
>=virtual/jdk-1.8.0:*
|
2021-12-11 01:56:05 +01:00
|
|
|
virtual/dotnet-sdk:${DOTNET_V}
|
2021-10-26 08:32:52 +02:00
|
|
|
"
|
|
|
|
RDEPEND="
|
|
|
|
${DEPEND}
|
2021-12-11 01:56:05 +01:00
|
|
|
~sci-mathematics/z3-4.8.5
|
|
|
|
"
|
|
|
|
BDEPEND="
|
|
|
|
|| ( dev-java/gradle-bin dev-java/gradle )
|
|
|
|
doc? (
|
|
|
|
dev-texlive/texlive-xetex
|
|
|
|
|| ( app-text/pandoc app-text/pandoc-bin )
|
|
|
|
)
|
2021-10-26 08:32:52 +02:00
|
|
|
"
|
|
|
|
|
|
|
|
DAFNY_EXES="
|
|
|
|
usr/share/dafny/Dafny
|
|
|
|
usr/share/dafny/DafnyLanguageServer
|
|
|
|
usr/share/dafny/DafnyServer
|
|
|
|
"
|
|
|
|
|
|
|
|
QA_PREBUILT="${DAFNY_EXES}"
|
|
|
|
|
2021-10-26 09:23:26 +02:00
|
|
|
src_prepare() {
|
2021-12-11 01:56:05 +01:00
|
|
|
unset _JAVA_OPTIONS
|
|
|
|
export GRADLE_USER_HOME="${HOME}/.gradle"
|
|
|
|
|
|
|
|
if use debug ; then
|
|
|
|
DOTNET_CONFIGURATION=Debug
|
2021-10-26 08:32:52 +02:00
|
|
|
else
|
2021-12-11 01:56:05 +01:00
|
|
|
DOTNET_CONFIGURATION=Release
|
2021-10-26 08:32:52 +02:00
|
|
|
fi
|
2021-10-26 09:23:26 +02:00
|
|
|
export DOTNET_CONFIGURATION
|
2021-12-11 01:56:05 +01:00
|
|
|
einfo "DOTNET_CONFIGURATION: ${DOTNET_CONFIGURATION}"
|
2021-10-26 09:23:26 +02:00
|
|
|
|
|
|
|
default
|
|
|
|
}
|
2021-10-26 08:32:52 +02:00
|
|
|
|
2021-10-26 09:23:26 +02:00
|
|
|
src_configure() {
|
2021-12-11 01:56:05 +01:00
|
|
|
ebegin "Restoring"
|
|
|
|
dotnet restore --no-cache ./Source/Dafny.sln
|
|
|
|
eend $? || die "dotnet restore filed"
|
2021-10-26 09:23:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
2021-12-11 01:56:05 +01:00
|
|
|
ebegin "Building"
|
|
|
|
dotnet build --configuration "${DOTNET_CONFIGURATION}" ./Source/Dafny.sln
|
|
|
|
eend $? || die "dotnet build failed"
|
|
|
|
|
|
|
|
use doc && emake -j1 refman-release
|
2021-10-26 08:32:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
insinto /usr/share/${PN}
|
2021-12-11 01:56:05 +01:00
|
|
|
doins -r ./Binaries/${DOTNET}/*
|
2021-10-26 08:32:52 +02:00
|
|
|
|
|
|
|
local exe
|
2021-12-11 01:56:05 +01:00
|
|
|
for exe in ${DAFNY_EXES} ; do
|
2021-10-26 08:32:52 +02:00
|
|
|
fperms +x "/${exe}"
|
|
|
|
dosym "../../${exe}" "/usr/bin/$(basename "${exe,,}")"
|
2021-12-11 01:56:05 +01:00
|
|
|
dosym "../../${exe}" "/usr/bin/$(basename "${exe}")"
|
2021-10-26 08:32:52 +02:00
|
|
|
done
|
2021-12-11 01:56:05 +01:00
|
|
|
|
|
|
|
dodoc *.md *.txt
|
|
|
|
|
|
|
|
use doc && dodoc docs/DafnyRef/DafnyRef.pdf
|
2021-10-26 08:32:52 +02:00
|
|
|
}
|