lol
1{ lib
2, stdenv
3, ocamlPackages
4, fetchFromGitHub
5, makeWrapper
6, python3
7}:
8
9ocamlPackages.buildDunePackage rec {
10 pname = "flitter";
11 # request to tag releases: https://github.com/alexozer/flitter/issues/34
12 version = "unstable-2020-10-05";
13
14 useDune2 = true;
15
16 src = fetchFromGitHub {
17 owner = "alexozer";
18 repo = "flitter";
19 rev = "666c5483bc93efa6d01e0b7a927461269f8e14de";
20 sha256 = "1k3m7bjq5yrrq7vhnbdykni65dsqhq6knnv9wvwq3svb3n07z4w3";
21 };
22
23 # https://github.com/alexozer/flitter/issues/28
24 postPatch = ''
25 for f in src/colors.ml src/duration.ml src/event_loop.ml src/splits.ml; do
26 substituteInPlace "$f" \
27 --replace 'Unix.gettimeofday' 'Caml_unix.gettimeofday'
28 done
29 '';
30
31 nativeBuildInputs = [
32 makeWrapper
33 ];
34
35 buildInputs = with ocamlPackages; [
36 core
37 lwt_ppx
38 sexp_pretty
39 color
40 notty
41 ];
42
43 postInstall = ''
44 wrapProgram $out/bin/flitter \
45 --prefix PATH : "${python3.withPackages (pp: [ pp.pynput ])}/bin"
46 '';
47
48 meta = with lib; {
49 description = "A Livesplit-inspired speedrunning split timer for Linux/macOS terminal";
50 license = licenses.mit;
51 maintainers = with maintainers; [ fgaz ];
52 homepage = "https://github.com/alexozer/flitter";
53 platforms = platforms.unix;
54 };
55}