about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/physics
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
commite0794be8a0d11e90461e5a9c85012a36b93ec976 (patch)
treeefd9cbc55ea3322867bf601c4d536758a3dd5fcc /nixpkgs/pkgs/development/libraries/physics
parent3538874082ded7647b1ccec0343c7c1e882cfef3 (diff)
parent1a57d96edd156958b12782e8c8b6a374142a7248 (diff)
downloadnixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.gz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.bz2
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.lz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.xz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.zst
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.zip
Merge commit '1a57d96edd156958b12782e8c8b6a374142a7248'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/physics')
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch94
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/pythia/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/rivet/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/yoda/default.nix6
10 files changed, 166 insertions, 31 deletions
diff --git a/nixpkgs/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch b/nixpkgs/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch
new file mode 100644
index 000000000000..bc8c77f913c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch
@@ -0,0 +1,94 @@
+From a69607c511b6da94cde477283b129cbc9cfdd5a3 Mon Sep 17 00:00:00 2001
+From: Maximilian Bosch <maximilian@mbosch.me>
+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<sys_nerr)) {
+-                        return(sys_errlist[n]);
+-                }
+-                else {
+-                        (void) sprintf(buf,"%s: %d\n",
+- sys_serrlist[SEMAXERR+1-SEBASEOFF],
+-                            n);
+-                        return(buf);
+-                }
++          return strerror(n);
+ #else /* vms */
+ /*
+  * There are (were) some bugs is DEC C compilers (/OPT), just check
+diff --git a/2006/src/packlib/cspack/sysreq/socket.c b/2006/src/packlib/cspack/sysreq/socket.c
+index ceb5bd63..34c2a7bc 100644
+--- a/2006/src/packlib/cspack/sysreq/socket.c
++++ b/2006/src/packlib/cspack/sysreq/socket.c
+@@ -412,7 +412,7 @@ char *
+ s_errmsg()                              /* return last error message    */
+ {
+ #if !defined(vms)
+-        return(sys_errlist[errno]);
++        return(strerror(errno));
+ #else /* vms */
+ #if defined(MULTINET) && (MULTINET == 1)
+         return(vms_errno_string());
+diff --git a/2006/src/packlib/kernlib/kernbit/z268/systems.c b/2006/src/packlib/kernlib/kernbit/z268/systems.c
+index 98459459..d1ad63ed 100644
+--- a/2006/src/packlib/kernlib/kernbit/z268/systems.c
++++ b/2006/src/packlib/kernlib/kernbit/z268/systems.c
+@@ -134,7 +134,7 @@ int     *ovflw;
+ #endif /* hpux */
+ 
+ 	if ( (ps=(FILE *)popen(command,"r"))==NULL ) {
+-		fprintf(stderr,"systems(): popen(): %s\n",sys_errlist[errno] );
++		fprintf(stderr,"systems(): popen(): %s\n",strerror(errno) );
+ 		*rc= -errno;
+ 		*chars=0        ;
+                 *l=0        ;
+@@ -144,7 +144,7 @@ int     *ovflw;
+ 	rcode = fread(buf, 1, buflen , ps );
+ 	if ( rcode < 0 ) {
+ 		fprintf(stderr,"systems(): pipe fread(): %s\n",
+-                                                       sys_errlist[errno] );
++                                                       strerror(errno) );
+ 		buf[0]='\n';
+ 		*rc= -errno;
+                 *chars=0        ;
+diff --git a/2006/src/pawlib/paw/piafs/piafc.c b/2006/src/pawlib/paw/piafs/piafc.c
+index b163f80c..4d8d5528 100644
+--- a/2006/src/pawlib/paw/piafs/piafc.c
++++ b/2006/src/pawlib/paw/piafs/piafc.c
+@@ -1795,10 +1795,7 @@ static void fatalperror(char *msg)
+    extern char  *sys_errlist[];
+ #endif
+ 
+-   if ((unsigned) errno < sys_nerr)
+-      sprintf(buf, "%s: %s", msg, sys_errlist[errno]);
+-   else
+-      sprintf(buf, "%s: Error %d", msg, errno);
++   sprintf(buf, "%s: %s", msg, strerror(errno));
+ 
+    fatal(buf);
+ }
+-- 
+2.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix b/nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix
index 8c4d688b697e..3c2cd4c69145 100644
--- a/nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ gnumake imake makedepend ];
   sourceRoot = ".";
 
-  patches = [ ./patch.patch ];
+  patches = [ ./patch.patch ./0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch ];
 
   postPatch = ''
     substituteInPlace 2006/src/config/site.def \
