nixpkgs/pkgs/by-name/ce/cernlib/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
1.8 KiB
Nix
Raw Normal View History

2024-08-22 19:59:34 +01:00
{
lib,
stdenv,
fetchpatch,
fetchurl,
cmake,
freetype,
gfortran,
openssl,
libnsl,
motif,
xorg,
libxcrypt,
}:
2017-05-28 11:41:09 +01:00
stdenv.mkDerivation rec {
2024-08-22 19:59:34 +01:00
version = "2024.06.12.0";
pname = "cernlib";
2024-08-22 19:59:34 +01:00
year = lib.versions.major version;
2017-05-28 11:41:09 +01:00
src = fetchurl {
2020-01-23 20:03:34 +00:00
urls = [
2024-08-22 19:59:34 +01:00
"https://ftp.riken.jp/cernlib/download/${year}_source/tar/cernlib-cernlib-${version}-free.tar.gz"
"https://cernlib.web.cern.ch/download/${year}_source/tar/cernlib-cernlib-${version}-free.tar.gz"
2020-01-23 20:03:34 +00:00
];
2024-08-22 19:59:34 +01:00
hash = "sha256-SEFgQjPBkmRoaMD/7yXiXO9DZNrRhqZ01kptSDQur84=";
2017-05-28 11:41:09 +01:00
};
2024-08-22 19:59:34 +01:00
patches = [
(fetchpatch {
url = "https://github.com/user-attachments/files/16832928/geant321-fix-weak-alias-on-darwin.patch";
hash = "sha256-YzaUh4rJBszGdp5s/HDQMI5qQhCGrTt9P6XCgZOFn1I=";
})
];
2017-05-28 11:41:09 +01:00
postPatch = ''
2024-08-22 19:59:34 +01:00
substituteInPlace CMakeLists.txt \
--replace-fail "find_program ( SED NAMES gsed" "find_program ( SED NAMES sed"
2017-05-28 11:41:09 +01:00
'';
2024-08-22 19:59:34 +01:00
# gfortran warning's on iframework messes with CMake's check_fortran_compiler_flag
# see also https://github.com/NixOS/nixpkgs/issues/27218
preConfigure = ''
2024-08-22 19:59:34 +01:00
export NIX_CFLAGS_COMPILE="$(echo $NIX_CFLAGS_COMPILE | sed 's|-iframework [^ ]*||g')"
2017-05-28 11:41:09 +01:00
'';
2024-08-22 19:59:34 +01:00
nativeBuildInputs = [ cmake ];
buildInputs = with xorg; [
freetype
gfortran
openssl
libX11
libXaw
libXft
libXt
libxcrypt
motif
] ++ lib.optional stdenv.hostPlatform.isLinux libnsl;
2017-05-28 11:41:09 +01:00
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";
2024-08-22 19:59:34 +01:00
platforms = [
"aarch64-linux"
"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
};
}