diff --git a/pkgs/desktops/cdesktopenv/0001-all-remove-deprecated-sys_errlist-and-replace-with-A.patch b/pkgs/desktops/cdesktopenv/0001-all-remove-deprecated-sys_errlist-and-replace-with-A.patch new file mode 100644 index 000000000000..4382cdcf35b0 --- /dev/null +++ b/pkgs/desktops/cdesktopenv/0001-all-remove-deprecated-sys_errlist-and-replace-with-A.patch @@ -0,0 +1,336 @@ +From 67f62e5a8acd70d30f7067f1f44ac7b15c67011a Mon Sep 17 00:00:00 2001 +From: Peter Howkins +Date: Mon, 2 Nov 2020 05:30:08 +0000 +Subject: [PATCH] all: remove deprecated sys_errlist[] and replace with ANSI C + strerror() + +--- + cde/config/imake/imake.c | 13 ------------- + cde/lib/tt/bin/dbck/spec.C | 8 -------- + cde/lib/tt/lib/tt_options.h | 12 ------------ + cde/programs/dtcm/dtcm/dnd.c | 4 ---- + cde/programs/dtcm/libDtCmP/util.c | 5 +---- + .../dthelp/parser.ccdf/volumegen/Volumegen.c | 1 - + cde/programs/dtimsstart/remote.c | 4 ---- + cde/programs/dtimsstart/start.c | 12 +++--------- + cde/programs/dtinfo/dtinfo/src/external-api/comm.c | 5 +---- + .../dtksh/ksh93/src/lib/libast/string/fmterror.c | 9 +-------- + .../dtksh/ksh93/src/lib/libast/string/strerror.c | 8 +------- + cde/programs/dtlogin/dm.h | 7 +------ + 12 files changed, 8 insertions(+), 80 deletions(-) + +diff --git a/cde/config/imake/imake.c b/cde/config/imake/imake.c +index 574af7c7..83834aa7 100644 +--- a/cde/config/imake/imake.c ++++ b/config/imake/imake.c +@@ -242,19 +242,6 @@ extern int errno; + #include + #include "imakemdep.h" + +-/* +- * This define of strerror is copied from (and should be identical to) +- * Xos.h, which we don't want to include here for bootstrapping reasons. +- */ +-#if defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4)) +-# ifndef strerror +-extern char *sys_errlist[]; +-extern int sys_nerr; +-# define strerror(n) \ +- (((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error") +-# endif +-#endif +- + #define TRUE 1 + #define FALSE 0 + +diff --git a/cde/lib/tt/bin/dbck/spec.C b/cde/lib/tt/bin/dbck/spec.C +index 18bba3fb..eaf2d6b7 100644 +--- a/cde/lib/tt/bin/dbck/spec.C ++++ b/lib/tt/bin/dbck/spec.C +@@ -44,14 +44,6 @@ + #include "ttdbck.h" + #include "tt_db_server_consts.h" + +-#if !defined(OPT_STRERROR) +-// No strerror(), fake it +-char * +-strerror(int e) +-{ +- return ((e sys_nerr) +- (void) fprintf(stderr, ":Unknown error %d", saveerr); +- else +- (void) fprintf(stderr, ":%s", sys_errlist[saveerr]); ++ (void) fprintf(stderr, ":%s", strerror(saveerr)); + } + #endif + +diff --git a/cde/programs/dthelp/parser.ccdf/volumegen/Volumegen.c b/cde/programs/dthelp/parser.ccdf/volumegen/Volumegen.c +index d9a42943..08de4809 100644 +--- a/cde/programs/dthelp/parser.ccdf/volumegen/Volumegen.c ++++ b/programs/dthelp/parser.ccdf/volumegen/Volumegen.c +@@ -56,7 +56,6 @@ + typedef int Boolean; + + /* extern int errno; */ +-/* extern char *sys_errlist[]; */ + /* extern int sys_nerr; */ + + static void GenTopicList ( +diff --git a/cde/programs/dtimsstart/remote.c b/cde/programs/dtimsstart/remote.c +index 68773673..71d32977 100644 +--- a/cde/programs/dtimsstart/remote.c ++++ b/programs/dtimsstart/remote.c +@@ -37,10 +37,6 @@ + #include /* for X_ChangeHosts */ + #include /* for XA_STRING */ + +-#if !defined(__linux__) && !defined(CSRG_BASED) +-extern char *sys_errlist[]; +-#endif +- + static char *conf_msg_id = STR_CONFDATA; + + #define CONF_MSG_ID_LEN strlen(conf_msg_id) +diff --git a/cde/programs/dtimsstart/start.c b/cde/programs/dtimsstart/start.c +index 78fc2a38..1dafa189 100644 +--- a/cde/programs/dtimsstart/start.c ++++ b/programs/dtimsstart/start.c +@@ -27,14 +27,10 @@ + #include + #include + #include ++#include + + #if (defined(__linux__) || defined(CSRG_BASED)) && !defined(_NFILE) + #define _NFILE FOPEN_MAX +-#endif +- +-#if !defined(__linux__) && !defined(CSRG_BASED) +-extern char *sys_errlist[]; +-extern int sys_nerr; + #endif + + /* local functions */ +@@ -599,8 +595,7 @@ static int invoke_ims(UserSelection *sel) + + pid = fork(); + if (pid == (pid_t) -1) { +- put_xims_log("fork failed [%s]", +- (errno <= sys_nerr) ? sys_errlist[errno] : NULL, 0, 0); ++ put_xims_log("fork failed [%s]", strerror(errno), 0, 0); + #ifdef DEBUG + perror("fork"); + #endif +@@ -617,8 +612,7 @@ static int invoke_ims(UserSelection *sel) + #endif + execl(SH_PATH, "sh", "-c", renv->cmdbuf, NULL); + +- put_xims_log("%s: exec failed [%s]", SH_PATH, +- (errno <= sys_nerr) ? sys_errlist[errno] : NULL, 0, 0); ++ put_xims_log("%s: exec failed [%s]", SH_PATH, strerror(errno) , 0, 0); + /* perror(SH_PATH); */ + sleep(1); + _exit(1); +diff --git a/cde/programs/dtinfo/dtinfo/src/external-api/comm.c b/cde/programs/dtinfo/dtinfo/src/external-api/comm.c +index d61ccb7a..6aa2fc91 100644 +--- a/cde/programs/dtinfo/dtinfo/src/external-api/comm.c ++++ b/programs/dtinfo/dtinfo/src/external-api/comm.c +@@ -53,9 +53,6 @@ + #include + #endif + +-extern char *sys_errlist[]; +- +- + static OliasEvent *current_event; + static int reply_status; + #define NO_REPLY 0 +@@ -332,7 +329,7 @@ wait_for_reply (Widget toplevel) + XtAppWarningMsg (XtWidgetToApplicationContext (toplevel), + "communicationsError", "select", + "Olias API", "Select failed: %s", +- &sys_errlist[errno], &num_params); ++ strerror(errno), &num_params); + continue; + } + continue; +diff --git a/cde/programs/dtksh/ksh93/src/lib/libast/string/fmterror.c b/cde/programs/dtksh/ksh93/src/lib/libast/string/fmterror.c +index 313b67bc..8dd87ab8 100644 +--- a/cde/programs/dtksh/ksh93/src/lib/libast/string/fmterror.c ++++ b/programs/dtksh/ksh93/src/lib/libast/string/fmterror.c +@@ -92,14 +92,7 @@ + #endif + #include + +-extern __MANGLE__ int sys_nerr; +-extern __MANGLE__ char* sys_errlist[]; +- + char* + fmterror __PARAM__((int err), (err)) __OTORP__(int err;){ +- static char msg[28]; +- +- if (err > 0 && err <= sys_nerr) return(sys_errlist[err]); +- sfsprintf(msg, sizeof(msg), "Error %d", err); +- return(msg); ++ return strerror(err); + } +diff --git a/cde/programs/dtksh/ksh93/src/lib/libast/string/strerror.c b/cde/programs/dtksh/ksh93/src/lib/libast/string/strerror.c +index 7686a54d..a6aa7ce8 100644 +--- a/cde/programs/dtksh/ksh93/src/lib/libast/string/strerror.c ++++ b/programs/dtksh/ksh93/src/lib/libast/string/strerror.c +@@ -108,18 +108,12 @@ NoN(strerror) + + #include + +-extern __MANGLE__ int sys_nerr; +-extern __MANGLE__ char* sys_errlist[]; + + char* + strerror __PARAM__((int err), (err)) __OTORP__(int err;) + #line 25 + { +- static char msg[28]; +- +- if (err > 0 && err <= sys_nerr) return(sys_errlist[err]); +- sfsprintf(msg, sizeof(msg), "Error %d", err); +- return(msg); ++ return strerror(err); + } + + #endif +diff --git a/cde/programs/dtlogin/dm.h b/cde/programs/dtlogin/dm.h +index 3e0f2499..e67edc3c 100644 +--- a/cde/programs/dtlogin/dm.h ++++ b/programs/dtlogin/dm.h +@@ -68,8 +68,7 @@ + # include /* for passwd structure */ + # include + # include /* for exit(), malloc(), abort() */ +-# include /* for string functions, bcopy(), +- sys_errlist */ ++# include /* for string functions, bcopy() */ + # include /* for NGROUPS */ + # include /* for fd_set */ + # include /* for Internet socket stuff */ +@@ -475,10 +474,6 @@ struct verify_info { + * + ***************************************************************************/ + +-#if !defined(__linux__) && !defined(CSRG_BASED) +-extern char *sys_errlist[]; /* system error msgs */ +-extern int sys_nerr; /* system error msgs */ +-#endif + extern XrmDatabase XresourceDB; + + +-- +2.28.0 + diff --git a/pkgs/desktops/cdesktopenv/default.nix b/pkgs/desktops/cdesktopenv/default.nix index 7e6b49957b8e..7454603e7acd 100644 --- a/pkgs/desktops/cdesktopenv/default.nix +++ b/pkgs/desktops/cdesktopenv/default.nix @@ -2,7 +2,8 @@ , libXinerama, libXt, libXext, libtirpc, motif, libXft, xbitmaps , libjpeg, libXmu, libXdmcp, libXScrnSaver, symlinkJoin, bdftopcf , ncompress, mkfontdir, tcl, libXaw, gcc, glibcLocales, gawk -, autoPatchelfHook, libredirect, makeWrapper, xset, xrdb, fakeroot }: +, autoPatchelfHook, libredirect, makeWrapper, xset, xrdb, fakeroot +, rpcsvc-proto }: let x11ProjectRoot = symlinkJoin { @@ -25,6 +26,7 @@ in stdenv.mkDerivation rec { # remove with next release patches = [ ./2.3.2.patch + ./0001-all-remove-deprecated-sys_errlist-and-replace-with-A.patch ]; buildInputs = [ @@ -33,6 +35,7 @@ in stdenv.mkDerivation rec { ]; nativeBuildInputs = [ bison ncompress gawk autoPatchelfHook makeWrapper fakeroot + rpcsvc-proto ]; makeFlags = [ @@ -74,6 +77,5 @@ EOF license = licenses.lgpl2; maintainers = [ maintainers.gnidorah ]; platforms = [ "i686-linux" "x86_64-linux" ]; - broken = true; # not compatible with glibc 2.32 }; }