mkKdeDerivation: provide proper stdenv when asked for (#371444)
[NixPkgs.git] / pkgs / applications / science / biology / nest / default.nix
blob3026ac9ce8859a28ff351c92b50cb01486f62f6d
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   testers,
6   cmake,
7   gsl,
8   libtool,
9   findutils,
10   llvmPackages,
11   mpi,
12   nest,
13   pkg-config,
14   boost,
15   python3,
16   readline,
17   withPython ? false,
18   withMpi ? false,
21 stdenv.mkDerivation rec {
22   pname = "nest";
23   version = "3.8";
25   src = fetchFromGitHub {
26     owner = "nest";
27     repo = "nest-simulator";
28     rev = "v${version}";
29     hash = "sha256-hysOe1ZZpCClVOGo0+UeCP7imAakXrZlnJ4V95zfiyA=";
30   };
32   postPatch = ''
33     patchShebangs cmake/CheckFiles/check_return_val.sh
34     # fix PyNEST installation path
35     # it expects CMAKE_INSTALL_LIBDIR to be relative
36     substituteInPlace cmake/ProcessOptions.cmake \
37       --replace "\''${CMAKE_INSTALL_LIBDIR}/python" "lib/python"
38   '';
40   nativeBuildInputs = [
41     cmake
42     pkg-config
43     findutils
44   ];
46   buildInputs =
47     [
48       gsl
49       readline
50       libtool # libltdl
51       boost
52     ]
53     ++ lib.optionals withPython [
54       python3
55       python3.pkgs.cython
56     ]
57     ++ lib.optional withMpi mpi
58     ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
60   propagatedBuildInputs = with python3.pkgs; [
61     numpy
62   ];
64   cmakeFlags = [
65     "-Dwith-python=${if withPython then "ON" else "OFF"}"
66     "-Dwith-mpi=${if withMpi then "ON" else "OFF"}"
67     "-Dwith-openmp=ON"
68   ];
70   postInstall = ''
71     # Alternative to autoPatchElf, moves libraries where
72     # Nest expects them to be
73     find $out/lib/nest -exec ln -s {} $out/lib \;
74   '';
76   passthru.tests.version = testers.testVersion {
77     package = nest;
78     command = "nest --version";
79   };
81   meta = with lib; {
82     description = "NEST is a command line tool for simulating neural networks";
83     homepage = "https://www.nest-simulator.org/";
84     changelog = "https://github.com/nest/nest-simulator/releases/tag/v${version}";
85     license = licenses.gpl2Plus;
86     maintainers = with maintainers; [
87       jiegec
88       davidcromp
89     ];
90     platforms = platforms.unix;
91   };