From 90bca32e902e96e786e4524b1f233783bbd8a0a2 Mon Sep 17 00:00:00 2001 From: figsoda Date: Sat, 27 May 2023 09:44:59 -0400 Subject: [PATCH] scli: fix version --- pkgs/applications/misc/scli/default.nix | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/misc/scli/default.nix b/pkgs/applications/misc/scli/default.nix index d300691934b..4da57993fb8 100644 --- a/pkgs/applications/misc/scli/default.nix +++ b/pkgs/applications/misc/scli/default.nix @@ -4,6 +4,8 @@ , dbus , signal-cli , xclip +, testers +, scli }: python3.pkgs.buildPythonApplication rec { @@ -26,24 +28,27 @@ python3.pkgs.buildPythonApplication rec { dontBuild = true; - checkPhase = '' - # scli attempts to write to these directories, make sure they're writeable - export XDG_DATA_HOME=$(mktemp -d) - export XDG_CONFIG_HOME=$(mktemp -d) - ./scli --help > /dev/null # don't spam nix-build log - test $? == 0 - ''; - installPhase = '' - mkdir -p $out/bin + runHook preInstall + patchShebangs scli - install -m755 -D scli $out/bin/scli + install -Dm555 scli -t $out/bin + echo "v$version" > $out/bin/VERSION + + runHook postInstall ''; makeWrapperArgs = [ "--prefix" "PATH" ":" (lib.makeBinPath [ dbus signal-cli xclip ]) ]; + passthru.tests = { + version = testers.testVersion { + package = scli; + command = "HOME=$(mktemp -d) scli --version"; + }; + }; + meta = with lib; { description = "Simple terminal user interface for Signal"; homepage = "https://github.com/isamert/scli";