about summary refs log tree commit diff
path: root/pkgs/development/libraries/physics
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2016-06-11 14:38:24 -0400
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2016-10-18 06:51:59 -0400
commit75ed9ac975645d72e6d494ef81296b83b8855e41 (patch)
treec70826c6c8b5e7c5f2b145b2327fa14e3057a774 /pkgs/development/libraries/physics
parentb7db7cc30ca80cbf54ef6c69f155e74916e2f629 (diff)
hepmc: init at 2.06.09
Diffstat (limited to 'pkgs/development/libraries/physics')
-rw-r--r--pkgs/development/libraries/physics/hepmc/default.nix28
-rw-r--r--pkgs/development/libraries/physics/hepmc/in_source.patch25
2 files changed, 53 insertions, 0 deletions
diff --git a/pkgs/development/libraries/physics/hepmc/default.nix b/pkgs/development/libraries/physics/hepmc/default.nix
new file mode 100644
index 0000000000000..ece19950174a8
--- /dev/null
+++ b/pkgs/development/libraries/physics/hepmc/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "hepmc-${version}";
+  version = "2.06.09";
+
+  src = fetchurl {
+    url = "http://lcgapp.cern.ch/project/simu/HepMC/download/HepMC-${version}.tar.gz";
+    sha256 = "020sc7hzy7d6d1i6bs352hdzy5zy5zxkc33cw0jhh8s0jz5281y6";
+  };
+
+  patches = [ ./in_source.patch ];
+  buildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-Dmomentum:STRING=GEV"
+    "-Dlength:STRING=MM"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "The HepMC package is an object oriented event record written in C++ for High Energy Physics Monte Carlo Generators";
+    license     = stdenv.lib.licenses.gpl2;
+    homepage    = http://lcgapp.cern.ch/project/simu/HepMC/;
+    platforms   = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/physics/hepmc/in_source.patch b/pkgs/development/libraries/physics/hepmc/in_source.patch
new file mode 100644
index 0000000000000..836a565586916
--- /dev/null
+++ b/pkgs/development/libraries/physics/hepmc/in_source.patch
@@ -0,0 +1,25 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -37,21 +37,6 @@ message(STATUS "default momentum and length are ${HEPMC_DEFAULT_MOM_UNIT} ${HEPM
+ # find the HepMC cmake modules
+ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules ${CMAKE_MODULE_PATH})
+ 
+-# make sure we are not building from within the source code directory
+-string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" in_source)
+-string( REGEX MATCH "${CMAKE_SOURCE_DIR}/" in_source_subdir
+-"${CMAKE_BINARY_DIR}")
+-if (in_source OR in_source_subdir)
+-  message(FATAL_ERROR "
+-ERROR: In source builds of this project are not allowed.
+-A separate build directory is required.
+-Please create one and run cmake from the build directory.
+-Also note that cmake has just added files to your source code directory.
+-We suggest getting a new copy of the source code.
+-Otherwise, delete `CMakeCache.txt' and the directory `CMakeFiles'.
+-  ")
+-endif ()
+-
+ # build_docs is OFF (false) by default
+ if ( build_docs )
+    message(STATUS "documents WILL be built and installed" )