From c0c9ca57c35f426bff6496ca694d7880fdcce40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= Date: Wed, 6 Jul 2022 16:44:47 +0200 Subject: [PATCH 1/3] maintainers: add eigengrau --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index be0cfb4930ca..f012c1b4495d 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -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"; From 1be3859507a2ffd57a30349d3aac9ff8507b5dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= Date: Thu, 7 Jul 2022 08:41:08 +0200 Subject: [PATCH 2/3] ballerina: init at 2201.1.0 --- .../compilers/ballerina/default.nix | 32 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/development/compilers/ballerina/default.nix diff --git a/pkgs/development/compilers/ballerina/default.nix b/pkgs/development/compilers/ballerina/default.nix new file mode 100644 index 000000000000..6de0bebb7863 --- /dev/null +++ b/pkgs/development/compilers/ballerina/default.nix @@ -0,0 +1,32 @@ +{ lib, 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 + ''; + + 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f0f42fc7ef6d..9d45b70d5045 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12810,6 +12810,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 { }; From cd3591f562d507782697887b03abace44e383a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= Date: Tue, 12 Jul 2022 14:43:04 +0200 Subject: [PATCH 3/3] ballerina: add smoke test --- pkgs/development/compilers/ballerina/default.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/ballerina/default.nix b/pkgs/development/compilers/ballerina/default.nix index 6de0bebb7863..1776d5a23c7b 100644 --- a/pkgs/development/compilers/ballerina/default.nix +++ b/pkgs/development/compilers/ballerina/default.nix @@ -1,4 +1,4 @@ -{ lib, makeWrapper, fetchzip, stdenv, openjdk }: +{ ballerina, lib, writeText, runCommand, makeWrapper, fetchzip, stdenv, openjdk }: let version = "2201.1.0"; codeName = "swan-lake"; @@ -22,6 +22,19 @@ in stdenv.mkDerivation { 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;