diff --git a/pkgs/by-name/ba/ballerina/package.nix b/pkgs/by-name/ba/ballerina/package.nix index 0e22e4e91589..f4f9bd8cdc79 100644 --- a/pkgs/by-name/ba/ballerina/package.nix +++ b/pkgs/by-name/ba/ballerina/package.nix @@ -2,16 +2,17 @@ ballerina, lib, writeText, + writeScript, runCommand, makeWrapper, fetchzip, stdenv, - openjdk17_headless, + openjdk21_headless, }: let - version = "2201.10.3"; + version = "2201.13.4"; codeName = "swan-lake"; - openjdk = openjdk17_headless; + openjdk = openjdk21_headless; in stdenv.mkDerivation { pname = "ballerina"; @@ -19,7 +20,7 @@ stdenv.mkDerivation { src = fetchzip { url = "https://dist.ballerina.io/downloads/${version}/ballerina-${version}-${codeName}.zip"; - hash = "sha256-JVwxWRiOQaUZBkvxoLhKvktyQYnBtbCBZXZa6g6hoRQ="; + hash = "sha256-te7ZW9CISAg0ahkFBBWW2Q6pkB9jXGNBDHw6slX2V/E="; }; nativeBuildInputs = [ makeWrapper ]; @@ -48,12 +49,23 @@ stdenv.mkDerivation { [[ $result = "Hello, World!" ]] ''; + passthru.updateScript = writeScript "update-ballerina" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p common-updater-scripts curl pcre2 + set -euo pipefail + + version="$(curl -s https://ballerina.io/downloads/ | + pcre2grep -o '(?<=swan-lake-)\d+(?:\.\d+)+(?=)')" + + update-source-version "$UPDATE_NIX_ATTR_PATH" "$version" + ''; + meta = { description = "Open-source programming language for the cloud"; mainProgram = "bal"; license = lib.licenses.asl20; platforms = openjdk.meta.platforms; - maintainers = [ ]; + maintainers = with lib.maintainers; [ cbrxyz ]; sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; }; }