3
0
Fork 0
forked from mirrors/nixpkgs

dotool: init at 1.3

This commit is contained in:
Mostly Void 2023-05-06 19:37:09 +05:30
parent 75b4d0ff2b
commit eca89b077f
No known key found for this signature in database
GPG key ID: E2B7342D0CAA82C2
3 changed files with 81 additions and 0 deletions

View file

@ -0,0 +1,46 @@
{ lib
, buildGoModule
, fetchFromSourcehut
, libxkbcommon
, pkg-config
}:
buildGoModule rec {
pname = "dotool";
version = "1.3";
src = fetchFromSourcehut {
owner = "~geb";
repo = "dotool";
rev = version;
hash = "sha256-z0fQ+qenHjtoriYSD2sOjEvfLVtZcMJbvnjKZFRSsMA=";
};
vendorHash = "sha256-v0uoG9mNaemzhQAiG85RequGjkSllPd4UK2SrLjfm7A=";
# uses nix store path for the dotool binary
# also replaces /bin/echo with echo
patches = [ ./fix-paths.patch ];
postPatch = ''
substituteInPlace ./dotoold --replace "@dotool@" "$out/bin/dotool"
'';
buildInputs = [ libxkbcommon ];
nativeBuildInputs = [ pkg-config ];
ldflags = [ "-s" "-w" "-X main.Version=${version}" ];
postInstall = ''
mkdir -p $out/bin
cp ./dotoold ./dotoolc $out/bin
'';
meta = with lib; {
description = "Command to simulate input anywhere";
homepage = "https://git.sr.ht/~geb/dotool";
changelog = "https://git.sr.ht/~geb/dotool/tree/${version}/item/CHANGELOG.md";
license = licenses.gpl3Only;
maintainers = with maintainers; [ dit7ya ];
};
}

View file

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

View file

@ -4598,6 +4598,8 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Security;
};
dotool = callPackage ../tools/dotool { };
inherit (ocamlPackages) dot-merlin-reader;
dozenal = callPackage ../applications/misc/dozenal { };