nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix

70 lines
1.9 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, gfortran, gnumake, imake, makedepend, motif, xorg }:
2017-05-28 11:41:09 +01:00
stdenv.mkDerivation rec {
version = "2006";
pname = "cernlib";
2017-05-28 11:41:09 +01:00
src = fetchurl {
2020-01-23 20:03:34 +00:00
urls = [
"https://ftp.riken.jp/cernlib/download/${version}_source/tar/${version}_src.tar.gz"
"https://cernlib.web.cern.ch/cernlib/download/${version}_source/tar/${version}_src.tar.gz"
];
2017-05-28 11:41:09 +01:00
sha256 = "0awla1rl96z82br7slcmg8ks1d2a7slk6dj79ywb871j2ksi3fky";
};
buildInputs = with xorg; [ gfortran motif libX11 libXft libXt ];
nativeBuildInputs = [ gnumake imake makedepend ];
sourceRoot = ".";
2020-08-11 12:02:04 +01:00
patches = [ ./patch.patch ./0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch ];
2017-05-28 11:41:09 +01:00
postPatch = ''
substituteInPlace 2006/src/config/site.def \
--replace "# define MakeCmd gmake" "# define MakeCmd make"
substituteInPlace 2006/src/config/lnxLib.rules \
--replace "# lib" "// lib"
2017-05-28 11:41:09 +01:00
'';
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";
2017-05-28 11:41:09 +01:00
description = "Legacy collection of libraries and modules for data analysis in high energy physics";
broken = stdenv.isDarwin;
2018-12-10 14:05:22 +00:00
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
maintainers = with lib.maintainers; [ veprbl ];
license = lib.licenses.gpl2;
2017-05-28 11:41:09 +01:00
};
}