diff --git a/nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix b/nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix
index 2bc5b12dfb77..68e07e7b42dd 100644
--- a/nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "fastjet-contrib";
-  version = "1.042";
+  version = "1.045";
 
   src = fetchurl {
     url = "http://fastjet.hepforge.org/contrib/downloads/fjcontrib-${version}.tar.gz";
-    sha256 = "0cc8dn6g7adj2pgs8hvczg68i3xhlk6978m4gxamgibilf9jw1av";
+    sha256 = "1y45jx7i30ik2pjv33y16fi5i5jpmi0zp1jh32pwywd3diaiazv6";
   };
 
   buildInputs = [ fastjet ];
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix
index 85ad11b79b16..42014949c0b6 100644
--- a/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix
@@ -42,22 +42,22 @@ in
 
     {
       name = "G4EMLOW";
-      version = "7.9.1";
-      sha256 = "1jrw0izw732bywq1k1srs3x2z0m3y2h377kcvwbwcr0wa1p10342";
+      version = "7.13";
+      sha256 = "0scczd4ismvd4g3vfshbvwv92bzkdjz0ma7y21n6qxxy96v9cj1p";
       envvar = "LE";
     }
 
     {
       name = "G4PhotonEvaporation";
-      version = "5.5";
-      sha256 = "1mvnbs7yvkii41blks6bkqr8qhxgnj3xxvv1i3vdg2y14shxv5ar";
+      version = "5.7";
+      sha256 = "1rg7fygfxx06h98ywlci6b0b9ih74q8diygr76c3vppxdzjl47kn";
       envvar = "LEVELGAMMA";
     }
 
     {
       name = "G4RadioactiveDecay";
-      version = "5.4";
-      sha256 = "0qaark6mqzxr3lqawv6ai8z5211qihlp5x2hn86vzx8kgpd7j1r4";
+      version = "5.6";
+      sha256 = "1w8d9zzc4ss7sh1f8cxv5pmrx2b74p1y26377rw9hnlfkiy0g1iq";
       envvar = "RADIOACTIVE";
     }
 
@@ -70,8 +70,8 @@ in
 
     {
       name = "G4PARTICLEXS";
-      version = "2.1";
-      sha256 = "0h8ba8jk197npbd9lzq2qlfiklbjgqwk45m1cc6piy5vf8ri0k89";
+      version = "3.1";
+      sha256 = "1kg9y0kqn4lma7b0yjpgj7s9n317yqi54ydvq365qphnmm7ahka0";
       envvar = "PARTICLEXS";
     }
 
@@ -98,15 +98,15 @@ in
 
     {
       name = "G4ENSDFSTATE";
-      version = "2.2";
-      sha256 = "19p0sq0rmyg48j9hddqy24dn99md7ddiyq09lyj381q7cbpjfznx";
+      version = "2.3";
+      sha256 = "00wjir59rrrlk0a12vi8rsnhyya71rdi1kmark9sp487hbhcai4l";
       envvar = "ENSDFSTATE";
     }
 
     {
       name = "G4RealSurface";
-      version = "2.1.1";
-      sha256 = "0l3gs0nlp10cjlwiln3f72zfch0av2g1r8m2ny9afgvwgbwiyj4h";
+      version = "2.2";
+      sha256 = "08382y1258ifs7nap6zaaazvabg72blr0dkqgwk32lrg07hdwm4r";
       envvar = "REALSURFACE";
     }
 
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix
index 97822d769dd5..7caae2c52d33 100644
--- a/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix
@@ -38,6 +38,9 @@
 # For enablePython
 , boost
 , python3
+
+# For tests
+, callPackage
 }:
 
 let
