From 355bee82de932f69da3e01eeccb35e3cd3892b08 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Mon, 29 Sep 2025 02:08:13 +0800 Subject: [PATCH 1/2] atlassian-cli: rename to appfire-cli --- pkgs/by-name/{at/atlassian-cli => ap/appfire-cli}/package.nix | 2 +- pkgs/by-name/{at/atlassian-cli => ap/appfire-cli}/wrapper.sh | 0 pkgs/top-level/aliases.nix | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) rename pkgs/by-name/{at/atlassian-cli => ap/appfire-cli}/package.nix (97%) rename pkgs/by-name/{at/atlassian-cli => ap/appfire-cli}/wrapper.sh (100%) diff --git a/pkgs/by-name/at/atlassian-cli/package.nix b/pkgs/by-name/ap/appfire-cli/package.nix similarity index 97% rename from pkgs/by-name/at/atlassian-cli/package.nix rename to pkgs/by-name/ap/appfire-cli/package.nix index 3e1d1ddcc3e3..aee338267f91 100644 --- a/pkgs/by-name/at/atlassian-cli/package.nix +++ b/pkgs/by-name/ap/appfire-cli/package.nix @@ -6,7 +6,7 @@ }: stdenv.mkDerivation rec { - pname = "atlassian-cli"; + pname = "appfire-cli"; version = "9.6.0"; src = fetchzip { diff --git a/pkgs/by-name/at/atlassian-cli/wrapper.sh b/pkgs/by-name/ap/appfire-cli/wrapper.sh similarity index 100% rename from pkgs/by-name/at/atlassian-cli/wrapper.sh rename to pkgs/by-name/ap/appfire-cli/wrapper.sh diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index c43b9d8748f9..a6c2644a0639 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -305,6 +305,7 @@ mapAliases { aseprite-unfree = throw "'aseprite-unfree' has been renamed to/replaced by 'aseprite'"; # Converted to throw 2025-10-27 asitop = throw "'asitop' has been renamed to/replaced by 'macpm'"; # Converted to throw 2025-10-27 asterisk_18 = throw "asterisk_18: Asterisk 18 is end of life and has been removed"; # Added 2025-10-19 + atlassian-cli = appfire-cli; # Added 2025-09-29 ats = throw "'ats' has been removed as it is unmaintained for 10 years and broken"; # Added 2025-05-17 AusweisApp2 = throw "'AusweisApp2' has been renamed to/replaced by 'ausweisapp'"; # Converted to throw 2025-10-27 autoconf213 = throw "'autoconf213' has been removed in favor of 'autoconf'"; # Added 2025-07-21 From be124e69296df5c6aa7059af48f4bc5ef37a1aa3 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Mon, 29 Sep 2025 02:29:59 +0800 Subject: [PATCH 2/2] appfire-cli: refactor; 9.6.0 -> 12.1.0 --- pkgs/by-name/ap/appfire-cli/package.nix | 105 ++++++++++++++++-------- pkgs/by-name/ap/appfire-cli/wrapper.sh | 20 ----- 2 files changed, 69 insertions(+), 56 deletions(-) delete mode 100755 pkgs/by-name/ap/appfire-cli/wrapper.sh diff --git a/pkgs/by-name/ap/appfire-cli/package.nix b/pkgs/by-name/ap/appfire-cli/package.nix index aee338267f91..a4519d548f3d 100644 --- a/pkgs/by-name/ap/appfire-cli/package.nix +++ b/pkgs/by-name/ap/appfire-cli/package.nix @@ -2,53 +2,86 @@ lib, stdenv, fetchzip, + makeBinaryWrapper, + coreutils, + findutils, jre, + + testers, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "appfire-cli"; - version = "9.6.0"; + version = "12.1.0"; src = fetchzip { - url = "https://bobswift.atlassian.net/wiki/download/attachments/16285777/${pname}-${version}-distribution.zip"; - sha256 = "sha256-55ydhprVC9NdDMUrKbpSAEQBb9zRYgwOc7k8aP4R89A="; + url = "https://appfire.atlassian.net/wiki/download/attachments/60562669/acli-${finalAttrs.version}-distribution.zip"; + hash = "sha256-6p8i5ec8IAygACdsdzP8g5u24mQZ7Ci684xuu/kAADo="; }; - tools = [ - "agile" - "bamboo" - "bitbucket" - "confluence" - "csv" - "hipchat" - "jira" - "servicedesk" - "structure" - "tempo" - "trello" - "upm" - ]; + nativeBuildInputs = [ makeBinaryWrapper ]; installPhase = '' - mkdir -p $out/{bin,share/doc/atlassian-cli} - cp -r lib $out/share/java - cp -r README.txt license $out/share/doc/atlassian-cli - for tool in $tools - do - substitute ${./wrapper.sh} $out/bin/$tool \ - --subst-var out \ - --subst-var-by jre ${jre} \ - --subst-var-by tool $tool - chmod +x $out/bin/$tool - done + runHook preInstall + + mkdir -p $out/share/{,doc/}appfire-cli + cp -r acli.sh lib $out/share/appfire-cli + cp -r README.txt license $out/share/doc/appfire-cli + + ACLI_SHELL=${finalAttrs.passthru.shellNames.${stdenv.hostPlatform.system} or "unsupport"} + if test -f $ACLI_SHELL; then + install -Dm755 $ACLI_SHELL $out/share/appfire-cli/$ACLI_SHELL + fi + + substituteInPlace $out/share/appfire-cli/acli.sh \ + --replace-fail 'java $' '${lib.getExe jre} $' \ + --replace-fail '(find' '(${lib.getExe findutils}' \ + --replace-fail dirname ${lib.getExe' coreutils "dirname"} \ + --replace-fail uname ${lib.getExe' coreutils "uname"} + makeBinaryWrapper $out/share/appfire-cli/acli.sh $out/bin/acli + + runHook postInstall ''; - meta = with lib; { - description = "Integrated family of CLI’s for various Atlassian applications"; - homepage = "https://bobswift.atlassian.net/wiki/spaces/ACLI/overview"; - license = licenses.unfreeRedistributable; - sourceProvenance = with sourceTypes; [ binaryBytecode ]; - maintainers = with maintainers; [ twey ]; + passthru = { + shellNames = { + "x86_64-linux" = "bin/shell-linux-amd64"; + "aarch64-linux" = "bin/shell-linux-arm64"; + "x86_64-darwin" = "bin/shell-macos-amd64"; + "aarch64-darwin" = "bin/shell-macos-arm64"; + }; + # versionCheckHook cannot be used because appfire-cli requires $HOME to be set + tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + command = "acli -a getClientInfo"; + }; + }; + + meta = { + description = "Integrated family of CLIs for Atlassian, Atlassian-related, and other applications"; + longDescription = '' + Appfire CLI (ACLI) is an integrated family of CLIs for Atlassian, + Atlassian-related, and other applications. + + ACLI provides a consistent and reliable automation platform that allows + users, administrators, script writers, and DevOps developers to perform + tasks, implement business processes, or apply general automation with + Atlassian products. + + The CLIs are built on the Atlassian remote APIs and deliver a higher + level, client-based API that is easier to use and more powerful than + the underlying product APIs. + + The upstream documentation describes configuring acli by placing + {file}`acli.properties` in the same directory as {file}`acli.sh`. + Since the /nix/store is not writable, you can instead place the file + at {file}`$HOME/acli.properties` to achieve the same effect. + ''; + homepage = "https://apps.appf.re/acli"; + license = lib.licenses.unfreeRedistributable; + sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; + maintainers = with lib.maintainers; [ twey ]; + mainProgram = "acli"; inherit (jre.meta) platforms; }; -} +}) diff --git a/pkgs/by-name/ap/appfire-cli/wrapper.sh b/pkgs/by-name/ap/appfire-cli/wrapper.sh deleted file mode 100755 index 80b60dbc468c..000000000000 --- a/pkgs/by-name/ap/appfire-cli/wrapper.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -tool=@tool@ -user=ATLASSIAN_${tool^^}_USER -host=ATLASSIAN_${tool^^}_HOST -pass=ATLASSIAN_${tool^^}_PASS - -[ -f ~/.atlassian-cli ] && source ~/.atlassian-cli -if [ x = ${!user-x} ] || [ x = ${!host-x} ] || [ x = ${!pass-x} ] -then - >&2 echo please define $user, $host, and $pass in '~/.atlassian-cli' - exit 1 -fi - -@jre@/bin/java \ - -jar @out@/share/java/@tool@-cli-* \ - --server "${!host}" \ - --user "${!user}" \ - --password "${!pass}" \ - "$@"