Merge pull request #326320 from idlip/bump_dotool

dotool: 1.3 -> 1.5
This commit is contained in:
Sebastián Mancilla 2024-08-13 21:16:55 -04:00 committed by GitHub
commit 555e8f20d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 15 deletions

View File

@ -3,20 +3,22 @@
, fetchFromSourcehut , fetchFromSourcehut
, libxkbcommon , libxkbcommon
, pkg-config , pkg-config
, installShellFiles
, scdoc
}: }:
buildGoModule rec { buildGoModule rec {
pname = "dotool"; pname = "dotool";
version = "1.3"; version = "1.5";
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~geb"; owner = "~geb";
repo = "dotool"; repo = "dotool";
rev = version; rev = version;
hash = "sha256-z0fQ+qenHjtoriYSD2sOjEvfLVtZcMJbvnjKZFRSsMA="; hash = "sha256-4QmTHeU3TnpRATKIvilkIA3i2hDjM5zQwSvmRvoWuNE=";
}; };
vendorHash = "sha256-v0uoG9mNaemzhQAiG85RequGjkSllPd4UK2SrLjfm7A="; vendorHash = "sha256-IQ847LHDYJPboWL/6lQNJ4vPPD/+xkrGI2LSZ7kBnp4=";
# uses nix store path for the dotool binary # uses nix store path for the dotool binary
# also replaces /bin/echo with echo # also replaces /bin/echo with echo
@ -27,13 +29,15 @@ buildGoModule rec {
''; '';
buildInputs = [ libxkbcommon ]; buildInputs = [ libxkbcommon ];
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ installShellFiles pkg-config scdoc ];
ldflags = [ "-s" "-w" "-X main.Version=${version}" ]; ldflags = [ "-s" "-w" "-X main.Version=${version}" ];
postInstall = '' postInstall = ''
mkdir -p $out/bin mkdir -p $out/bin
cp ./dotoold ./dotoolc $out/bin cp ./dotoold ./dotoolc $out/bin
scdoc < doc/dotool.1.scd > doc/dotool.1
installManPage doc/dotool.1
''; '';
meta = with lib; { meta = with lib; {

View File

@ -4,30 +4,30 @@ index e2f7bba..6d1879e 100755
+++ b/dotoolc +++ b/dotoolc
@@ -7,7 +7,7 @@ is $DOTOOL_PIPE else /tmp/dotool-pipe.' >&2 @@ -7,7 +7,7 @@ is $DOTOOL_PIPE else /tmp/dotool-pipe.' >&2
fi fi
fifo_being_read(){ fifo_being_read(){
- [ -p "$1" ] && /bin/echo 1<>"$1" >"$1" - [ -p "$1" ] && /bin/echo 1<>"$1" >"$1"
+ [ -p "$1" ] && echo 1<>"$1" >"$1" + [ -p "$1" ] && echo 1<>"$1" >"$1"
} }
p="${DOTOOL_PIPE:-/tmp/dotool-pipe}" p="${DOTOOL_PIPE:-/tmp/dotool-pipe}"
diff --git a/dotoold b/dotoold diff --git a/dotoold b/dotoold
index d2d39a3..e46129c 100755 index 48a7789..c405312 100755
--- a/dotoold --- a/dotoold
+++ b/dotoold +++ b/dotoold
@@ -7,7 +7,7 @@ for the pipe is $DOTOOL_PIPE else /tmp/dotool-pipe.' >&2 @@ -12,7 +12,7 @@ for the pipe is $DOTOOL_PIPE else /tmp/dotool-pipe.' >&2
fi done
fifo_being_read(){ fifo_being_read(){
- [ -p "$1" ] && /bin/echo 1<>"$1" >"$1" - [ -p "$1" ] && /bin/echo 1<>"$1" >"$1"
+ [ -p "$1" ] && echo 1<>"$1" >"$1" + [ -p "$1" ] && echo 1<>"$1" >"$1"
} }
p="${DOTOOL_PIPE:-/tmp/dotool-pipe}" p="${DOTOOL_PIPE:-/tmp/dotool-pipe}"
@@ -20,5 +20,5 @@ fi @@ -25,5 +25,5 @@ fi
rm -f -- "$p" || exit 1 rm -f -- "$p" || exit 1
trap 'rm -f -- "$p"; pkill -P $$; trap - EXIT; exit' EXIT INT TERM HUP trap 'rm -f -- "$p"; pkill -P $$; trap - EXIT; exit' EXIT INT TERM HUP
mkfifo -m 660 "$p" || exit 1 mkfifo -m 660 "$p" || exit 1
-dotool <> "$p" & -dotool "$@" <> "$p" &
+@dotool@ <> "$p" & +@dotool@ "$@" <> "$p" &
wait wait $!