about summary refs log tree commit diff
path: root/pkgs/development/interpreters/erlang/R16B02-8-basho.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/interpreters/erlang/R16B02-8-basho.nix')
-rw-r--r--pkgs/development/interpreters/erlang/R16B02-8-basho.nix74
1 files changed, 14 insertions, 60 deletions
diff --git a/pkgs/development/interpreters/erlang/R16B02-8-basho.nix b/pkgs/development/interpreters/erlang/R16B02-8-basho.nix
index fe24ad64bf83..89c97f5a0eb7 100644
--- a/pkgs/development/interpreters/erlang/R16B02-8-basho.nix
+++ b/pkgs/development/interpreters/erlang/R16B02-8-basho.nix
@@ -1,76 +1,38 @@
-{ stdenv, fetchurl, fetchFromGitHub, perl, gnum4, ncurses, openssl, autoconf264, gcc, erlang
-, gnused, gawk, makeWrapper
-, odbcSupport ? false, unixODBC ? null
-, wxSupport ? false, mesa ? null, wxGTK ? null, xorg ? null
-, enableDebugInfo ? false
-, Carbon ? null, Cocoa ? null }:
+{ pkgs, mkDerivation }:
 
-assert wxSupport -> mesa != null && wxGTK != null && xorg != null;
-assert odbcSupport -> unixODBC != null;
-
-with stdenv.lib;
-
-stdenv.mkDerivation rec {
-  name = "erlang-basho-" + version + "${optionalString odbcSupport "-odbc"}";
+mkDerivation rec {
+  baseName = "erlang";
   version = "16B02";
 
-  src = fetchFromGitHub {
+  src = pkgs.fetchFromGitHub {
     owner = "basho";
     repo = "otp";
     rev = "OTP_R16B02_basho8";
     sha256 = "1w0hbm0axxxa45v3kl6bywc9ayir5vwqxjpnjlzc616ldszb2m0x";
   };
 
-  debugInfo = enableDebugInfo;
-
-  buildInputs =
-    [ perl gnum4 ncurses openssl makeWrapper autoconf264 gcc
-    ] ++ optional wxSupport [ mesa wxGTK xorg.libX11 ]
-      ++ optional odbcSupport [ unixODBC ]
-      ++ optionals stdenv.isDarwin [ Carbon Cocoa ];
-
-  # Clang 4 (rightfully) thinks signed comparisons of pointers with NULL are nonsense
-  prePatch = ''
-    substituteInPlace lib/wx/c_src/wxe_impl.cpp --replace 'temp > NULL' 'temp != NULL'
-  '';
-
-  patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure.in erts/configure.in '';
-
-  postPatch = ''
-    patchSheBangs make
-  '';
-
   preConfigure = ''
     export HOME=$PWD/../
     export LANG=C
     export ERL_TOP=$(pwd)
     sed -e s@/bin/pwd@pwd@g -i otp_build
-    sed -e s@"/usr/bin/env escript"@${erlang}/bin/escript@g -i lib/diameter/bin/diameterc
-  '';
+    sed -e s@"/usr/bin/env escript"@$(pwd)/bootstrap/bin/escript@g -i lib/diameter/bin/diameterc
 
-  configureFlags= [
-    "--with-ssl=${openssl.dev}"
-    "--enable-smp-support"
-    "--enable-threads"
-    "--enable-kernel-poll"
-    "--disable-hipe"
-    "${optionalString odbcSupport "--with-odbc=${unixODBC}"}"
-    "${optionalString stdenv.isDarwin "--enable-darwin-64bit"}"
-    "${optionalString stdenv.isLinux "--enable-m64-build"}"
-  ];
-
-  buildPhase = ''
     ./otp_build autoconf
-    ./otp_build setup -a --prefix=$out $configureFlags
   '';
 
+  enableHipe = false;
+
+  # Do not install docs, instead use prebuilt versions.
+  installTargets = "install";
   postInstall = let
-    manpages = fetchurl {
+    manpages = pkgs.fetchurl {
       url = "http://www.erlang.org/download/otp_doc_man_R${version}.tar.gz";
       sha256 = "12apxjmmd591y9g9bhr97z5jbd1jarqg7wj0y2sqhl21hc1yp75p";
     };
   in ''
-    ln -s $out/lib/erlang/lib/erl_interface*/bin/erl_call $out/bin/erl_call
+    sed -e s@$(pwd)/bootstrap/bin/escript@$out/bin/escript@g -i $out/lib/erlang/lib/diameter-1.4.3/bin/diameterc
+
     tar xf "${manpages}" -C "$out/lib/erlang"
     for i in "$out"/lib/erlang/man/man[0-9]/*.[0-9]; do
       prefix="''${i%/*}"
@@ -79,14 +41,6 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  # Some erlang bin/ scripts run sed and awk
-  postFixup = ''
-    wrapProgram $out/lib/erlang/bin/erl --prefix PATH ":" "${gnused}/bin/"
-    wrapProgram $out/lib/erlang/bin/start_erl --prefix PATH ":" "${gnused}/bin/:${gawk}/bin"
-  '';
-
-  setupHook = ./setup-hook.sh;
-
   meta = {
     homepage = "https://github.com/basho/otp/";
     description = "Programming language used for massively scalable soft real-time systems, Basho fork";
@@ -103,7 +57,7 @@ stdenv.mkDerivation rec {
     '';
 
     platforms = ["x86_64-linux" "x86_64-darwin"];
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with maintainers; [ mdaiter ];
+    license = pkgs.stdenv.lib.licenses.asl20;
+    maintainers = with pkgs.stdenv.lib.maintainers; [ mdaiter ];
   };
 }