tmux-fingers: 2.1.1 -> 2.2.2 (#336863)

This commit is contained in:
Jörg Thalheim 2024-09-21 09:24:15 +02:00 committed by GitHub
commit d93925ecd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 101 additions and 23 deletions

View File

@ -242,29 +242,8 @@ in rec {
};
};
fingers = mkTmuxPlugin rec {
pluginName = "tmux-fingers";
rtpFilePath = "load-config.tmux";
version = "2.1.1";
src = fetchFromGitHub {
owner = "Morantron";
repo = "tmux-fingers";
rev = "${version}";
sha256 = "sha256-1YMh6m8M6FKf8RPXsOfWCVC5CXSr/MynguwkG7O+oEY=";
};
nativeBuildInputs = [ pkgs.makeWrapper pkgs.crystal pkgs.shards ];
postInstall = ''
shards build --production
rm -rf $target/* $target/.*
cp -r bin $target/bin
echo "$target/bin/${pluginName} load-config" > $target/${rtpFilePath}
chmod +x $target/${rtpFilePath}
wrapProgram $target/${rtpFilePath} \
--prefix PATH : ${with pkgs; lib.makeBinPath (
[ gawk ] ++ lib.optionals stdenv.isDarwin [ reattach-to-user-namespace ]
)}
'';
fingers = pkgs.callPackage ./tmux-fingers {
inherit mkTmuxPlugin;
};
fpp = mkTmuxPlugin {

View File

@ -0,0 +1,46 @@
{
mkTmuxPlugin,
substituteAll,
fetchFromGitHub,
crystal,
}:
let
fingers = crystal.buildCrystalPackage rec {
format = "shards";
version = "2.2.2";
pname = "fingers";
src = fetchFromGitHub {
owner = "Morantron";
repo = "tmux-fingers";
rev = "${version}";
sha256 = "sha256-m9QON7diHVEDnnv/alXCJOG+BnfrAKygScrubZZ605I=";
};
shardsFile = ./shards.nix;
crystalBinaries.tmux-fingers.src = "src/fingers.cr";
postInstall = ''
shopt -s dotglob extglob
rm -rv !("tmux-fingers.tmux"|"bin")
shopt -u dotglob extglob
'';
# TODO: Needs starting a TMUX session to run tests
# Unhandled exception: Missing ENV key: "TMUX" (KeyError)
doCheck = false;
doInstallCheck = false;
};
in
mkTmuxPlugin {
inherit (fingers) version src meta;
pluginName = fingers.src.repo;
rtpFilePath = "tmux-fingers.tmux";
patches = [
(substituteAll {
src = ./fix.patch;
tmuxFingersDir = "${fingers}/bin";
})
];
}

View File

@ -0,0 +1,41 @@
diff --git a/tmux-fingers.tmux b/tmux-fingers.tmux
index f15b509..a14e312 100755
--- a/tmux-fingers.tmux
+++ b/tmux-fingers.tmux
@@ -1,35 +1,4 @@
#!/usr/bin/env bash
-CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-if command -v "tmux-fingers" &>/dev/null; then
- FINGERS_BINARY="tmux-fingers"
-elif [[ -f "$CURRENT_DIR/bin/tmux-fingers" ]]; then
- FINGERS_BINARY="$CURRENT_DIR/bin/tmux-fingers"
-fi
-
-if [[ -z "$FINGERS_BINARY" ]]; then
- tmux run-shell -b "bash $CURRENT_DIR/install-wizard.sh"
- exit 0
-fi
-
-CURRENT_FINGERS_VERSION="$($FINGERS_BINARY version)"
-
-pushd $CURRENT_DIR &> /dev/null
-CURRENT_GIT_VERSION=$(cat shard.yml | grep "^version" | cut -f2 -d':' | sed "s/ //g")
-popd &> /dev/null
-
-SKIP_WIZARD=$(tmux show-option -gqv @fingers-skip-wizard)
-SKIP_WIZARD=${SKIP_WIZARD:-0}
-
-if [ "$SKIP_WIZARD" = "0" ] && [ "$CURRENT_FINGERS_VERSION" != "$CURRENT_GIT_VERSION" ]; then
- tmux run-shell -b "FINGERS_UPDATE=1 bash $CURRENT_DIR/install-wizard.sh"
-
- if [[ "$?" != "0" ]]; then
- echo "Something went wrong while updating tmux-fingers. Please try again."
- exit 1
- fi
-fi
-
-tmux run "$FINGERS_BINARY load-config"
+tmux run "@tmuxFingersDir@/tmux-fingers load-config"
exit $?

View File

@ -0,0 +1,12 @@
{
cling = {
url = "https://github.com/devnote-dev/cling.git";
rev = "v3.0.0";
sha256 = "0mj5xvpiif1vhg4qds938p9zb5a47qzl397ybz1l1jks0gg361wq";
};
xdg_base_directory = {
url = "https://github.com/tijn/xdg_base_directory.git";
rev = "60bf28dc060c221d5af52727927e92b840022eb0";
sha256 = "1sa8bw8mzsz0pbj3m8v0w1pnk1q86zjivr0jndfg77wa33ki34y0";
};
}