git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #16122 from ericbmerritt/feature/beam-package-improvements

Feature/beam package improvements

commit605c08d2238e3fa42f5a898ee54cf234084dcd1a authorJoachim Fasting <joachifm@users.noreply.github.com> dateWed 15 Jun 2016, 20:27 (10 years ago) parentd353301eeed641
12 files changed+21051−11446
pkgs/development/beam-modules/build-erlang-mk.nix+19−8 pkgs/development/beam-modules/build-mix.nix+22−8 pkgs/development/beam-modules/build-rebar3.nix+15−6 pkgs/development/beam-modules/fetch-hex.nix+1−1 pkgs/development/beam-modules/hex-packages.nix+20934−11387 pkgs/development/beam-modules/hex-registry-snapshot.nix+2−2 pkgs/development/interpreters/elixir/default.nix+2 pkgs/development/interpreters/erlang/R16.nix+4−1 pkgs/development/interpreters/erlang/R17.nix+3 pkgs/development/interpreters/erlang/R18.nix+3 pkgs/development/tools/build-managers/rebar3/rebar3-nix-bootstrap+46−10 pkgs/development/tools/build-managers/rebar3/registrySnapshot.nix−23
pkgs/development/beam-modules/build-erlang-mk.nix+19−8
@@ -1,4 +1,4 @@
1−{ stdenv, writeText, erlang, perl, which, gitMinimal, wget }:
1+{ stdenv, writeText, erlang, perl, which, gitMinimal, wget, lib }:
22
33{ name, version
44, src
@@ -8,12 +8,17 @@
88, postPatch ? ""
99, compilePorts ? false
1010, installPhase ? null
11+, buildPhase ? null
12+, configurePhase ? null
1113, meta ? {}
14+, enableDebugInfo ? false
1215, ... }@attrs:
1316
1417with stdenv.lib;
1518
1619let
20+ debugInfoFlag = lib.optionalString (enableDebugInfo || erlang.debugInfo) "+debug_info";
21+
1722 shell = drv: stdenv.mkDerivation {
1823 name = "interactive-shell-${drv.name}";
1924 buildInputs = [ drv ];
@@ -37,7 +42,8 @@ let
3742 buildInputs = [ erlang perl which gitMinimal wget ];
3843 propagatedBuildInputs = beamDeps;
3944
40− configurePhase = ''
45+ configurePhase = if configurePhase == null
46+ then ''
4147 runHook preConfigure
4248
4349 # We shouldnt need to do this, but it seems at times there is a *.app in
@@ -45,17 +51,21 @@ let
4551 make SKIP_DEPS=1 clean
4652
4753 runHook postConfigure
48− '';
54+ ''
55+ else configurePhase;
4956
50− buildPhase = ''
57+ buildPhase = if buildPhase == null
58+ then ''
5159 runHook preBuild
5260
53− make SKIP_DEPS=1
61+ make SKIP_DEPS=1 ERL_OPTS="$ERL_OPTS ${debugInfoFlag}"
5462
5563 runHook postBuild
56− '';
64+ ''
65+ else buildPhase;
5766
58− installPhase = ''
67+ installPhase = if installPhase == null
68+ then ''
5969 runHook preInstall
6070
6171 mkdir -p $out/lib/erlang/lib/${name}
@@ -75,7 +85,8 @@ let
7585 fi
7686
7787 runHook postInstall
78− '';
88+ ''
89+ else installPhase;
7990
8091 passthru = {
8192 packageName = name;
pkgs/development/beam-modules/build-mix.nix+22−8
@@ -1,4 +1,4 @@
1−{ stdenv, writeText, elixir, erlang, hexRegistrySnapshot, hex }:
1+{ stdenv, writeText, elixir, erlang, hexRegistrySnapshot, hex, lib }:
22
33{ name
44, version
@@ -8,12 +8,19 @@
88, beamDeps ? []
99, postPatch ? ""
1010, compilePorts ? false
11+, installPhase ? null
12+, buildPhase ? null
13+, configurePhase ? null
1114, meta ? {}
15+, enableDebugInfo ? false
1216, ... }@attrs:
1317
1418with stdenv.lib;
1519
1620let
21+
22+ debugInfoFlag = lib.optionalString (enableDebugInfo || elixir.debugInfo) "--debug-info";
23+
1724 shell = drv: stdenv.mkDerivation {
1825 name = "interactive-shell-${drv.name}";
1926 buildInputs = [ drv ];
@@ -38,25 +45,31 @@ let
3845 inherit buildInputs;
3946 propagatedBuildInputs = [ hexRegistrySnapshot hex elixir ] ++ beamDeps;
4047
41− configurePhase = ''
48+ configurePhase = if configurePhase == null
49+ then ''
4250 runHook preConfigure
4351 ${erlang}/bin/escript ${bootstrapper}
4452 runHook postConfigure
45− '';
53+ ''
54+ else configurePhase ;
4655
47− buildPhase = ''
56+
57+ buildPhase = if buildPhase == null
58+ then ''
4859 runHook preBuild
4960
5061 export HEX_OFFLINE=1
5162 export HEX_HOME=`pwd`
5263 export MIX_ENV=prod
5364
54− MIX_ENV=prod mix compile --debug-info --no-deps-check
65+ MIX_ENV=prod mix compile ${debugInfoFlag} --no-deps-check
5566
5667 runHook postBuild
57− '';
68+ ''
69+ else buildPhase;
5870
59− installPhase = ''
71+ installPhase = if installPhase == null
72+ then ''
6073 runHook preInstall
6174
6275 MIXENV=prod
@@ -74,7 +87,8 @@ let
7487 done
7588
7689 runHook postInstall
77− '';
90+ ''
91+ else installPhase;
7892
7993 passthru = {
8094 packageName = name;
pkgs/development/beam-modules/build-rebar3.nix+15−6
@@ -1,5 +1,5 @@
11{ stdenv, writeText, erlang, rebar3, openssl, libyaml,
2− pc, buildEnv }:
2+ pc, buildEnv, lib }:
33
44{ name, version
55, src
@@ -8,12 +8,17 @@
88, postPatch ? ""
99, compilePorts ? false
1010, installPhase ? null
11+, buildPhase ? null
12+, configurePhase ? null
1113, meta ? {}
14+, enableDebugInfo ? false
1215, ... }@attrs:
1316
1417with stdenv.lib;
1518
1619let
20+ debugInfoFlag = lib.optionalString (enableDebugInfo || erlang.debugInfo) "debug-info";
21+
1722 ownPlugins = buildPlugins ++ (if compilePorts then [pc] else []);
1823
1924 shell = drv: stdenv.mkDerivation {
@@ -46,20 +51,24 @@ let
4651 rm -f rebar rebar3
4752 '';
4853
49− configurePhase = ''
54+ configurePhase = if configurePhase == null
55+ then ''
5056 runHook preConfigure
51− ${erlang}/bin/escript ${rebar3.bootstrapper}
57+ ${erlang}/bin/escript ${rebar3.bootstrapper} ${debugInfoFlag}
5258 runHook postConfigure
53− '';
59+ ''
60+ else configurePhase;
5461
55− buildPhase = ''
62+ buildPhase = if buildPhase == null
63+ then ''
5664 runHook preBuild
5765 HOME=. rebar3 compile
5866 ${if compilePorts then ''
5967 HOME=. rebar3 pc compile
6068 '' else ''''}
6169 runHook postBuild
62− '';
70+ ''
71+ else installPhase;
6372
6473 installPhase = if installPhase == null
6574 then ''
pkgs/development/beam-modules/fetch-hex.nix+1−1
@@ -10,7 +10,7 @@ stdenv.mkDerivation ({
1010 name = "hex-source-${pkg}-${version}";
1111
1212 src = fetchurl {
13− url = "https://s3.amazonaws.com/s3.hex.pm/tarballs/${pkg}-${version}.tar";
13+ url = "https://repo.hex.pm/tarballs/${pkg}-${version}.tar";
1414 inherit sha256;
1515 };
1616
pkgs/development/beam-modules/hex-packages.nix+20934−11387

This diff is too big to show here.

pkgs/development/beam-modules/hex-registry-snapshot.nix+2−2

This diff is too big to show here.

pkgs/development/interpreters/elixir/default.nix+2

This diff is too big to show here.

pkgs/development/interpreters/erlang/R16.nix+4−1

This diff is too big to show here.

pkgs/development/interpreters/erlang/R17.nix+3

This diff is too big to show here.

pkgs/development/interpreters/erlang/R18.nix+3

This diff is too big to show here.

pkgs/development/tools/build-managers/rebar3/rebar3-nix-bootstrap+46−10

This diff is too big to show here.

pkgs/development/tools/build-managers/rebar3/registrySnapshot.nixdeleted−23

This diff is too big to show here.