diff --git a/pkgs/games/klavaro/default.nix b/pkgs/games/klavaro/default.nix index 2a8f68ddd2cc..6ea029176482 100644 --- a/pkgs/games/klavaro/default.nix +++ b/pkgs/games/klavaro/default.nix @@ -2,23 +2,31 @@ , fetchurl , makeWrapper , curl +, espeak , file , gtk3 +, gtkdatabox , intltool , pkg-config }: stdenv.mkDerivation rec { pname = "klavaro"; - version = "3.11"; + version = "3.13"; src = fetchurl { url = "mirror://sourceforge/klavaro/${pname}-${version}.tar.bz2"; - sha256 = "1rkxaqb62w4mv86fcnmr32lq6y0h4hh92wmsy5ddb9a8jnzx6r7w"; + sha256 = "0z6c3lqikk50mkz3ipm93l48qj7b98lxyip8y6ndg9y9k0z0n878"; }; nativeBuildInputs = [ intltool makeWrapper pkg-config ]; - buildInputs = [ curl gtk3 ]; + buildInputs = [ curl gtk3 gtkdatabox ]; + + postPatch = '' + substituteInPlace src/tutor.c --replace '"espeak ' '"${espeak}/bin/espeak ' + ''; + + patches = [ ./icons.patch ./trans_lang_get_similar.patch ]; postInstall = '' wrapProgram $out/bin/klavaro \ diff --git a/pkgs/games/klavaro/icons.patch b/pkgs/games/klavaro/icons.patch new file mode 100644 index 000000000000..1717fdf44e68 --- /dev/null +++ b/pkgs/games/klavaro/icons.patch @@ -0,0 +1,146 @@ +--- a/data/klavaro.glade (revision 137) ++++ b/data/klavaro.glade (working copy) +@@ -311,7 +311,7 @@ + + True + False +- gtk-delete ++ edit-delete + + + False +@@ -708,7 +708,7 @@ + True + True + Drag and drop text here to practice with it. +- gtk-clear ++ edit-clear + Press here to restart the exercise. Hotkey: [Ctrl-R] + Press here to restart the exercise. Hotkey: [Ctrl-R] + +@@ -1232,7 +1232,7 @@ + + True + False +- gtk-delete ++ edit-delete + + + False +@@ -1352,7 +1352,7 @@ + + True + False +- gtk-open ++ document-open + + + True +@@ -1510,7 +1510,7 @@ + + True + False +- gtk-open ++ document-open + 2 + + +@@ -1557,7 +1557,7 @@ + + True + False +- gtk-paste ++ edit-paste + 2 + + +@@ -1604,7 +1604,7 @@ + + True + False +- gtk-delete ++ edit-delete + 2 + + +@@ -2051,7 +2051,7 @@ + + True + False +- gtk-delete ++ edit-delete + + + False +@@ -2343,7 +2343,7 @@ + + True + False +- gtk-media-rewind ++ media-seek-backward + 1 + + +@@ -2418,7 +2418,7 @@ + + True + False +- gtk-go-back ++ go-previous + + + False +@@ -2469,7 +2469,7 @@ + + True + False +- gtk-go-forward ++ go-next + + + False +@@ -2577,7 +2577,7 @@ + + True + False +- gtk-save ++ document-save + + + False +@@ -2825,7 +2825,7 @@ + + True + False +- gtk-strikethrough ++ format-text-strikethrough + 6 + + +@@ -2901,7 +2901,7 @@ + + True + False +- gtk-bold ++ format-text-bold + 6 + + +@@ -3630,7 +3630,7 @@ + + True + False +- gtk-goto-top ++ go-top + + + False +@@ -3678,7 +3678,7 @@ + + True + False +- gtk-goto-bottom ++ go-bottom + + + False diff --git a/pkgs/games/klavaro/trans_lang_get_similar.patch b/pkgs/games/klavaro/trans_lang_get_similar.patch new file mode 100644 index 000000000000..3b6644c5f7f7 --- /dev/null +++ b/pkgs/games/klavaro/trans_lang_get_similar.patch @@ -0,0 +1,71 @@ +--- a/src/translation.c (revision 137) ++++ b/src/translation.c (working copy) +@@ -257,23 +257,23 @@ + * Private auxiliar function + */ + static gboolean +-trans_lang_get_similar (gchar * test) ++trans_lang_get_similar (gchar ** test) + { + gint i; + gchar aux_code_2[3]; + + /* Prefer C over en_GB for English variants other than en_GB. (Debian patch 02) */ +- if (g_str_has_prefix (test, "en")) ++ if (g_str_has_prefix (*test, "en")) + { +- g_free (test); +- test = g_strdup ("C"); ++ g_free (*test); ++ *test = g_strdup ("C"); + return (TRUE); + } + +- if (g_str_equal (test, "C")) ++ if (g_str_equal (*test, "C")) + return TRUE; + +- strncpy (aux_code_2, test, 2); ++ strncpy (aux_code_2, *test, 2); + aux_code_2[2] = '\0'; + + for (i = 0; i < lang_num; i++) +@@ -280,15 +280,15 @@ + { + if (strstr (lang[i].code, aux_code_2)) + { +- g_free (test); +- test = g_strdup (lang[i].code); ++ g_free (*test); ++ *test = g_strdup (lang[i].code); + break; + } + } +- if (i == lang_num && g_str_has_prefix (test, "en")) ++ if (i == lang_num && g_str_has_prefix (*test, "en")) + { +- g_free (test); +- test = g_strdup ("C"); ++ g_free (*test); ++ *test = g_strdup ("C"); + return (TRUE); + } + return (i == lang_num ? FALSE : TRUE); +@@ -356,7 +356,7 @@ + lang_ok = (i == 0 ? TRUE : FALSE); + break; + } +- lang_ok = trans_lang_get_similar (tmp_code); ++ lang_ok = trans_lang_get_similar (&tmp_code); + if (lang_ok == TRUE) + break; + g_free (tmp_code); +@@ -368,7 +368,7 @@ + tmp_code = g_win32_getlocale (); + lang_ok = trans_lang_is_available (tmp_code); + if (lang_ok == FALSE) +- lang_ok = trans_lang_get_similar (tmp_code); ++ lang_ok = trans_lang_get_similar (&tmp_code); + #endif + } + if (tmp_code == NULL)