lol

neuron: fix on clang 3.8 and above

This is in preparation for upgrading Darwin stdenv to LLVM 4

+25 -16
+25 -16
pkgs/applications/science/biology/neuron/default.nix
··· 1 - { stdenv 2 - , fetchurl 1 + { stdenv 2 + , fetchurl 3 3 , pkgconfig 4 4 , automake 5 5 , autoconf ··· 7 7 , ncurses 8 8 , readline 9 9 , which 10 - , python ? null 10 + , python ? null 11 11 , mpi ? null 12 12 }: 13 13 14 14 stdenv.mkDerivation rec { 15 15 name = "neuron-${version}"; 16 16 version = "7.4"; 17 - 17 + 18 18 nativeBuildInputs = [ which pkgconfig automake autoconf libtool ]; 19 19 buildInputs = [ ncurses readline python mpi ]; 20 20 ··· 25 25 26 26 patches = (stdenv.lib.optional (stdenv.isDarwin) [ ./neuron-carbon-disable.patch ]); 27 27 28 + # With LLVM 3.8 and above, clang (really libc++) gets upset if you attempt to redefine these... 29 + postPatch = stdenv.lib.optionalString stdenv.cc.isClang '' 30 + substituteInPlace src/gnu/neuron_gnu_builtin.h \ 31 + --replace 'double abs(double arg);' "" \ 32 + --replace 'float abs(float arg);' "" \ 33 + --replace 'short abs(short arg);' "" \ 34 + --replace 'long abs(long arg);' "" 35 + ''; 36 + 28 37 enableParallelBuilding = true; 29 38 30 39 ## neuron install by default everything under prefix/${host_arch}/* 31 - ## override this to support nix standard file hierarchy 40 + ## override this to support nix standard file hierarchy 32 41 ## without issues: install everything under prefix/ 33 42 preConfigure = '' 34 43 ./build.sh 35 - export prefix="''${prefix} --exec-prefix=''${out}" 44 + export prefix="''${prefix} --exec-prefix=''${out}" 36 45 ''; 37 46 38 47 configureFlags = with stdenv.lib; 39 48 [ "--without-x" "--with-readline=${readline}" ] 40 49 ++ optionals (python != null) [ "--with-nrnpython=${python.interpreter}" ] 41 - ++ (if mpi != null then ["--with-mpi" "--with-paranrn"] 50 + ++ (if mpi != null then ["--with-mpi" "--with-paranrn"] 42 51 else ["--without-mpi"]); 43 - 44 - 52 + 53 + 45 54 postInstall = stdenv.lib.optionals (python != null) [ '' 46 55 ## standardise python neuron install dir if any 47 56 if [[ -d $out/lib/python ]]; then ··· 49 58 mv ''${out}/lib/python/* ''${out}/${python.sitePackages}/ 50 59 fi 51 60 '']; 52 - 53 - propagatedBuildInputs = [ readline ncurses which libtool ]; 61 + 62 + propagatedBuildInputs = [ readline ncurses which libtool ]; 54 63 55 64 meta = with stdenv.lib; { 56 65 description = "Simulation environment for empirically-based simulations of neurons and networks of neurons"; 57 66 58 - longDescription = "NEURON is a simulation environment for developing and exercising models of 59 - neurons and networks of neurons. It is particularly well-suited to problems where 60 - cable properties of cells play an important role, possibly including extracellular 61 - potential close to the membrane), and where cell membrane properties are complex, 67 + longDescription = "NEURON is a simulation environment for developing and exercising models of 68 + neurons and networks of neurons. It is particularly well-suited to problems where 69 + cable properties of cells play an important role, possibly including extracellular 70 + potential close to the membrane), and where cell membrane properties are complex, 62 71 involving many ion-specific channels, ion accumulation, and second messengers"; 63 72 64 73 license = licenses.bsd3; 65 74 homepage = http://www.neuron.yale.edu/neuron; 66 75 maintainers = [ maintainers.adev ]; 67 76 platforms = platforms.all; 68 - }; 77 + }; 69 78 } 70 79