nixpkgs/pkgs/tools/dotool/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.2 KiB
Nix
Raw Normal View History

2023-05-06 16:07:09 +02:00
{ lib
, buildGoModule
, fetchFromSourcehut
, libxkbcommon
, pkg-config
2024-07-11 15:52:17 +02:00
, installShellFiles
, scdoc
2023-05-06 16:07:09 +02:00
}:
buildGoModule rec {
pname = "dotool";
2024-07-11 15:52:17 +02:00
version = "1.5";
2023-05-06 16:07:09 +02:00
src = fetchFromSourcehut {
owner = "~geb";
repo = "dotool";
rev = version;
2024-07-11 15:52:17 +02:00
hash = "sha256-4QmTHeU3TnpRATKIvilkIA3i2hDjM5zQwSvmRvoWuNE=";
2023-05-06 16:07:09 +02:00
};
2024-07-11 15:52:17 +02:00
vendorHash = "sha256-IQ847LHDYJPboWL/6lQNJ4vPPD/+xkrGI2LSZ7kBnp4=";
2023-05-06 16:07:09 +02:00
# 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 ];
2024-07-11 15:52:17 +02:00
nativeBuildInputs = [ installShellFiles pkg-config scdoc ];
2023-05-06 16:07:09 +02:00
ldflags = [ "-s" "-w" "-X main.Version=${version}" ];
postInstall = ''
mkdir -p $out/bin
cp ./dotoold ./dotoolc $out/bin
2024-07-11 15:52:17 +02:00
scdoc < doc/dotool.1.scd > doc/dotool.1
installManPage doc/dotool.1
2023-05-06 16:07:09 +02:00
'';
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 ];
};
}