From 08b5c11cb56e63ca6eb8908044e4f84c5618d280 Mon Sep 17 00:00:00 2001 From: Zexin Yuan Date: Fri, 2 May 2025 10:48:57 +0800 Subject: [PATCH 1/2] tm: unbreak --- .../by-name/tm/tm/missing-string-header.patch | 24 +++++++++++++++++++ pkgs/by-name/tm/tm/package.nix | 5 ++++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/by-name/tm/tm/missing-string-header.patch diff --git a/pkgs/by-name/tm/tm/missing-string-header.patch b/pkgs/by-name/tm/tm/missing-string-header.patch new file mode 100644 index 000000000000..134102400a6d --- /dev/null +++ b/pkgs/by-name/tm/tm/missing-string-header.patch @@ -0,0 +1,24 @@ +diff --git a/unix_client.c b/unix_client.c +index 920910a..6d608fd 100644 +--- a/unix_client.c ++++ b/unix_client.c +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include "main.h" + #include "handlers.h" +diff --git a/unix_server.c b/unix_server.c +index 5cf93ed..d3c51c9 100644 +--- a/unix_server.c ++++ b/unix_server.c +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/pkgs/by-name/tm/tm/package.nix b/pkgs/by-name/tm/tm/package.nix index 45208fa35399..48c40568fdbc 100644 --- a/pkgs/by-name/tm/tm/package.nix +++ b/pkgs/by-name/tm/tm/package.nix @@ -15,6 +15,11 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out)" ]; + patches = [ + # fix using strncpy and strlen without including string.h + ./missing-string-header.patch + ]; + postPatch = '' sed -i 's@/usr/bin/install@install@g ; s/gcc/cc/g' Makefile ''; From 5e181b7db1d05b37edb2918113aab51e797a5a8e Mon Sep 17 00:00:00 2001 From: Zexin Yuan Date: Fri, 2 May 2025 10:52:24 +0800 Subject: [PATCH 2/2] tm: mordenize --- pkgs/by-name/tm/tm/package.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/tm/tm/package.nix b/pkgs/by-name/tm/tm/package.nix index 48c40568fdbc..c181cddd6f81 100644 --- a/pkgs/by-name/tm/tm/package.nix +++ b/pkgs/by-name/tm/tm/package.nix @@ -4,13 +4,13 @@ fetchurl, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAtts: { pname = "tm"; version = "0.4.1"; src = fetchurl { - url = "https://vicerveza.homeunix.net/~viric/soft/tm/tm-${version}.tar.gz"; - sha256 = "3b389bc03b6964ad5ffa57a344b891fdbcf7c9b2604adda723a863f83657c4a0"; + url = "https://vicerveza.homeunix.net/~viric/soft/tm/tm-${finalAtts.version}.tar.gz"; + hash = "sha256-OzibwDtpZK1f+lejRLiR/bz3ybJgSt2nI6hj+DZXxKA="; }; makeFlags = [ "PREFIX=$(out)" ]; @@ -24,12 +24,12 @@ stdenv.mkDerivation rec { sed -i 's@/usr/bin/install@install@g ; s/gcc/cc/g' Makefile ''; - meta = with lib; { + meta = { description = "Terminal mixer - multiplexer for the i/o of terminal applications"; homepage = "http://vicerveza.homeunix.net/~viric/soft/tm"; - license = licenses.gpl2Plus; + license = lib.licenses.gpl2Plus; maintainers = [ ]; - platforms = platforms.all; + platforms = lib.platforms.all; mainProgram = "tm"; }; -} +})