1{
2 lib,
3 stdenv,
4 fetchurl,
5 jre,
6 makeWrapper,
7 replaceVars,
8 coreutils,
9}:
10
11stdenv.mkDerivation rec {
12 pname = "cytoscape";
13 version = "3.10.3";
14
15 src = fetchurl {
16 url = "https://github.com/cytoscape/cytoscape/releases/download/${version}/${pname}-unix-${version}.tar.gz";
17 sha256 = "sha256-62i3F6uGNoC8z55iUIYQDAimWcQocsZ52USdpruZRLQ=";
18 };
19
20 patches = [
21 # By default, gen_vmoptions.sh tries to store custom options in $out/share
22 # at run time. This patch makes sure $HOME is used instead.
23 (replaceVars ./gen_vmoptions_to_homedir.patch {
24 inherit coreutils;
25 })
26 ];
27
28 nativeBuildInputs = [ makeWrapper ];
29 buildInputs = [ jre ];
30
31 installPhase = ''
32 mkdir -pv $out/{share,bin}
33 cp -Rv * $out/share/
34
35 ln -s $out/share/cytoscape.sh $out/bin/cytoscape
36
37 wrapProgram $out/share/cytoscape.sh \
38 --set JAVA_HOME "${jre}" \
39 --set JAVA "${jre}/bin/java"
40
41 chmod +x $out/bin/cytoscape
42 '';
43
44 meta = {
45 homepage = "http://www.cytoscape.org";
46 description = "General platform for complex network analysis and visualization";
47 mainProgram = "cytoscape";
48 license = lib.licenses.lgpl21;
49 maintainers = [ lib.maintainers.mimame ];
50 platforms = lib.platforms.unix;
51 };
52}