commit
9365015778
46
pkgs/tools/dotool/default.nix
Normal file
46
pkgs/tools/dotool/default.nix
Normal 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 ];
|
||||||
|
};
|
||||||
|
}
|
33
pkgs/tools/dotool/fix-paths.patch
Normal file
33
pkgs/tools/dotool/fix-paths.patch
Normal 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
|
@ -4829,6 +4829,8 @@ with pkgs;
|
|||||||
inherit (darwin.apple_sdk.frameworks) Security;
|
inherit (darwin.apple_sdk.frameworks) Security;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dotool = callPackage ../tools/dotool { };
|
||||||
|
|
||||||
inherit (ocamlPackages) dot-merlin-reader;
|
inherit (ocamlPackages) dot-merlin-reader;
|
||||||
|
|
||||||
dozenal = callPackage ../applications/misc/dozenal { };
|
dozenal = callPackage ../applications/misc/dozenal { };
|
||||||
|
Loading…
Reference in New Issue
Block a user