Merge pull request #181319 from eigengrau/add-ballerina

This commit is contained in:
Sandro 2022-08-19 13:48:41 +02:00 committed by GitHub
commit 7b06baf385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 0 deletions

View File

@ -3744,6 +3744,12 @@
githubId = 537775;
name = "Emery Hemingway";
};
eigengrau = {
email = "seb@schattenkopie.de";
name = "Sebastian Reuße";
github = "eigengrau";
githubId = 4939947;
};
eikek = {
email = "eike.kettner@posteo.de";
github = "eikek";

View File

@ -0,0 +1,45 @@
{ ballerina, lib, writeText, runCommand, makeWrapper, fetchzip, stdenv, openjdk }:
let
version = "2201.1.0";
codeName = "swan-lake";
in stdenv.mkDerivation {
pname = "ballerina";
inherit version;
src = fetchzip {
url = "https://dist.ballerina.io/downloads/${version}/ballerina-${version}-${codeName}.zip";
sha256 = "sha256-WZ6CvgnES1indYeMSuC3odDqwR2J27k+D8RktvHsELs=";
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
cp -rv distributions/ballerina-${version} $out
runHook postInstall
'';
preFixup = ''
wrapProgram $out/bin/bal --set JAVA_HOME ${openjdk}/lib/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 = "An open-source programming language for the cloud";
license = licenses.asl20;
platforms = openjdk.meta.platforms;
maintainers = with maintainers; [ eigengrau ];
sourceProvenance = with sourceTypes; [ binaryBytecode ];
};
}

View File

@ -12818,6 +12818,8 @@ with pkgs;
avra = callPackage ../development/compilers/avra { };
ballerina = callPackage ../development/compilers/ballerina { };
beekeeper-studio = callPackage ../development/tools/database/beekeeper-studio { };
bigloo = callPackage ../development/compilers/bigloo { };