erlang: move erlang_basho_R16B02 to Erlang's general builder.

+36 -74
-1
pkgs/development/interpreters/erlang/R16.nix
··· 25 25 sha256 = "17f3k5j17rdsah18gywjngip6cbfgp6nb9di6il4pahmf9yvqc8g"; 26 26 }; 27 27 in '' 28 - ln -s $out/lib/erlang/lib/erl_interface*/bin/erl_call $out/bin/erl_call 29 28 tar xf "${manpages}" -C "$out/lib/erlang" 30 29 for i in "$out"/lib/erlang/man/man[0-9]/*.[0-9]; do 31 30 prefix="''${i%/*}"
+14 -60
pkgs/development/interpreters/erlang/R16B02-8-basho.nix
··· 1 - { stdenv, fetchurl, fetchFromGitHub, perl, gnum4, ncurses, openssl, autoconf264, gcc, erlang 2 - , gnused, gawk, makeWrapper 3 - , odbcSupport ? false, unixODBC ? null 4 - , wxSupport ? false, mesa ? null, wxGTK ? null, xorg ? null 5 - , enableDebugInfo ? false 6 - , Carbon ? null, Cocoa ? null }: 1 + { pkgs, mkDerivation }: 7 2 8 - assert wxSupport -> mesa != null && wxGTK != null && xorg != null; 9 - assert odbcSupport -> unixODBC != null; 10 - 11 - with stdenv.lib; 12 - 13 - stdenv.mkDerivation rec { 14 - name = "erlang-basho-" + version + "${optionalString odbcSupport "-odbc"}"; 3 + mkDerivation rec { 4 + baseName = "erlang"; 15 5 version = "16B02"; 16 6 17 - src = fetchFromGitHub { 7 + src = pkgs.fetchFromGitHub { 18 8 owner = "basho"; 19 9 repo = "otp"; 20 10 rev = "OTP_R16B02_basho8"; 21 11 sha256 = "1w0hbm0axxxa45v3kl6bywc9ayir5vwqxjpnjlzc616ldszb2m0x"; 22 12 }; 23 - 24 - debugInfo = enableDebugInfo; 25 - 26 - buildInputs = 27 - [ perl gnum4 ncurses openssl makeWrapper autoconf264 gcc 28 - ] ++ optional wxSupport [ mesa wxGTK xorg.libX11 ] 29 - ++ optional odbcSupport [ unixODBC ] 30 - ++ optionals stdenv.isDarwin [ Carbon Cocoa ]; 31 - 32 - # Clang 4 (rightfully) thinks signed comparisons of pointers with NULL are nonsense 33 - prePatch = '' 34 - substituteInPlace lib/wx/c_src/wxe_impl.cpp --replace 'temp > NULL' 'temp != NULL' 35 - ''; 36 - 37 - patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure.in erts/configure.in ''; 38 - 39 - postPatch = '' 40 - patchSheBangs make 41 - ''; 42 13 43 14 preConfigure = '' 44 15 export HOME=$PWD/../ 45 16 export LANG=C 46 17 export ERL_TOP=$(pwd) 47 18 sed -e s@/bin/pwd@pwd@g -i otp_build 48 - sed -e s@"/usr/bin/env escript"@${erlang}/bin/escript@g -i lib/diameter/bin/diameterc 49 - ''; 19 + sed -e s@"/usr/bin/env escript"@$(pwd)/bootstrap/bin/escript@g -i lib/diameter/bin/diameterc 50 20 51 - configureFlags= [ 52 - "--with-ssl=${openssl.dev}" 53 - "--enable-smp-support" 54 - "--enable-threads" 55 - "--enable-kernel-poll" 56 - "--disable-hipe" 57 - "${optionalString odbcSupport "--with-odbc=${unixODBC}"}" 58 - "${optionalString stdenv.isDarwin "--enable-darwin-64bit"}" 59 - "${optionalString stdenv.isLinux "--enable-m64-build"}" 60 - ]; 61 - 62 - buildPhase = '' 63 21 ./otp_build autoconf 64 - ./otp_build setup -a --prefix=$out $configureFlags 65 22 ''; 66 23 24 + enableHipe = false; 25 + 26 + # Do not install docs, instead use prebuilt versions. 27 + installTargets = "install"; 67 28 postInstall = let 68 - manpages = fetchurl { 29 + manpages = pkgs.fetchurl { 69 30 url = "http://www.erlang.org/download/otp_doc_man_R${version}.tar.gz"; 70 31 sha256 = "12apxjmmd591y9g9bhr97z5jbd1jarqg7wj0y2sqhl21hc1yp75p"; 71 32 }; 72 33 in '' 73 - ln -s $out/lib/erlang/lib/erl_interface*/bin/erl_call $out/bin/erl_call 34 + sed -e s@$(pwd)/bootstrap/bin/escript@$out/bin/escript@g -i $out/lib/erlang/lib/diameter-1.4.3/bin/diameterc 35 + 74 36 tar xf "${manpages}" -C "$out/lib/erlang" 75 37 for i in "$out"/lib/erlang/man/man[0-9]/*.[0-9]; do 76 38 prefix="''${i%/*}" ··· 79 41 done 80 42 ''; 81 43 82 - # Some erlang bin/ scripts run sed and awk 83 - postFixup = '' 84 - wrapProgram $out/lib/erlang/bin/erl --prefix PATH ":" "${gnused}/bin/" 85 - wrapProgram $out/lib/erlang/bin/start_erl --prefix PATH ":" "${gnused}/bin/:${gawk}/bin" 86 - ''; 87 - 88 - setupHook = ./setup-hook.sh; 89 - 90 44 meta = { 91 45 homepage = "https://github.com/basho/otp/"; 92 46 description = "Programming language used for massively scalable soft real-time systems, Basho fork"; ··· 103 57 ''; 104 58 105 59 platforms = ["x86_64-linux" "x86_64-darwin"]; 106 - license = stdenv.lib.licenses.asl20; 107 - maintainers = with maintainers; [ mdaiter ]; 60 + license = pkgs.stdenv.lib.licenses.asl20; 61 + maintainers = with pkgs.stdenv.lib.maintainers; [ mdaiter ]; 108 62 }; 109 63 }
-1
pkgs/development/interpreters/erlang/R17.nix
··· 25 25 sha256 = "1hspm285bl7i9a0d4r6j6lm5yk4sb5d9xzpia3simh0z06hv5cc5"; 26 26 }; 27 27 in '' 28 - ln -s $out/lib/erlang/lib/erl_interface*/bin/erl_call $out/bin/erl_call 29 28 tar xf "${manpages}" -C "$out/lib/erlang" 30 29 for i in "$out"/lib/erlang/man/man[0-9]/*.[0-9]; do 31 30 prefix="''${i%/*}"
+20 -8
pkgs/development/interpreters/erlang/generic-builder.nix
··· 1 - { pkgs, stdenv, fetchurl, fetchFromGitHub, makeWrapper, autoconf, gawk, gnum4, gnused 2 - , libxml2, libxslt, ncurses, openssl, perl 1 + { pkgs, stdenv, fetchurl, fetchFromGitHub, makeWrapper, gawk, gnum4, gnused 2 + , libxml2, libxslt, ncurses, openssl, perl, gcc, autoreconfHook 3 3 , openjdk ? null # javacSupport 4 4 , unixODBC ? null # odbcSupport 5 5 , mesa ? null, wxGTK ? null, wxmac ? null, xorg ? null # wxSupport 6 6 }: 7 7 8 - { version 8 + { baseName ? "erlang" 9 + , version 9 10 , sha256 ? null 10 11 , rev ? "OTP-${version}" 11 12 , src ? fetchFromGitHub { inherit rev sha256; owner = "erlang"; repo = "otp"; } 12 13 , enableHipe ? true 13 14 , enableDebugInfo ? false 15 + , enableThreads ? true 16 + , enableSmpSupport ? true 17 + , enableKernelPoll ? true 14 18 , javacSupport ? false, javacPackages ? [ openjdk ] 15 19 , odbcSupport ? false, odbcPackages ? [ unixODBC ] 16 20 , wxSupport ? true, wxPackages ? [ mesa wxGTK xorg.libX11 ] ··· 22 26 , installTargets ? "install install-docs" 23 27 , checkPhase ? "", preCheck ? "", postCheck ? "" 24 28 , fixupPhase ? "", preFixup ? "", postFixup ? "" 29 + , meta ? null 25 30 }: 26 31 27 32 assert wxSupport -> (if stdenv.isDarwin ··· 36 41 wxPackages2 = if stdenv.isDarwin then [ wxmac ] else wxPackages; 37 42 38 43 in stdenv.mkDerivation ({ 39 - name = "erlang-${version}" 44 + name = "${baseName}-${version}" 40 45 + optionalString javacSupport "-javac" 41 46 + optionalString odbcSupport "-odbc"; 42 47 43 48 inherit src version; 44 49 45 - buildInputs = [ perl gnum4 ncurses openssl autoconf libxslt libxml2 makeWrapper ] 50 + buildInputs = 51 + [ perl gnum4 ncurses openssl autoreconfHook libxslt libxml2 makeWrapper gcc 52 + ] 46 53 ++ optionals wxSupport wxPackages2 47 54 ++ optionals odbcSupport odbcPackages 48 55 ++ optionals javacSupport javacPackages ··· 58 65 ''; 59 66 60 67 postPatch = '' 61 - patchShebangs make 68 + ${postPatch} 62 69 63 - ${postPatch} 70 + patchShebangs make 64 71 ''; 65 72 66 73 preConfigure = '' ··· 68 75 ''; 69 76 70 77 configureFlags = [ "--with-ssl=${openssl.dev}" ] 78 + ++ optional enableThreads "--enable-threads" 79 + ++ optional enableSmpSupport "--enable-smp-support" 80 + ++ optional enableKernelPoll "--enable-kernel-poll" 71 81 ++ optional enableHipe "--enable-hipe" 72 82 ++ optional javacSupport "--with-javac" 73 83 ++ optional odbcSupport "--with-odbc=${unixODBC}" ··· 78 88 # (PDFs are generated only when fop is available). 79 89 80 90 postInstall = '' 91 + ${postInstall} 92 + 81 93 ln -s $out/lib/erlang/lib/erl_interface*/bin/erl_call $out/bin/erl_call 82 94 ''; 83 95 ··· 125 137 // optionalAttrs (installPhase != "") { inherit installPhase; } 126 138 // optionalAttrs (installTargets != "") { inherit installTargets; } 127 139 // optionalAttrs (preInstall != "") { inherit preInstall; } 128 - // optionalAttrs (postInstall != "") { inherit postInstall; } 129 140 // optionalAttrs (fixupPhase != "") { inherit fixupPhase; } 130 141 // optionalAttrs (preFixup != "") { inherit preFixup; } 131 142 // optionalAttrs (postFixup != "") { inherit postFixup; } 143 + // optionalAttrs (meta != null) { inherit meta; } 132 144 )
+2 -4
pkgs/top-level/beam-packages.nix
··· 38 38 }; 39 39 40 40 # Bash fork, using custom builder. 41 - erlang_basho_R16B02 = callPackage ../development/interpreters/erlang/R16B02-8-basho.nix { 42 - inherit (darwin.apple_sdk.frameworks) Carbon Cocoa; 41 + erlang_basho_R16B02 = lib.callErlang ../development/interpreters/erlang/R16B02-8-basho.nix { 43 42 }; 44 - erlang_basho_R16B02_odbc = callPackage ../development/interpreters/erlang/R16B02-8-basho.nix { 45 - inherit (darwin.apple_sdk.frameworks) Carbon Cocoa; 43 + erlang_basho_R16B02_odbc = erlang_basho_R16B02.override { 46 44 odbcSupport = true; 47 45 }; 48 46