2021-01-07 20:11:46 +00:00
|
|
|
{ lib
|
|
|
|
, ocamlPackages
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
2023-07-12 15:22:45 +00:00
|
|
|
ocamlPackages.buildDunePackage {
|
2021-01-07 20:11:46 +00:00
|
|
|
pname = "flitter";
|
|
|
|
# request to tag releases: https://github.com/alexozer/flitter/issues/34
|
|
|
|
version = "unstable-2020-10-05";
|
|
|
|
|
2022-12-17 16:33:29 +00:00
|
|
|
duneVersion = "3";
|
2021-01-07 20:11:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alexozer";
|
|
|
|
repo = "flitter";
|
|
|
|
rev = "666c5483bc93efa6d01e0b7a927461269f8e14de";
|
|
|
|
sha256 = "1k3m7bjq5yrrq7vhnbdykni65dsqhq6knnv9wvwq3svb3n07z4w3";
|
|
|
|
};
|
|
|
|
|
2022-05-23 05:18:37 +00:00
|
|
|
# compatibility with core >= 0.15
|
|
|
|
patches = [ ./flitter.patch ];
|
|
|
|
|
2021-01-07 20:11:46 +00:00
|
|
|
# https://github.com/alexozer/flitter/issues/28
|
|
|
|
postPatch = ''
|
2022-05-23 05:18:37 +00:00
|
|
|
for f in src/*.ml; do
|
2021-01-07 20:11:46 +00:00
|
|
|
substituteInPlace "$f" \
|
2022-05-23 05:18:37 +00:00
|
|
|
--replace 'Unix.gettimeofday' 'Caml_unix.gettimeofday' \
|
|
|
|
--replace 'Core_kernel' 'Core' \
|
|
|
|
--replace 'sexp_option' 'option[@sexp.option]' \
|
|
|
|
--replace 'sexp_list' 'list[@sexp.list]'
|
2021-01-07 20:11:46 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = with ocamlPackages; [
|
2022-05-23 05:18:37 +00:00
|
|
|
core_unix
|
2021-01-07 20:11:46 +00:00
|
|
|
lwt_ppx
|
|
|
|
sexp_pretty
|
|
|
|
color
|
|
|
|
notty
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/flitter \
|
|
|
|
--prefix PATH : "${python3.withPackages (pp: [ pp.pynput ])}/bin"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A Livesplit-inspired speedrunning split timer for Linux/macOS terminal";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
homepage = "https://github.com/alexozer/flitter";
|
|
|
|
platforms = platforms.unix;
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "flitter";
|
2021-01-07 20:11:46 +00:00
|
|
|
};
|
|
|
|
}
|