setserial: undrop, adopt and fix build

This commit is contained in:
Manuel Mendez
2025-12-17 15:36:39 +08:00
committed by aleksana
parent de578da2e1
commit f86e8a5dfa
3 changed files with 73 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
diff --git a/setserial.c b/setserial.c
index fef6532768..b7cde26ac2 100644
--- a/setserial.c
+++ b/setserial.c
@@ -10,11 +10,14 @@
* Last modified: [tytso:19940520.0036EDT]
*/
+#include <errno.h>
+#include <fcntl.h>
#include <stdio.h>
-#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
#include <termios.h>
-#include <string.h>
-#include <errno.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
#ifdef HAVE_ASM_IOCTLS_H
#include <asm/ioctls.h>
@@ -714,7 +717,7 @@
exit(1);
}
-main(int argc, char **argv)
+int main(int argc, char **argv)
{
int get_flag = 0, wild_intr_flag = 0;
int c;
+42
View File
@@ -0,0 +1,42 @@
{
lib,
stdenv,
fetchurl,
groff,
autoreconfHook,
}:
stdenv.mkDerivation rec {
pname = "setserial";
version = "2.17";
src = fetchurl {
url = "mirror://sourceforge/setserial/${pname}-${version}.tar.gz";
sha256 = "0jkrnn3i8gbsl48k3civjmvxyv9rbm1qjha2cf2macdc439qfi3y";
};
patches = [ ./gcc-fixes.patch ];
nativeBuildInputs = [
autoreconfHook
groff
];
postConfigure = ''
substituteInPlace Makefile \
--replace-fail /usr/man/ /share/man/ \
--replace-fail DESTDIR out
'';
preInstall = ''
mkdir -p "$out/bin" "$out/share/man/man8"
'';
meta = {
description = "Serial port configuration utility";
homepage = "https://setserial.sourceforge.net";
platforms = lib.platforms.linux;
license = lib.licenses.gpl2Only;
maintainers = [ lib.maintainers.mmlb ];
};
}
-1
View File
@@ -1439,7 +1439,6 @@ mapAliases {
sequoia = throw "'sequoia' has been renamed to/replaced by 'sequoia-sq'"; # Converted to throw 2025-10-27
serverless = throw "'serverless' has been removed because version 3.x is unmaintained upstream and vulnerable, and version 4.x lacks a suitable binary or source download."; # Added 2025-11-22
session-desktop-appimage = throw "'session-desktop-appimage' has been renamed to/replaced by 'session-desktop'"; # Converted to throw 2025-10-27
setserial = throw "'setserial' has been removed as it had been abandoned upstream"; # Added 2025-05-18
sexp = throw "'sexp' has been renamed to/replaced by 'sexpp'"; # Converted to throw 2025-10-27
shadered = throw "shadered has been removed because it has been marked as broken since at least November 2024."; # Added 2025-10-01
shared_desktop_ontologies = throw "'shared_desktop_ontologies' has been removed as it had been abandoned upstream"; # Added 2025-11-09