summary refs log tree commit diff
path: root/pkgs/development/compilers/fsharp/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/fsharp/default.nix')
-rw-r--r--pkgs/development/compilers/fsharp/default.nix33
1 files changed, 22 insertions, 11 deletions
diff --git a/pkgs/development/compilers/fsharp/default.nix b/pkgs/development/compilers/fsharp/default.nix
index bb9c6d75d44..99e893c79d1 100644
--- a/pkgs/development/compilers/fsharp/default.nix
+++ b/pkgs/development/compilers/fsharp/default.nix
@@ -1,18 +1,29 @@
-{ stdenv, fetchurl, mono, unzip, pkgconfig
- } :
+{ stdenv, fetchurl, mono, pkgconfig, autoconf, automake, which }:
+
 stdenv.mkDerivation rec {
-  pname = "fsharp";
-  date = "2011-08-10";
-  name = "${pname}-${date}";
+  name = "fsharp-${version}";
+  version = "3.1.1.25";
 
   src = fetchurl {
-    url = "http://download.mono-project.com/sources/fsharp/fsharp-cc126f2.zip";
-    sha256 = "03j2ypnfddl2zpvg8ivhafjy8dlz49b38rdy89l8c3irxdsb7k6i";
+    url = "https://github.com/fsharp/fsharp/archive/${version}.tar.gz";
+    sha256 = "1vrgw7qk4g78mjjapc1a1frribcgya4cdrwahv3i26z9s10g5h3d";
   };
 
-  buildInputs = [mono unzip pkgconfig];
+  buildInputs = [ mono pkgconfig autoconf automake which ];
+  configurePhase = ''
+    substituteInPlace ./autogen.sh --replace "/usr/bin/env sh" "/bin/sh"
+    ./autogen.sh --prefix $out
+  '';
 
-  sourceRoot = "fsharp";
+  # Make sure the executables use the right mono binary,
+  # and set up some symlinks for backwards compatibility.
+  postInstall = ''
+    substituteInPlace $out/bin/fsharpc --replace " mono " " ${mono}/bin/mono "
+    substituteInPlace $out/bin/fsharpi --replace " mono " " ${mono}/bin/mono "
+    substituteInPlace $out/bin/fsharpiAnyCpu --replace " mono " " ${mono}/bin/mono "
+    ln -s $out/bin/fsharpc $out/bin/fsc
+    ln -s $out/bin/fsharpi $out/bin/fsi
+  '';
 
   # To fix this error when running:
   # The file "/nix/store/path/whatever.exe" is an not a valid CIL image
@@ -20,9 +31,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "A functional CLI language";
-    homepage = "http://tryfsharp.org/";
+    homepage = "http://fsharp.org/";
     license = stdenv.lib.licenses.asl20;
-    maintainers = [ stdenv.lib.maintainers.raskin ];
+    maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ];
     platforms = with stdenv.lib.platforms; linux;
   };
 }