btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / tt / ttwatch / package.nix
blob273d34ffdb8e498b481af4e90be1900978d3bb91
1 { lib, stdenv, fetchFromGitHub
2 , cmake, perl, pkg-config
3 , openssl, curl, libusb1, protobufc
4 , enableUnsafe ? false }:
6 stdenv.mkDerivation {
7   pname = "ttwatch";
8   version = "2020-06-24";
10   src = fetchFromGitHub {
11     owner = "ryanbinns";
12     repo = "ttwatch";
13     rev = "260aff5869fd577d788d86b546399353d9ff72c1";
14     sha256 = "0yd2hs9d03gfvwm1vywpg2qga6x5c74zrj665wf9aa8gmn96hv8r";
15   };
17   nativeBuildInputs = [ cmake perl pkg-config ];
18   buildInputs = [ openssl curl libusb1 protobufc ];
20   cmakeFlags = lib.optionals enableUnsafe [ "-Dunsafe=on" ];
22   preFixup = ''
23     chmod +x $out/bin/ttbin2mysports
24   '';
26   meta = with lib; {
27     homepage = "https://github.com/ryanbinns/ttwatch";
28     description = "Linux TomTom GPS Watch Utilities";
29     maintainers = with maintainers; [ dotlambda ];
30     license = licenses.mit;
31     platforms = with platforms; linux;
32   };