1{ lib, stdenv
2, fetchurl
3, makeWrapper
4, curl
5, espeak
6, file
7, gtk3
8, gtkdatabox
9, intltool
10, pkg-config
11}:
12
13stdenv.mkDerivation rec {
14 pname = "klavaro";
15 version = "3.13";
16
17 src = fetchurl {
18 url = "mirror://sourceforge/klavaro/${pname}-${version}.tar.bz2";
19 sha256 = "0z6c3lqikk50mkz3ipm93l48qj7b98lxyip8y6ndg9y9k0z0n878";
20 };
21
22 nativeBuildInputs = [ intltool makeWrapper pkg-config ];
23 buildInputs = [ curl gtk3 gtkdatabox ];
24
25 postPatch = ''
26 substituteInPlace src/tutor.c --replace '"espeak ' '"${espeak}/bin/espeak '
27 '';
28
29 patches = [ ./icons.patch ./trans_lang_get_similar.patch ];
30
31 postInstall = ''
32 wrapProgram $out/bin/klavaro \
33 --prefix LD_LIBRARY_PATH : $out/lib
34 '';
35
36 # Fixes /usr/bin/file: No such file or directory
37 preConfigure = ''
38 substituteInPlace configure \
39 --replace "/usr/bin/file" "${file}/bin/file"
40 '';
41
42 # Hack to avoid TMPDIR in RPATHs.
43 preFixup = ''rm -rf "$(pwd)" '';
44
45 meta = with lib; {
46 description = "Free touch typing tutor program";
47 homepage = "http://klavaro.sourceforge.net/";
48 changelog = "https://sourceforge.net/p/klavaro/code/HEAD/tree/trunk/ChangeLog";
49 license = licenses.gpl3Plus;
50 platforms = platforms.linux;
51 maintainers = with maintainers; [ mimame davidak ];
52 };
53}