summary refs log tree commit diff
path: root/pkgs/development/libraries/physics/cernlib/default.nix
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2017-05-28 06:41:09 -0400
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2017-05-28 18:51:16 -0400
commit6e95e2a1613389dd0c5ec24fc046942834670ade (patch)
tree0080651fa4d24f67c64bd928ca11d7e0db7fa929 /pkgs/development/libraries/physics/cernlib/default.nix
parentd0f2361bc1ffdff631fc7ebb9c2ec1b08b135898 (diff)
downloadnixpkgs-6e95e2a1613389dd0c5ec24fc046942834670ade.tar
nixpkgs-6e95e2a1613389dd0c5ec24fc046942834670ade.tar.gz
nixpkgs-6e95e2a1613389dd0c5ec24fc046942834670ade.tar.bz2
nixpkgs-6e95e2a1613389dd0c5ec24fc046942834670ade.tar.lz
nixpkgs-6e95e2a1613389dd0c5ec24fc046942834670ade.tar.xz
nixpkgs-6e95e2a1613389dd0c5ec24fc046942834670ade.tar.zst
nixpkgs-6e95e2a1613389dd0c5ec24fc046942834670ade.zip
cernlib: init at 2006
Diffstat (limited to 'pkgs/development/libraries/physics/cernlib/default.nix')
-rw-r--r--pkgs/development/libraries/physics/cernlib/default.nix63
1 files changed, 63 insertions, 0 deletions
diff --git a/pkgs/development/libraries/physics/cernlib/default.nix b/pkgs/development/libraries/physics/cernlib/default.nix
new file mode 100644
index 00000000000..dad138c8433
--- /dev/null
+++ b/pkgs/development/libraries/physics/cernlib/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchurl, gfortran, gnumake, imake, makedepend, motif, xorg }:
+
+stdenv.mkDerivation rec {
+  version = "2006";
+  name = "cernlib-${version}";
+
+  src = fetchurl {
+    url = "http://cernlib.web.cern.ch/cernlib/download/${version}_source/tar/${version}_src.tar.gz";
+    sha256 = "0awla1rl96z82br7slcmg8ks1d2a7slk6dj79ywb871j2ksi3fky";
+  };
+
+  buildInputs = with xorg; [ gfortran motif libX11 libXft libXt ];
+  nativeBuildInputs = [ gnumake imake makedepend ];
+  sourceRoot = ".";
+
+  patches = [ ./patch ];
+
+  postPatch = ''
+    substituteInPlace 2006/src/config/site.def \
+      --replace "# define MakeCmd gmake" "# define MakeCmd make"
+  '';
+
+  configurePhase = ''
+    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
+  '';
+
+  buildPhase = ''
+    cd $CERN_ROOT
+    mkdir -p build bin lib
+
+    cd $CERN_ROOT/build
+    $CVSCOSRC/config/imake_boot
+    make bin/kuipc
+    make scripts/Makefile
+    pushd scripts
+    make install.bin
+    popd
+    make
+  '';
+
+  installPhase = ''
+    mkdir "$out"
+    cp -r "$CERN_ROOT/bin" "$out"
+    cp -r "$CERN_ROOT/lib" "$out"
+    mkdir "$out/$CERN_LEVEL"
+    ln -s "$out/bin" "$out/$CERN_LEVEL/bin"
+    ln -s "$out/lib" "$out/$CERN_LEVEL/lib"
+  '';
+
+  setupHook = ./setup-hook.sh;
+
+  meta = {
+    homepage = http://cernlib.web.cern.ch;
+    description = "Legacy collection of libraries and modules for data analysis in high energy physics";
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+    license = stdenv.lib.licenses.gpl2;
+  };
+}