about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/biology/iv/default.nix
blob: 82fe36940081b7be8d3b76a8546036d5209737ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ stdenv, fetchurl, neuron-version
, libX11, libXext, patchelf
}:

stdenv.mkDerivation rec
  { name = "iv-19";
    src = fetchurl
      { url = "https://www.neuron.yale.edu/ftp/neuron/versions/v${neuron-version}/${name}.tar.gz";
        sha256 = "07a3g8zzay4h0bls7fh89dd0phn7s34c2g15pij6dsnwpmjg06yx";
      };
    nativeBuildInputs = [ patchelf ];
    buildInputs = [ libXext ];
    propagatedBuildInputs = [ libX11 ];
    hardeningDisable = [ "format" ];
    postInstall = ''
      for dir in $out/*; do # */
        if [ -d $dir/lib ]; then
	  mv $dir/* $out # */
          rmdir $dir
          break
        fi
      done
    '' + stdenv.lib.optionalString stdenv.isLinux ''
      patchelf --add-needed ${libX11}/lib/libX11.so $out/lib/libIVhines.so
    '';
    meta = with stdenv.lib;
      { description = "InterViews graphical library for Neuron";
        license     = licenses.bsd3;
        homepage    = "http://www.neuron.yale.edu/neuron";
        platforms   = platforms.all;
      };
  }