From 2f23d603232834dbe6d15bd8e897477d62ded25e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Wed, 4 Jan 2017 04:59:06 +0000 Subject: [PATCH 1/5] sherpa: fix sqlite dependency --- pkgs/applications/science/physics/sherpa/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/science/physics/sherpa/default.nix b/pkgs/applications/science/physics/sherpa/default.nix index d863964ad90..c674c0cbb2f 100644 --- a/pkgs/applications/science/physics/sherpa/default.nix +++ b/pkgs/applications/science/physics/sherpa/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + configureFlags = "--with-sqlite3=${sqlite.dev}"; + meta = { description = "Simulation of High-Energy Reactions of PArticles in lepton-lepton, lepton-photon, photon-photon, lepton-hadron and hadron-hadron collisions"; license = stdenv.lib.licenses.gpl2; From 0f71012fe6448f4e31e464659cc266fa8f980891 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 7 Jan 2017 01:36:51 -0500 Subject: [PATCH 2/5] sherpa: add useful dependencies --- .../science/physics/sherpa/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/science/physics/sherpa/default.nix b/pkgs/applications/science/physics/sherpa/default.nix index c674c0cbb2f..e815ddfc1c2 100644 --- a/pkgs/applications/science/physics/sherpa/default.nix +++ b/pkgs/applications/science/physics/sherpa/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, gfortran, sqlite }: +{ stdenv, fetchurl, gfortran, hepmc, fastjet, lhapdf, rivet, sqlite }: stdenv.mkDerivation rec { name = "sherpa-${version}"; @@ -9,11 +9,19 @@ stdenv.mkDerivation rec { sha256 = "13vkz6w8kqyv8sgy3mxnlps5ykml5rnlj50vjj0pp9rgbl5y8ali"; }; - buildInputs = [ gfortran sqlite ]; + buildInputs = [ gfortran sqlite lhapdf rivet ]; enableParallelBuilding = true; - configureFlags = "--with-sqlite3=${sqlite.dev}"; + configureFlags = [ + "--with-sqlite3=${sqlite.dev}" + "--enable-hepmc2=${hepmc}" + "--enable-fastjet=${fastjet}" + "--enable-lhapdf=${lhapdf}" + "--enable-rivet=${rivet}" + ]; + + CXXFLAGS = "-std=c++11"; # needed for rivet on OSX meta = { description = "Simulation of High-Energy Reactions of PArticles in lepton-lepton, lepton-photon, photon-photon, lepton-hadron and hadron-hadron collisions"; From 44a78fb0da4d9fb4c0c8f7bd4bcf8649a751693e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 7 Jan 2017 03:00:04 -0500 Subject: [PATCH 3/5] rivet: fix runtime on darwin --- .../libraries/physics/rivet/darwin.patch | 33 +++++++++++++++++++ .../libraries/physics/rivet/default.nix | 4 +++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/development/libraries/physics/rivet/darwin.patch diff --git a/pkgs/development/libraries/physics/rivet/darwin.patch b/pkgs/development/libraries/physics/rivet/darwin.patch new file mode 100644 index 00000000000..2d397f1da6c --- /dev/null +++ b/pkgs/development/libraries/physics/rivet/darwin.patch @@ -0,0 +1,33 @@ +diff --git a/include/Rivet/Tools/osdir.hh b/include/Rivet/Tools/osdir.hh +index 05f06ca..59af7de 100644 +--- a/include/Rivet/Tools/osdir.hh ++++ b/include/Rivet/Tools/osdir.hh +@@ -21,7 +21,7 @@ + + /// @cond OSDIR + +-#if defined(unix) || defined(__unix) || defined(__unix__) ++#if defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + #define OSLINK_OSDIR_POSIX + #elif defined(_WIN32) + #define OSLINK_OSDIR_WINDOWS +@@ -32,18 +32,7 @@ + #include + + #if defined(OSLINK_OSDIR_NOTSUPPORTED) +- +-namespace oslink +-{ +- class directory +- { +- public: +- directory(const std::string&) { } +- operator void*() const { return (void*)0; } +- std::string next() { return ""; } +- }; +-} +- ++#error Platform misdetected or oslink is not implemented + #elif defined(OSLINK_OSDIR_POSIX) + + #include diff --git a/pkgs/development/libraries/physics/rivet/default.nix b/pkgs/development/libraries/physics/rivet/default.nix index 91b5881d1a8..a82c14fee77 100644 --- a/pkgs/development/libraries/physics/rivet/default.nix +++ b/pkgs/development/libraries/physics/rivet/default.nix @@ -13,6 +13,10 @@ stdenv.mkDerivation rec { pythonPath = []; # python wrapper support + patches = [ + ./darwin.patch # configure relies on impure sw_vers to -Dunix + ]; + latex = texlive.combine { inherit (texlive) scheme-basic collection-pstricks From bbc3082ebd38245bede3505d248a75272e02b7bb Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 8 Jan 2017 21:16:52 -0500 Subject: [PATCH 4/5] mcgrid: pkgconfig is the only way to locate mcgrid --- pkgs/development/libraries/physics/mcgrid/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/physics/mcgrid/default.nix b/pkgs/development/libraries/physics/mcgrid/default.nix index 033bf2f214f..aabe132e73b 100644 --- a/pkgs/development/libraries/physics/mcgrid/default.nix +++ b/pkgs/development/libraries/physics/mcgrid/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, fastnlo, rivet, sherpa }: +{ stdenv, fetchurl, fastnlo, rivet, pkgconfig, sherpa }: stdenv.mkDerivation rec { name = "mcgrid-${version}"; @@ -10,6 +10,7 @@ stdenv.mkDerivation rec { }; buildInputs = [ fastnlo rivet ]; + propagatedNativeBuildInputs = [ pkgconfig ]; preConfigure = '' substituteInPlace mcgrid.pc.in \ From f7173a9187ceb907a63b5e9a458c746ec055a3b3 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Mon, 9 Jan 2017 02:24:27 -0500 Subject: [PATCH 5/5] fastnlo: fix yoda interface --- pkgs/development/libraries/physics/fastnlo/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/libraries/physics/fastnlo/default.nix b/pkgs/development/libraries/physics/fastnlo/default.nix index 70368133706..307bf1b27db 100644 --- a/pkgs/development/libraries/physics/fastnlo/default.nix +++ b/pkgs/development/libraries/physics/fastnlo/default.nix @@ -11,6 +11,12 @@ stdenv.mkDerivation rec { buildInputs = [ boost lhapdf root yoda ]; + CXXFLAGS="-std=c++11"; # for yoda + + configureFlags = [ + "--with-yoda=${yoda}" + ]; + enableParallelBuilding = true; meta = {