@@ -45,20 +48,20 @@ let
 in
 
 stdenv.mkDerivation rec {
-  version = "10.6.2";
+  version = "10.7.0";
   pname = "geant4";
 
   src = fetchurl{
-    url = "https://geant4-data.web.cern.ch/geant4-data/releases/geant4.10.06.p02.tar.gz";
-    sha256 = "0vznm3pjlbihjy1wsxc4gj229k0dzc283wvil2xghyl08vwdpnpc";
+    url = "https://geant4-data.web.cern.ch/geant4-data/releases/geant4.10.07.tar.gz";
+    sha256 = "0jmdxb8z20d4l6sf2w0gk9ska48kylm38yngy3mzyvyj619a8vkp";
   };
 
   boost_python_lib = "python${builtins.replaceStrings ["."] [""] python3.pythonVersion}";
   postPatch = ''
     # Fix for boost 1.67+
     substituteInPlace environments/g4py/CMakeLists.txt \
-      --replace "find_package(Boost REQUIRED python)" \
-                "find_package(Boost REQUIRED COMPONENTS $boost_python_lib)"
+      --replace "REQUIRED python" \
+                "REQUIRED COMPONENTS $boost_python_lib"
     substituteInPlace environments/g4py/G4PythonHelpers.cmake \
       --replace "Boost::python" "Boost::$boost_python_lib"
   '';
@@ -108,6 +111,8 @@ stdenv.mkDerivation rec {
           inherit stdenv fetchurl;
           geant_version = version;
       };
+
+    tests = callPackage ./tests.nix {};
   };
 
   # Set the myriad of envars required by Geant4 if we use a nix-shell.
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix
new file mode 100644
index 000000000000..83afee6089d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix
@@ -0,0 +1,31 @@
+{ stdenv, cmake, geant4 }:
+
+{
+  example_B1 = stdenv.mkDerivation {
+    name = "${geant4.name}-test-example_B1";
+
+    inherit (geant4) src;
+
+    nativeBuildInputs = [ cmake ];
+    buildInputs = [ geant4 ];
+    checkInputs = with geant4.data; [
+      G4EMLOW
+      G4ENSDFSTATE
+      G4PARTICLEXS
+      G4PhotonEvaporation
+    ];
+
+    prePatch = ''
+      cd examples/basic/B1
+    '';
+
+    doCheck = true;
+    checkPhase = ''
+      runHook preCheck
+
+      ./exampleB1 ../run2.mac
+
+      runHook postCheck
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix b/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix
index c10e81b9a0e8..53b2889a25c8 100644
--- a/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, boost, fastjet, hepmc2, lhapdf, rsync, zlib }:
+{ stdenv, fetchurl, boost, fastjet, hepmc, lhapdf, rsync, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "pythia";
-  version = "8.244";
+  version = "8.303";
 
   src = fetchurl {
     url = "http://home.thep.lu.se/~torbjorn/pythia8/pythia${builtins.replaceStrings ["."] [""] version}.tgz";
-    sha256 = "1jlj9hgmk2gcm5p0zqsiz0dpv9vvj8ip261si7frrwfsk7wq0j73";
+    sha256 = "0gli6zf8931i7kyminppisc9d0q69xxnalvhld5fgnkh4q82nz6d";
   };
 
-  buildInputs = [ boost fastjet hepmc2 zlib rsync lhapdf ];
+  buildInputs = [ boost fastjet hepmc zlib rsync lhapdf ];
 
   preConfigure = ''
     patchShebangs ./configure
@@ -17,9 +17,12 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
     "--enable-shared"
-    "--with-hepmc2=${hepmc2}"
     "--with-lhapdf6=${lhapdf}"
-  ];
+  ] ++ (if stdenv.lib.versions.major hepmc.version == "3" then [
+    "--with-hepmc3=${hepmc}"
+  ] else [
+    "--with-hepmc2=${hepmc}"
+  ]);
 
   enableParallelBuilding = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix b/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix
index c12526223938..1c17b318c9dc 100644
--- a/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = {
-    description = "QCDNUM is a very fast QCD evolution program written in FORTRAN77";
+    description = "A very fast QCD evolution program written in FORTRAN77";
     license     = stdenv.lib.licenses.gpl3;
     homepage    = "https://www.nikhef.nl/~h24/qcdnum/index.html";
     platforms   = stdenv.lib.platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix b/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix
index abf37def8c3f..f95328964bfb 100644
--- a/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "rivet";
-  version = "3.1.2";
+  version = "3.1.3";
 
   src = fetchurl {
     url = "https://www.hepforge.org/archive/rivet/Rivet-${version}.tar.bz2";
-    sha256 = "0yjpx7n6ry3pfgkf7d7v7mcc3yv7681kf8nq2b1fgspl8jbd0hf0";
+    sha256 = "08g0f84l7r6vm4n7gn36qi3bzacscpv061m9xar2572vf10wxpak";
   };
 
   patches = [
diff --git a/nixpkgs/pkgs/development/libraries/physics/yoda/default.nix b/nixpkgs/pkgs/development/libraries/physics/yoda/default.nix
index 1a8d5a6fd390..39bffb65237e 100644
--- a/nixpkgs/pkgs/development/libraries/physics/yoda/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/yoda/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "yoda";
-  version = "1.8.3";
+  version = "1.8.5";
 
   src = fetchurl {
     url = "https://www.hepforge.org/archive/yoda/YODA-${version}.tar.bz2";
-    sha256 = "12msmjiajvy2xj2m64n2fxblai5xg06a829wi7scsc7nw2jhxpfr";
+    sha256 = "1z9jmabsaddhs003zzq73fpq2absd12rnc2sa5qn45zwf62nnbjc";
   };
 
   nativeBuildInputs = with python.pkgs; [ cython makeWrapper ];
@@ -39,5 +39,7 @@ stdenv.mkDerivation rec {
     homepage    = "https://yoda.hepforge.org";
     platforms   = stdenv.lib.platforms.unix;
     maintainers = with stdenv.lib.maintainers; [ veprbl ];
+    # https://gitlab.com/hepcedar/yoda/-/issues/24
+    broken      = withRootSupport;
   };
 }