From 8bb7c16a500627e0cc790e0bc00812d9181beb9c Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Fri, 22 May 2026 02:56:24 +0300 Subject: [PATCH] tilem: switch to GTK 3 fork Assisted-by: codex with gpt-5.5-high --- pkgs/by-name/ti/tilem/gcc14-fix.patch | 13 -------- pkgs/by-name/ti/tilem/gcc15-fix.patch | 12 ------- pkgs/by-name/ti/tilem/package.nix | 46 ++++++++++++++++++--------- 3 files changed, 31 insertions(+), 40 deletions(-) delete mode 100644 pkgs/by-name/ti/tilem/gcc14-fix.patch delete mode 100644 pkgs/by-name/ti/tilem/gcc15-fix.patch diff --git a/pkgs/by-name/ti/tilem/gcc14-fix.patch b/pkgs/by-name/ti/tilem/gcc14-fix.patch deleted file mode 100644 index f1ef81e57cd6..000000000000 --- a/pkgs/by-name/ti/tilem/gcc14-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/gui/macro.c b/gui/macro.c -index ae8db8b..226d48f 100644 ---- a/gui/macro.c -+++ b/gui/macro.c -@@ -86,7 +86,7 @@ void tilem_macro_add_action(TilemMacro* macro, int type, char * value) { - macro->actions = tilem_macro_actions_new(macro, n + 1); - - /* Then we need to save the action */ -- macro->actions[n] = g_new(char, strlen(value)); /* FIXME : gcc says : "assignment from incompatible pointer type" ??? */ -+ macro->actions[n] = g_new(TilemMacroAtom, 1); /* FIXME : gcc says : "assignment from incompatible pointer type" ??? */ - macro->actions[n]->value = g_strdup(value); - macro->actions[n]->type = type; - macro->n++; diff --git a/pkgs/by-name/ti/tilem/gcc15-fix.patch b/pkgs/by-name/ti/tilem/gcc15-fix.patch deleted file mode 100644 index 6a76170739cf..000000000000 --- a/pkgs/by-name/ti/tilem/gcc15-fix.patch +++ /dev/null @@ -1,12 +0,0 @@ -Fix call to zero-argument tilem_macro_new(), which GCC 15 rejects because the declaration takes no parameters. ---- a/gui/macro.c -+++ b/gui/macro.c -@@ -70,7 +70,7 @@ - tilem_macro_finalize(emu->macro); - - /* Then allocate a new one */ -- emu->macro = tilem_macro_new(emu); -+ emu->macro = tilem_macro_new(); - } - - /* Add an action to the macro. The action could be : diff --git a/pkgs/by-name/ti/tilem/package.nix b/pkgs/by-name/ti/tilem/package.nix index 5bc6a6468d19..9ec7a6460904 100644 --- a/pkgs/by-name/ti/tilem/package.nix +++ b/pkgs/by-name/ti/tilem/package.nix @@ -1,43 +1,59 @@ { stdenv, - fetchurl, + fetchFromGitHub, + gnused, lib, + nix-update, pkg-config, + writeShellScript, glib, - gtk2, + gtk3, + wrapGAppsHook3, libticonv, libtifiles2, libticables2, libticalcs2, }: -stdenv.mkDerivation (finalAttrs: { +stdenv.mkDerivation { pname = "tilem"; - version = "2.0"; - src = fetchurl { - url = "mirror://sourceforge/tilem/tilem-${finalAttrs.version}.tar.bz2"; - sha256 = "1ba38xzhp3yf21ip3cgql6jzy49jc34sfnjsl4syxyrd81d269zw"; + version = "2.1-unstable-2025-11-06"; + + src = fetchFromGitHub { + owner = "kuba160"; + repo = "tilem-gtk3"; + rev = "64b9a38a4460abf52bf09ab28dffdc3784f002a3"; + hash = "sha256-FYJMS2GIUbW89VrYbZM1+DLUGu86HxtScSWN0CLtNDo="; }; - nativeBuildInputs = [ pkg-config ]; + + nativeBuildInputs = [ + pkg-config + wrapGAppsHook3 + ]; buildInputs = [ glib - gtk2 + gtk3 libticonv libtifiles2 libticables2 libticalcs2 ]; - patches = [ - ./gcc14-fix.patch - ./gcc15-fix.patch - ]; + env.NIX_CFLAGS_COMPILE = toString [ "-lm" ]; + + passthru.updateScript = writeShellScript "update-tilem" '' + ${lib.getExe nix-update} "$UPDATE_NIX_ATTR_PATH" --version=branch + ${lib.getExe gnused} -i -E \ + 's/version = "0-unstable-([0-9-]+)";/version = "2.1-unstable-\1";/' \ + pkgs/by-name/ti/tilem/package.nix + ''; + meta = { - homepage = "http://lpg.ticalc.org/prj_tilem/"; + homepage = "https://github.com/kuba160/tilem-gtk3"; description = "Emulator and debugger for Texas Instruments Z80-based graphing calculators"; license = lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ siraben ]; platforms = lib.platforms.linux ++ lib.platforms.darwin; mainProgram = "tilem2"; }; -}) +}