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 3 , pkgconfig 4 , automake 5 , autoconf ··· 7 , ncurses 8 , readline 9 , which 10 - , python ? null 11 , mpi ? null 12 }: 13 14 stdenv.mkDerivation rec { 15 name = "neuron-${version}"; 16 version = "7.4"; 17 - 18 nativeBuildInputs = [ which pkgconfig automake autoconf libtool ]; 19 buildInputs = [ ncurses readline python mpi ]; 20 ··· 25 26 patches = (stdenv.lib.optional (stdenv.isDarwin) [ ./neuron-carbon-disable.patch ]); 27 28 enableParallelBuilding = true; 29 30 ## neuron install by default everything under prefix/${host_arch}/* 31 - ## override this to support nix standard file hierarchy 32 ## without issues: install everything under prefix/ 33 preConfigure = '' 34 ./build.sh 35 - export prefix="''${prefix} --exec-prefix=''${out}" 36 ''; 37 38 configureFlags = with stdenv.lib; 39 [ "--without-x" "--with-readline=${readline}" ] 40 ++ optionals (python != null) [ "--with-nrnpython=${python.interpreter}" ] 41 - ++ (if mpi != null then ["--with-mpi" "--with-paranrn"] 42 else ["--without-mpi"]); 43 - 44 - 45 postInstall = stdenv.lib.optionals (python != null) [ '' 46 ## standardise python neuron install dir if any 47 if [[ -d $out/lib/python ]]; then ··· 49 mv ''${out}/lib/python/* ''${out}/${python.sitePackages}/ 50 fi 51 '']; 52 - 53 - propagatedBuildInputs = [ readline ncurses which libtool ]; 54 55 meta = with stdenv.lib; { 56 description = "Simulation environment for empirically-based simulations of neurons and networks of neurons"; 57 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, 62 involving many ion-specific channels, ion accumulation, and second messengers"; 63 64 license = licenses.bsd3; 65 homepage = http://www.neuron.yale.edu/neuron; 66 maintainers = [ maintainers.adev ]; 67 platforms = platforms.all; 68 - }; 69 } 70
··· 1 + { stdenv 2 + , fetchurl 3 , pkgconfig 4 , automake 5 , autoconf ··· 7 , ncurses 8 , readline 9 , which 10 + , python ? null 11 , mpi ? null 12 }: 13 14 stdenv.mkDerivation rec { 15 name = "neuron-${version}"; 16 version = "7.4"; 17 + 18 nativeBuildInputs = [ which pkgconfig automake autoconf libtool ]; 19 buildInputs = [ ncurses readline python mpi ]; 20 ··· 25 26 patches = (stdenv.lib.optional (stdenv.isDarwin) [ ./neuron-carbon-disable.patch ]); 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 + 37 enableParallelBuilding = true; 38 39 ## neuron install by default everything under prefix/${host_arch}/* 40 + ## override this to support nix standard file hierarchy 41 ## without issues: install everything under prefix/ 42 preConfigure = '' 43 ./build.sh 44 + export prefix="''${prefix} --exec-prefix=''${out}" 45 ''; 46 47 configureFlags = with stdenv.lib; 48 [ "--without-x" "--with-readline=${readline}" ] 49 ++ optionals (python != null) [ "--with-nrnpython=${python.interpreter}" ] 50 + ++ (if mpi != null then ["--with-mpi" "--with-paranrn"] 51 else ["--without-mpi"]); 52 + 53 + 54 postInstall = stdenv.lib.optionals (python != null) [ '' 55 ## standardise python neuron install dir if any 56 if [[ -d $out/lib/python ]]; then ··· 58 mv ''${out}/lib/python/* ''${out}/${python.sitePackages}/ 59 fi 60 '']; 61 + 62 + propagatedBuildInputs = [ readline ncurses which libtool ]; 63 64 meta = with stdenv.lib; { 65 description = "Simulation environment for empirically-based simulations of neurons and networks of neurons"; 66 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, 71 involving many ion-specific channels, ion accumulation, and second messengers"; 72 73 license = licenses.bsd3; 74 homepage = http://www.neuron.yale.edu/neuron; 75 maintainers = [ maintainers.adev ]; 76 platforms = platforms.all; 77 + }; 78 } 79