2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-06-18 07:06:33 +00:00
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
|
|
|
, curl
|
2022-03-30 09:31:56 +00:00
|
|
|
, espeak
|
2020-06-18 07:06:33 +00:00
|
|
|
, file
|
|
|
|
, gtk3
|
2022-03-30 09:31:56 +00:00
|
|
|
, gtkdatabox
|
2020-06-18 07:06:33 +00:00
|
|
|
, intltool
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-06-18 07:06:33 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "klavaro";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "3.14";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/klavaro/${pname}-${version}.tar.bz2";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-hxh+SdMBxRDmlkCYzbYSEmvwMNKodf15nq3K0+rlbas=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ intltool makeWrapper pkg-config ];
|
2022-03-30 09:31:56 +00:00
|
|
|
buildInputs = [ curl gtk3 gtkdatabox ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/tutor.c --replace '"espeak ' '"${espeak}/bin/espeak '
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/klavaro \
|
|
|
|
--prefix LD_LIBRARY_PATH : $out/lib
|
|
|
|
'';
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
# Fixes /usr/bin/file: No such file or directory
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace configure \
|
|
|
|
--replace "/usr/bin/file" "${file}/bin/file"
|
|
|
|
'';
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
# remove forbidden references to $TMPDIR
|
|
|
|
preFixup = lib.optionalString stdenv.isLinux ''
|
|
|
|
for f in "$out"/bin/*; do
|
|
|
|
if isELF "$f"; then
|
|
|
|
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-06-18 07:06:33 +00:00
|
|
|
description = "Free touch typing tutor program";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "klavaro";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://klavaro.sourceforge.net/";
|
2020-09-25 04:45:31 +00:00
|
|
|
changelog = "https://sourceforge.net/p/klavaro/code/HEAD/tree/trunk/ChangeLog";
|
2020-06-18 07:06:33 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ mimame davidak ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|