summary refs log tree commit diff
path: root/pkgs/applications/science/math/scilab/default.nix
blob: 6063a45a3efb569668f85d765d1cf8a2995c0697 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{stdenv, fetchurl, lib, gfortran
, ncurses
, withXaw3d ? false
#, withPVMlib ? false
, tcl, tk, withTk ? false
, gtk2, withGtk ? false # working ?
#, withF2c ? false
, ocaml, withOCaml ? false
#, withJava ? false
#, atlasMath, withAtlas ? false
, xlibsWrapper, withX ? false
}:

stdenv.mkDerivation rec {
  version = "4.1.2";
  name = "scilab-${version}";
  src = fetchurl {
    url = "https://www.scilab.org/download/${version}/${name}-src.tar.gz";
    sha256 = "1adk6jqlj7i3gjklvlf1j3il1nb22axnp4rvwl314an62siih0sc";
  };

  buildInputs = [gfortran ncurses]
  ++ lib.optionals withGtk [gtk2]
  ++ lib.optionals withOCaml [ocaml]
  ++ lib.optional withX xlibsWrapper
  ;


/*
  --with-atlas-library=DIR  Atlas library files are in DIR and we use Atlas
*/
  configureFlags = ""
  # use gcc C compiler and gnu Fortran compiler (g77 or gfortran)
  + " --with-gcc --with-g77"
  # use Xaw3d widgets given with Scilab
  + (lib.optionalString (!withXaw3d) " --with-local-xaw")
  # do not compile with PVM library
  + " --without-pvm"
  # compile with GTK
  + (if withGtk then "
       --with-gtk --with-gtk2
    " else "
       --without-gtk --without-gtk2
    ")
  # compile with TCL/TK
  + (lib.optionalString withTk "
       --with-tk
       --with-tcl-library=${tcl}/lib
       --with-tcl-include=${tcl}/include
       --with-tk-library=${tk}/lib
       --with-tk-include=${tk}/include
    ")
  # do not use Gtk widgets
  + " --without-gtk --without-gtk2"
  # compile with ocaml
  + (if withOCaml then " --with-ocaml" else " --without-ocaml")
  # do not compile Java interface
  + " --without-java"
  # use the X Window System
  + lib.optionalString withX "--with-x"
  ;

  makeFlags = "all";

  meta = {
    homepage = http://www.scilab.org/;
    description = "Scientific software package for numerical computations (Matlab lookalike)";
    # see http://www.scilab.org/legal
    license = "SciLab";
    broken = true;
  };
}