mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 21:37:15 +02:00
community/elixir: fix build under Erlang 20.3
This commit is contained in:
parent
d96193c4d8
commit
71a420021c
@ -1,7 +1,7 @@
|
||||
# Maintainer: Marlus Saraiva <marlus.saraiva@gmail.com>
|
||||
pkgname=elixir
|
||||
pkgver=1.6.3
|
||||
pkgrel=0
|
||||
pkgrel=1
|
||||
pkgdesc="Elixir is a dynamic, functional language designed for building scalable and maintainable applications"
|
||||
url="http://elixir-lang.org"
|
||||
arch="noarch"
|
||||
@ -11,6 +11,7 @@ depends="erlang erlang-inets erlang-ssl
|
||||
makedepends="erlang-crypto erlang-syntax-tools erlang-parsetools erlang-eunit erlang-tools"
|
||||
subpackages="$pkgname-doc"
|
||||
source="$pkgname-$pkgver.tar.gz::https://github.com/elixir-lang/elixir/archive/v$pkgver.tar.gz
|
||||
bit-comp-works.patch
|
||||
disable-iex-tests.patch"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
@ -38,4 +39,5 @@ package() {
|
||||
}
|
||||
|
||||
sha512sums="76f38accd277d92c428954871c62b9ff69b97137d1e4e3889feb3be94055ba2b45275aa38561aef700dac0f5381db72d4e47b55342a3e04397f3781b412dbf2c elixir-1.6.3.tar.gz
|
||||
87ec27be2dfe8a7bcda0e50c81c75bcd66e3225259a0da14925623d65331a86972ea5c94df435827232f39bc67823e7ed23e671a975b10c2ebb29c19e1280863 bit-comp-works.patch
|
||||
7d579a8be0f6ba2de6d85861267f9fea7846c29cf661c3221b02e1464c87db941d015a18217ffe25a5846a4ea63ccf8338541568a70bf9ec07237b91a94a0860 disable-iex-tests.patch"
|
||||
|
84
community/elixir/bit-comp-works.patch
Normal file
84
community/elixir/bit-comp-works.patch
Normal file
@ -0,0 +1,84 @@
|
||||
From 141c3276857ac09bb1f378ed6842495bb0b0e57d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@gmail.com>
|
||||
Date: Wed, 14 Mar 2018 21:45:13 +0100
|
||||
Subject: [PATCH] Ensure bitstring comprehensions work on OTP 20.3 (#7453)
|
||||
|
||||
Closes #7452
|
||||
---
|
||||
lib/elixir/lib/collectable.ex | 3 +++
|
||||
lib/elixir/src/elixir_erl_for.erl | 24 +++++++++++++++++-------
|
||||
2 files changed, 20 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/lib/elixir/lib/collectable.ex b/lib/elixir/lib/collectable.ex
|
||||
index f7a35cd65e..495eb848cb 100644
|
||||
--- a/lib/elixir/lib/collectable.ex
|
||||
+++ b/lib/elixir/lib/collectable.ex
|
||||
@@ -101,6 +101,9 @@ defimpl Collectable, for: BitString do
|
||||
acc, {:cont, x} when is_bitstring(x) ->
|
||||
<<IO.iodata_to_binary(acc)::bitstring, x::bitstring>>
|
||||
|
||||
+ acc, :done when is_bitstring(acc) ->
|
||||
+ acc
|
||||
+
|
||||
acc, :done ->
|
||||
IO.iodata_to_binary(acc)
|
||||
|
||||
diff --git a/lib/elixir/src/elixir_erl_for.erl b/lib/elixir/src/elixir_erl_for.erl
|
||||
index e24da55a8b..5c4ce62c6d 100644
|
||||
--- a/lib/elixir/src/elixir_erl_for.erl
|
||||
+++ b/lib/elixir/src/elixir_erl_for.erl
|
||||
@@ -21,7 +21,7 @@ translate(Meta, Args, Return, S) ->
|
||||
|
||||
case comprehension_expr(TInto, TExpr) of
|
||||
{inline, TIntoExpr} ->
|
||||
- {build_inline(Ann, TCases, TIntoExpr, TInto, TUniq, SF), SF};
|
||||
+ build_inline(Ann, TCases, TIntoExpr, TInto, TUniq, SF);
|
||||
{into, TIntoExpr} ->
|
||||
build_into(Ann, TCases, TIntoExpr, TInto, TUniq, SF)
|
||||
end.
|
||||
@@ -91,17 +91,17 @@ collect_filters([], Acc) ->
|
||||
|
||||
build_inline(Ann, Clauses, Expr, Into, Uniq, S) ->
|
||||
case not Uniq and lists:all(fun(Clause) -> element(1, Clause) == bin end, Clauses) of
|
||||
- true -> build_comprehension(Ann, Clauses, Expr, Into);
|
||||
+ true -> {build_comprehension(Ann, Clauses, Expr, Into), S};
|
||||
false -> build_inline_each(Ann, Clauses, Expr, Into, Uniq, S)
|
||||
end.
|
||||
|
||||
build_inline_each(Ann, Clauses, Expr, false, Uniq, S) ->
|
||||
InnerFun = fun(InnerExpr, _InnerAcc) -> InnerExpr end,
|
||||
- build_reduce(Ann, Clauses, InnerFun, Expr, {nil, Ann}, Uniq, S);
|
||||
+ {build_reduce(Ann, Clauses, InnerFun, Expr, {nil, Ann}, Uniq, S), S};
|
||||
build_inline_each(Ann, Clauses, Expr, {nil, _} = Into, Uniq, S) ->
|
||||
InnerFun = fun(InnerExpr, InnerAcc) -> {cons, Ann, InnerExpr, InnerAcc} end,
|
||||
ReduceExpr = build_reduce(Ann, Clauses, InnerFun, Expr, Into, Uniq, S),
|
||||
- elixir_erl:remote(Ann, lists, reverse, [ReduceExpr]);
|
||||
+ {elixir_erl:remote(Ann, lists, reverse, [ReduceExpr]), S};
|
||||
build_inline_each(Ann, Clauses, Expr, {bin, _, []}, Uniq, S) ->
|
||||
{InnerValue, SV} = build_var(Ann, S),
|
||||
|
||||
@@ -135,11 +135,21 @@ build_inline_each(Ann, Clauses, Expr, {bin, _, []}, Uniq, S) ->
|
||||
end,
|
||||
|
||||
ReduceExpr = build_reduce(Ann, Clauses, InnerFun, Expr, {nil, Ann}, Uniq, SV),
|
||||
- elixir_erl:remote(Ann, erlang, iolist_to_binary, [ReduceExpr]).
|
||||
+
|
||||
+ {{'case', Ann, ReduceExpr, [
|
||||
+ {clause, Ann,
|
||||
+ [InnerValue],
|
||||
+ [[elixir_erl:remote(Ann, erlang, is_bitstring, [InnerValue])]],
|
||||
+ [InnerValue]},
|
||||
+ {clause, Ann,
|
||||
+ [InnerValue],
|
||||
+ [],
|
||||
+ [elixir_erl:remote(Ann, erlang, iolist_to_binary, [InnerValue])]}
|
||||
+ ]}, SV}.
|
||||
|
||||
build_into(Ann, Clauses, Expr, {map, _, []}, Uniq, S) ->
|
||||
- ReduceExpr = build_inline_each(Ann, Clauses, Expr, {nil, Ann}, Uniq, S),
|
||||
- {elixir_erl:remote(Ann, maps, from_list, [ReduceExpr]), S};
|
||||
+ {ReduceExpr, SR} = build_inline_each(Ann, Clauses, Expr, {nil, Ann}, Uniq, S),
|
||||
+ {elixir_erl:remote(Ann, maps, from_list, [ReduceExpr]), SR};
|
||||
build_into(Ann, Clauses, Expr, Into, Uniq, S) ->
|
||||
{Fun, SF} = build_var(Ann, S),
|
||||
{Acc, SA} = build_var(Ann, SF),
|
Loading…
Reference in New Issue
Block a user