From 5a81c669065f86eb657b60fd0f6513b8435170eb Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Sun, 19 Mar 2017 00:36:15 -0400 Subject: [PATCH] erlang: patch all versions to work with clang 4 --- pkgs/development/interpreters/erlang/R16.nix | 5 ++++ .../interpreters/erlang/R16B02-8-basho.nix | 27 +++++++++++-------- pkgs/development/interpreters/erlang/R17.nix | 7 ++++- pkgs/development/interpreters/erlang/R18.nix | 7 ++++- pkgs/development/interpreters/erlang/R19.nix | 3 +++ 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/pkgs/development/interpreters/erlang/R16.nix b/pkgs/development/interpreters/erlang/R16.nix index ed30fe1522bf..e2e0151de371 100644 --- a/pkgs/development/interpreters/erlang/R16.nix +++ b/pkgs/development/interpreters/erlang/R16.nix @@ -27,6 +27,11 @@ stdenv.mkDerivation rec { ++ 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 erts/configure ''; preConfigure = '' diff --git a/pkgs/development/interpreters/erlang/R16B02-8-basho.nix b/pkgs/development/interpreters/erlang/R16B02-8-basho.nix index 5745ea5d98b3..80f524019df0 100644 --- a/pkgs/development/interpreters/erlang/R16B02-8-basho.nix +++ b/pkgs/development/interpreters/erlang/R16B02-8-basho.nix @@ -2,7 +2,7 @@ , gnused, gawk, makeWrapper , odbcSupport ? false, unixODBC ? null , wxSupport ? false, mesa ? null, wxGTK ? null, xorg ? null -, enableDebugInfo ? false +, enableDebugInfo ? false , Carbon ? null, Cocoa ? null }: assert wxSupport -> mesa != null && wxGTK != null && xorg != null; @@ -24,11 +24,16 @@ stdenv.mkDerivation rec { debugInfo = enableDebugInfo; buildInputs = - [ perl gnum4 ncurses openssl makeWrapper autoconf264 gcc + [ 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 ''; preConfigure = '' @@ -36,22 +41,22 @@ stdenv.mkDerivation rec { 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"@${erlang}/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"}" + "--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 autoconf ./otp_build setup -a --prefix=$out $configureFlags ''; @@ -89,7 +94,7 @@ stdenv.mkDerivation rec { telephony and instant messaging. Erlang's runtime system has built-in support for concurrency, distribution and fault tolerance. - This version of Erlang is Basho's version, forked from Ericsson's + This version of Erlang is Basho's version, forked from Ericsson's repository. ''; diff --git a/pkgs/development/interpreters/erlang/R17.nix b/pkgs/development/interpreters/erlang/R17.nix index 57323a587f81..0869285d4965 100644 --- a/pkgs/development/interpreters/erlang/R17.nix +++ b/pkgs/development/interpreters/erlang/R17.nix @@ -35,7 +35,12 @@ stdenv.mkDerivation rec { ++ optional javacSupport openjdk ++ stdenv.lib.optionals stdenv.isDarwin [ Carbon Cocoa ]; - patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure ''; + patchPhase = '' + # Clang 4 (rightfully) thinks signed comparisons of pointers with NULL are nonsense + substituteInPlace lib/wx/c_src/wxe_impl.cpp --replace 'temp > NULL' 'temp != NULL' + + sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure + ''; debugInfo = enableDebugInfo; diff --git a/pkgs/development/interpreters/erlang/R18.nix b/pkgs/development/interpreters/erlang/R18.nix index f9b6edc3fa4b..1ed9bfbd70a2 100644 --- a/pkgs/development/interpreters/erlang/R18.nix +++ b/pkgs/development/interpreters/erlang/R18.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, fetchFromGitHub, perl, gnum4, ncurses, openssl +{ stdenv, fetchurl, fetchpatch, fetchFromGitHub, perl, gnum4, ncurses, openssl , gnused, gawk, autoconf, libxslt, libxml2, makeWrapper , Carbon, Cocoa , odbcSupport ? false, unixODBC ? null @@ -53,6 +53,11 @@ stdenv.mkDerivation rec { sha256 = "10h5348p6g279b4q01i5jdqlljww5chcvrx5b4b0dv79pk0p0m9f"; }; + # 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' + ''; + patches = [ rmAndPwdPatch envAndCpPatch diff --git a/pkgs/development/interpreters/erlang/R19.nix b/pkgs/development/interpreters/erlang/R19.nix index 11f50b40fb36..4b1e3f4cb2f9 100644 --- a/pkgs/development/interpreters/erlang/R19.nix +++ b/pkgs/development/interpreters/erlang/R19.nix @@ -46,6 +46,9 @@ stdenv.mkDerivation rec { prePatch = '' substituteInPlace configure.in \ --replace '`sw_vers -productVersion`' '10.10' + + # Clang 4 (rightfully) thinks signed comparisons of pointers with NULL are nonsense + substituteInPlace lib/wx/c_src/wxe_impl.cpp --replace 'temp > NULL' 'temp != NULL' ''; preConfigure = ''