diff --git a/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch b/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch deleted file mode 100644 index bc8c77f913c62..0000000000000 --- a/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch +++ /dev/null @@ -1,94 +0,0 @@ -From a69607c511b6da94cde477283b129cbc9cfdd5a3 Mon Sep 17 00:00:00 2001 -From: Maximilian Bosch -Date: Tue, 11 Aug 2020 12:32:06 +0200 -Subject: [PATCH] Use `strerror` rather than `sys_errlist` to fix compilation - w/glibc-2.32 - -To quote the release-notes[1]: - - All programs should use - strerror or strerror_r instead. - -[1] https://sourceware.org/pipermail/libc-announce/2020/000029.html ---- - 2006/src/packlib/cspack/sysreq/serror.c | 10 +--------- - 2006/src/packlib/cspack/sysreq/socket.c | 2 +- - 2006/src/packlib/kernlib/kernbit/z268/systems.c | 4 ++-- - 2006/src/pawlib/paw/piafs/piafc.c | 5 +---- - 4 files changed, 5 insertions(+), 16 deletions(-) - -diff --git a/2006/src/packlib/cspack/sysreq/serror.c b/2006/src/packlib/cspack/sysreq/serror.c -index 3667c42a..c560e499 100644 ---- a/2006/src/packlib/cspack/sysreq/serror.c -+++ b/2006/src/packlib/cspack/sysreq/serror.c -@@ -176,15 +176,7 @@ int n; - } - else { - #if !defined(vms) -- if ((n>0) && (n> 2006/src/Imakefile - substituteInPlace 2006/src/config/site.def \ - --replace "# define MakeCmd gmake" "# define MakeCmd make" - substituteInPlace 2006/src/config/lnxLib.rules \ - --replace "# lib" "// lib" - - substituteInPlace 2006/src/config/linux.cf \ - --replace "# ifdef Hasgfortran" "# if 1" \ - --replace "# define CcCmd gcc4" "# define CcCmd gcc" - substituteInPlace 2006/src/scripts/cernlib \ - --replace "-lnsl" "" - - # binutils 2.37 fix - substituteInPlace 2006/src/config/Imake.tmpl --replace "clq" "cq" - ''; - - preConfigure = '' - export CERN=`pwd` - export CERN_LEVEL=${version} - export CERN_ROOT=$CERN/$CERN_LEVEL - export CVSCOSRC=`pwd`/$CERN_LEVEL/src - export PATH=$PATH:$CERN_ROOT/bin - ''; - - FFLAGS = lib.optionals (lib.versionAtLeast gfortran.version "10.0.0") [ - # Fix https://github.com/vmc-project/geant3/issues/17 - "-fallow-invalid-boz" - - # Fix for gfortran 10 - "-fallow-argument-mismatch" - ]; - - NIX_CFLAGS = [ "-Wno-return-type" ]; - - # Workaround build failure on -fno-common toolchains: - # ld: libpacklib.a(kedit.o):kuip/klink1.h:11: multiple definition of `klnkaddr'; - # libzftplib.a(zftpcdf.o):zftp/zftpcdf.c:155: first defined here - env.NIX_CFLAGS_COMPILE = "-fcommon"; - - makeFlags = [ - "FORTRANOPTIONS=$(FFLAGS)" - "CCOPTIONS=$(NIX_CFLAGS)" - ]; - - configurePhase = '' - runHook preConfigure - - cd $CERN_ROOT - mkdir -p build - cd $CERN_ROOT/build - $CVSCOSRC/config/imake_boot - - runHook postConfigure - ''; - - preBuild = '' - make -j $NIX_BUILD_CORES $makeFlags bin/kuipc - make -j $NIX_BUILD_CORES $makeFlags scripts/Makefile - pushd scripts - make -j $NIX_BUILD_CORES $makeFlags bin/cernlib - popd - ''; - - installTargets = [ "install.bin" "install.lib" "install.include" ]; - installFlags = [ - "CERN_BINDIR=${placeholder "out"}/bin" - "CERN_INCLUDEDIR=${placeholder "out"}/include" - "CERN_LIBDIR=${placeholder "out"}/lib" - "CERN_SHLIBDIR=${placeholder "out"}/libexec" + nativeBuildInputs = [ cmake ]; + buildInputs = with xorg; [ + freetype + gfortran + openssl + libnsl + libX11 + libXaw + libXft + libXt + libxcrypt + motif ]; setupHook = ./setup-hook.sh; @@ -95,8 +44,12 @@ stdenv.mkDerivation rec { meta = { homepage = "http://cernlib.web.cern.ch"; description = "Legacy collection of libraries and modules for data analysis in high energy physics"; - broken = stdenv.isDarwin; - platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]; + platforms = [ + "aarch64-linux" + "i686-linux" + "x86_64-linux" + "x86_64-darwin" + ]; maintainers = with lib.maintainers; [ veprbl ]; license = lib.licenses.gpl2; }; diff --git a/pkgs/development/libraries/physics/cernlib/patch.patch b/pkgs/development/libraries/physics/cernlib/patch.patch deleted file mode 100644 index 2d75b6bf0f88c..0000000000000 --- a/pkgs/development/libraries/physics/cernlib/patch.patch +++ /dev/null @@ -1,186 +0,0 @@ -diff --git a/2006/src/config/Imake.tmpl b/2006/src/config/Imake.tmpl -index 054fb04..a3b3828 100644 ---- a/2006/src/config/Imake.tmpl -+++ b/2006/src/config/Imake.tmpl -@@ -455,7 +455,7 @@ XCOMM the platform-specific parameters - edit site.def to change - #define NoRConst NO /* YES if const for structs of funcs is bad */ - #endif - #ifndef InstPgmFlags --#define InstPgmFlags -s -+#define InstPgmFlags - #endif - #ifndef InstBinFlags - #define InstBinFlags -m 0755 -diff --git a/2006/src/config/biglib.rules b/2006/src/config/biglib.rules -index c90e58a..9173bdc 100644 ---- a/2006/src/config/biglib.rules -+++ b/2006/src/config/biglib.rules -@@ -368,7 +368,7 @@ define build-object-list @@\ - @ (set -e;\ @@\ - case '${MFLAGS}' in *[i]*) set +e;; esac; \ @@\ - subdirs=Quote(dirs);\ @@\ -- list=`/bin/pwd`/$@;\ @@\ -+ list=`pwd`/$@;\ @@\ - for dir in $$subdirs; do \ @@\ - (set -e;cd $$dir;SedCmd -e "\=^[^/]=s=^.=$$dir/&=" $@ >> $$list);\@@\ - done) || (rm $@; exit 1) @@\ -diff --git a/2006/src/config/imake_boot b/2006/src/config/imake_boot -index b52d0d3..69cf1b3 100755 ---- a/2006/src/config/imake_boot -+++ b/2006/src/config/imake_boot -@@ -10,8 +10,8 @@ if [ "$CVSCOSRC" = "" ] ; then - fi - if [ -f Imakefile ] ; then - imake -DUseInstalled -I$CVSCOSRC/config \ -- -DTOPDIR=`/bin/pwd` -DCURDIR= -fImakefile -+ -DTOPDIR=`pwd` -DCURDIR= -fImakefile - else - imake -DUseInstalled -I$CVSCOSRC/config \ -- -DTOPDIR=`/bin/pwd` -DCURDIR= -f$CVSCOSRC/Imakefile -+ -DTOPDIR=`pwd` -DCURDIR= -f$CVSCOSRC/Imakefile - fi -diff --git a/2006/src/config/linux-lp64.cf b/2006/src/config/linux-lp64.cf -index e071b2f..3cc5c3b 100644 ---- a/2006/src/config/linux-lp64.cf -+++ b/2006/src/config/linux-lp64.cf -@@ -173,7 +173,7 @@ - #define FortranCmd g77 - #define XargsCmd xargs - #define FortranSaveFlags /* */ /* Everything static !? */ --#define DefaultFCOptions -fno-automatic -fno-second-underscore -fugly-complex -+#define DefaultFCOptions -fno-automatic -fno-second-underscore - #define CernlibSystem -DCERNLIB_LINUX -DCERNLIB_UNIX -DCERNLIB_LNX -DCERNLIB_QMGLIBC -DCERNLIB_QMLXIA64 - - # endif -diff --git a/2006/src/config/linux.cf b/2006/src/config/linux.cf -index cc0bee5..a8dd954 100644 ---- a/2006/src/config/linux.cf -+++ b/2006/src/config/linux.cf -@@ -258,7 +258,7 @@ endif @@\ - #define FortranCmd g77 - #define XargsCmd xargs - #define FortranSaveFlags /* */ /* Everything static !? */ --#define DefaultFCOptions -fno-automatic -fno-second-underscore -fugly-complex -+#define DefaultFCOptions -fno-automatic -fno-second-underscore - #define CernlibSystem -DCERNLIB_LINUX -DCERNLIB_UNIX -DCERNLIB_LNX -DCERNLIB_QMGLIBC - - # endif -diff --git a/2006/src/packlib/kuip/code_kuip/kkern.c b/2006/src/packlib/kuip/code_kuip/kkern.c -index 3a5579f..5f3c352 100644 ---- a/2006/src/packlib/kuip/code_kuip/kkern.c -+++ b/2006/src/packlib/kuip/code_kuip/kkern.c -@@ -543,24 +543,6 @@ char *str0dup( const char *str ) - - - /* -- * like strdup() but string is n characters long and not terminated -- */ --char *strndup( const char *str, -- size_t len ) --{ -- size_t bytes = len + 1; -- char *p; -- -- if( bytes < ALLOC_MIN_BYTES ) -- bytes = ALLOC_MIN_BYTES; -- -- p = strncpy( malloc( bytes ), str, len ); -- p[len] = '\0'; -- return p; --} -- -- --/* - * strdup() of character representation of integer n - */ - char *stridup( int n ) -diff --git a/2006/src/packlib/kuip/code_kuip/kmenu.c b/2006/src/packlib/kuip/code_kuip/kmenu.c -index f135b07..23007a8 100644 ---- a/2006/src/packlib/kuip/code_kuip/kmenu.c -+++ b/2006/src/packlib/kuip/code_kuip/kmenu.c -@@ -1404,7 +1404,7 @@ void interactive_find( char *expr, int keym ) - printf ("See also:\n "); - for (i = 0; i < nval; i++) { - if (i == ncmd) continue; -- printf (flis_name[i]); -+ printf ("%s", flis_name[i]); - if (i < nval-1) - printf (", "); - else -diff --git a/2006/src/packlib/kuip/kuip/kstring.h b/2006/src/packlib/kuip/kuip/kstring.h -index 7811f15..12a1344 100644 ---- a/2006/src/packlib/kuip/kuip/kstring.h -+++ b/2006/src/packlib/kuip/kuip/kstring.h -@@ -21,7 +21,6 @@ extern "C" { - */ - - #ifndef WIN32 --extern void* memmove( void* dst, const void* src, size_t n ); - #endif - - /* GF. make conform to kkern.c#if !defined(__convexc__)*/ -@@ -46,7 +45,6 @@ extern char* str4dup( const char* str1, const char* str2, const char* str3, - const char* str4 ); - extern char* str5dup( const char* str1, const char* str2, const char* str3, - const char* str4, const char* str5 ); --extern char* strndup( const char* buf, size_t n ); - extern char* stridup( int i ); - - extern char* mstrcat( char* ptr, const char* str ); -diff --git a/2006/src/pawlib/paw/cpaw/bugrep.c b/2006/src/pawlib/paw/cpaw/bugrep.c -index d503a45..d26e30f 100644 ---- a/2006/src/pawlib/paw/cpaw/bugrep.c -+++ b/2006/src/pawlib/paw/cpaw/bugrep.c -@@ -432,51 +432,7 @@ br_add_config( char * tmp_file ) - - static int - br_mail_file( char *addr, char *subj, char *file ) --#if (defined(CERNLIB_UNIX))&&(!defined(CERNLIB_WINNT))&&(!defined(CERNLIB_MACOSX)) --{ -- FILE *mfp, *fp; -- char line[1024], my_addr[L_cuserid]; -- time_t clock; -- struct tm *ts; -- -- fp = fopen( file, "r" ); -- if ( fp == NULL ) { -- printf( "BUGREPORT: cannot (re)open temporary file\n" ); -- return MAIL_ERROR; -- } -- -- cuserid( my_addr ); -- -- sprintf( line, "/usr/lib/sendmail -t" ); -- mfp = popen( line, "w" ); -- -- if ( mfp == NULL ) { -- printf( "BUGREPORT: cannot run sendmail\n" ); -- return MAIL_ERROR; -- } -- -- -- clock = time( (time_t *) 0 ); -- ts = localtime( &clock ); -- strftime( line, sizeof( line ), -- "%a, %d %h %y %H:%M:%S", ts ); -- fprintf ( mfp, "To: %s\n", addr ); -- fprintf ( mfp, "Bcc: %s\n", my_addr ); -- fprintf ( mfp, "Date: %s\n", line ); -- fprintf ( mfp, "Subject: %s\n", subj ); -- fprintf ( mfp, "\n" ); -- -- while( fgets( line, sizeof( line ), fp ) != NULL ) { -- fputs( line, mfp ); -- } -- fclose( fp ); -- -- pclose( mfp ); -- -- return MAIL_OK; --} --#endif --#if defined(CERNLIB_MACOSX) -+#if (defined(CERNLIB_UNIX))&&(!defined(CERNLIB_WINNT)) - { - FILE *mfp, *fp; - char line[1024], *my_addr; diff --git a/pkgs/development/libraries/physics/cernlib/setup-hook.sh b/pkgs/development/libraries/physics/cernlib/setup-hook.sh index d837593277606..d48b98cfa6241 100644 --- a/pkgs/development/libraries/physics/cernlib/setup-hook.sh +++ b/pkgs/development/libraries/physics/cernlib/setup-hook.sh @@ -1,3 +1,3 @@ export CERN_LEVEL=@version@ export CERN=@out@ -export CERN_ROOT=$CERN/$CERN_LEVEL +export CERN_ROOT=$CERN