Files
nixpkgs/pkgs/by-name/ne/nest/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

92 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
testers,
cmake,
gsl,
libtool,
findutils,
llvmPackages,
mpi,
nest,
pkg-config,
boost,
python3,
readline,
withPython ? false,
withMpi ? false,
}:
stdenv.mkDerivation rec {
pname = "nest";
version = "3.9";
src = fetchFromGitHub {
owner = "nest";
repo = "nest-simulator";
rev = "v${version}";
hash = "sha256-4tGLRAsJLOHl9frdo35p/uoTiT2zfstx1e+fv5+ZBCs=";
};
postPatch = ''
patchShebangs cmake/CheckFiles/check_return_val.sh
# fix PyNEST installation path
# it expects CMAKE_INSTALL_LIBDIR to be relative
substituteInPlace cmake/ProcessOptions.cmake \
--replace "\''${CMAKE_INSTALL_LIBDIR}/python" "lib/python"
'';
nativeBuildInputs = [
cmake
pkg-config
findutils
];
buildInputs = [
gsl
readline
libtool # libltdl
boost
]
++ lib.optionals withPython [
python3
python3.pkgs.cython
]
++ lib.optional withMpi mpi
++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
propagatedBuildInputs = with python3.pkgs; [
numpy
];
cmakeFlags = [
"-Dwith-python=${if withPython then "ON" else "OFF"}"
"-Dwith-mpi=${if withMpi then "ON" else "OFF"}"
"-Dwith-openmp=ON"
];
postInstall = ''
# Alternative to autoPatchElf, moves libraries where
# Nest expects them to be
find $out/lib/nest -exec ln -s {} $out/lib \;
'';
passthru.tests.version = testers.testVersion {
package = nest;
command = "nest --version";
};
meta = {
description = "Command line tool for simulating neural networks";
homepage = "https://www.nest-simulator.org/";
changelog = "https://github.com/nest/nest-simulator/releases/tag/v${version}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [
jiegec
davidcromp
];
platforms = lib.platforms.unix;
};
}