git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #9499 from khumba/scilab-bin-5

scilab-bin: init at 5.5.2

commit154af9e67daccec2d008f512f5eb050703e6cd45 authorRobin Gloster <mail@glob.in> dateThu 28 Jul 2016, 16:43 (10 years ago) parentbddec68ed07159
2 files changed+77
pkgs/applications/science/math/scilab-bin/default.nix+75 pkgs/top-level/all-packages.nix+2
pkgs/applications/science/math/scilab-bin/default.nixnew file+75
@@ -0,0 +1,75 @@
1+{ stdenv, fetchurl, lib, xlibs }:
2+
3+let
4+ name = "scilab-bin-${ver}";
5+
6+ ver = "5.5.2";
7+
8+ majorVer = builtins.elemAt (lib.splitString "." ver) 0;
9+
10+ badArch = throw "${name} requires i686-linux or x86_64-linux";
11+
12+ architecture =
13+ if stdenv.system == "i686-linux" then
14+ "i686"
15+ else if stdenv.system == "x86_64-linux" then
16+ "x86_64"
17+ else
18+ badArch;
19+in
20+stdenv.mkDerivation rec {
21+ inherit name;
22+
23+ src = fetchurl {
24+ url = "http://www.scilab.org/download/${ver}/scilab-${ver}.bin.linux-${architecture}.tar.gz";
25+ sha256 =
26+ if stdenv.system == "i686-linux" then
27+ "6143a95ded40411a35630a89b365875a6526cd4db1e2865ac5612929a7db937a"
28+ else if stdenv.system == "x86_64-linux" then
29+ "c0dd7a5f06ec7a1df7a6b1b8b14407ff7f45e56821dff9b3c46bd09d4df8d350"
30+ else
31+ badArch;
32+ };
33+
34+ libPath = lib.makeLibraryPath [
35+ stdenv.cc.cc
36+ xlibs.libX11
37+ xlibs.libXext
38+ xlibs.libXi
39+ xlibs.libXrender
40+ xlibs.libXtst
41+ xlibs.libXxf86vm
42+ ];
43+
44+ phases = [ "unpackPhase" "fixupPhase" "installPhase" ];
45+
46+ fixupPhase = ''
47+ sed -i 's|\$(/bin/|$(|g' bin/scilab
48+ sed -i 's|/usr/bin/||g' bin/scilab
49+
50+ sci="$out/opt/scilab-${ver}"
51+ fullLibPath="$sci/lib/scilab:$sci/lib/thirdparty:$libPath"
52+ fullLibPath="$fullLibPath:$sci/lib/thirdparty/redist"
53+
54+ patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
55+ --set-rpath "$fullLibPath" bin/scilab-bin
56+ find . -name '*.so' -type f | while read file; do
57+ patchelf --set-rpath "$fullLibPath" "$file" 2>/dev/null
58+ done
59+ '';
60+
61+ installPhase = ''
62+ mkdir -p "$out/opt/scilab-${ver}"
63+ cp -r . "$out/opt/scilab-${ver}/"
64+ mkdir "$out/bin"
65+ ln -s "$out/opt/scilab-${ver}/bin/scilab" "$out/bin/scilab-${ver}"
66+ ln -s "scilab-${ver}" "$out/bin/scilab-${majorVer}"
67+ '';
68+
69+ meta = {
70+ homepage = http://www.scilab.org/;
71+ description = "Scientific software package for numerical computations (Matlab lookalike)";
72+ # see http://www.scilab.org/legal_notice
73+ license = "Scilab";
74+ };
75+}
pkgs/top-level/all-packages.nix+2
@@ -16834,6 +16834,8 @@ in
1683416834 withX = true;
1683516835 };
1683616836
16837+ scilab-bin = callPackage ../applications/science/math/scilab-bin {};
16838+
1683716839 scotch = callPackage ../applications/science/math/scotch { };
1683816840
1683916841 msieve = callPackage ../applications/science/math/msieve { };