Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
60 lines
1.4 KiB
Nix
60 lines
1.4 KiB
Nix
{
|
|
ballerina,
|
|
lib,
|
|
writeText,
|
|
runCommand,
|
|
makeWrapper,
|
|
fetchzip,
|
|
stdenv,
|
|
openjdk17_headless,
|
|
}:
|
|
let
|
|
version = "2201.10.3";
|
|
codeName = "swan-lake";
|
|
openjdk = openjdk17_headless;
|
|
in
|
|
stdenv.mkDerivation {
|
|
pname = "ballerina";
|
|
inherit version;
|
|
|
|
src = fetchzip {
|
|
url = "https://dist.ballerina.io/downloads/${version}/ballerina-${version}-${codeName}.zip";
|
|
hash = "sha256-JVwxWRiOQaUZBkvxoLhKvktyQYnBtbCBZXZa6g6hoRQ=";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
cp -rv distributions/ballerina-${version} $out
|
|
runHook postInstall
|
|
'';
|
|
preFixup = ''
|
|
wrapProgram $out/bin/bal --set JAVA_HOME ${openjdk}
|
|
'';
|
|
|
|
passthru.tests.smokeTest =
|
|
let
|
|
helloWorld = writeText "hello-world.bal" ''
|
|
import ballerina/io;
|
|
public function main() {
|
|
io:println("Hello, World!");
|
|
}
|
|
'';
|
|
in
|
|
runCommand "ballerina-${version}-smoketest" { } ''
|
|
${ballerina}/bin/bal run ${helloWorld} >$out
|
|
read result <$out
|
|
[[ $result = "Hello, World!" ]]
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Open-source programming language for the cloud";
|
|
mainProgram = "bal";
|
|
license = licenses.asl20;
|
|
platforms = openjdk.meta.platforms;
|
|
maintainers = with maintainers; [ eigengrau ];
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
|
};
|
|
}
|