commit:     8c02c0d8649c6385b1f9087c659944e5b2b488fa
Author:     Haelwenn (lanodan) Monnier <contact <AT> hacktivis <DOT> me>
AuthorDate: Fri Feb 23 07:43:54 2024 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Mar 29 07:50:57 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c02c0d8

dev-lang/elixir: 1.14.5: Fix tests for erlang-26.1+

Signed-off-by: Haelwenn (lanodan) Monnier <contact <AT> hacktivis.me>
Closes: https://github.com/gentoo/gentoo/pull/35496
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-lang/elixir/elixir-1.14.5-r2.ebuild            |  41 ++++++++
 .../elixir/files/elixir-1.14.5-otp26-tests.patch   | 107 +++++++++++++++++++++
 2 files changed, 148 insertions(+)

diff --git a/dev-lang/elixir/elixir-1.14.5-r2.ebuild 
b/dev-lang/elixir/elixir-1.14.5-r2.ebuild
new file mode 100644
index 000000000000..77baef256235
--- /dev/null
+++ b/dev-lang/elixir/elixir-1.14.5-r2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Elixir programming language"
+HOMEPAGE="https://elixir-lang.org";
+SRC_URI="https://github.com/elixir-lang/elixir/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="Apache-2.0 ErlPL-1.1"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~riscv ~sparc ~x86"
+IUSE="test"
+
+RESTRICT="!test? ( test )"
+
+# 
https://hexdocs.pm/elixir/compatibility-and-deprecations.html#compatibility-between-elixir-and-erlang-otp
+DEPEND="
+       >=dev-lang/erlang-23:0=[ssl]
+       <dev-lang/erlang-27
+"
+# 'mix' tool collides with sci-biology/phylip, bug #537514
+RDEPEND="${DEPEND}
+       !!sci-biology/phylip
+"
+DEPEND+="
+       test? ( dev-vcs/git )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.9.1-disable-network-tests.patch
+       "${FILESDIR}"/${PN}-1.10.3-no-Q.patch
+       "${FILESDIR}"/${PN}-1.10.3-epmd-daemon.patch
+       "${FILESDIR}"/${PN}-1.14.1-make44-parallel-build.patch
+       "${FILESDIR}"/${PN}-1.14.5-otp26-tests.patch
+)
+
+src_install() {
+       emake DESTDIR="${D}" LIBDIR="$(get_libdir)" PREFIX="${EPREFIX}/usr" 
install
+       dodoc README.md CHANGELOG.md CODE_OF_CONDUCT.md
+}

diff --git a/dev-lang/elixir/files/elixir-1.14.5-otp26-tests.patch 
b/dev-lang/elixir/files/elixir-1.14.5-otp26-tests.patch
new file mode 100644
index 000000000000..4e554cda252a
--- /dev/null
+++ b/dev-lang/elixir/files/elixir-1.14.5-otp26-tests.patch
@@ -0,0 +1,107 @@
+Grabbed as-is from 
https://github.com/elixir-lang/elixir/commit/54516c5684daa3af7f15477c77fae39e8d0c6482
 which was done for 1.15.x
+
+From 54516c5684daa3af7f15477c77fae39e8d0c6482 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.va...@dashbit.co>
+Date: Sun, 1 Oct 2023 15:46:17 +0200
+Subject: [PATCH] Address tests on Erlang/OTP 26.1, closes #12975
+
+---
+ lib/ex_unit/lib/ex_unit/callbacks.ex         |  9 +-----
+ lib/ex_unit/test/ex_unit/formatter_test.exs  | 31 +++++++++-----------
+ lib/ex_unit/test/ex_unit/supervised_test.exs | 11 ++-----
+ 3 files changed, 18 insertions(+), 33 deletions(-)
+
+diff --git a/lib/ex_unit/lib/ex_unit/callbacks.ex 
b/lib/ex_unit/lib/ex_unit/callbacks.ex
+index 060d207516a..2dbe9bd0e4a 100644
+--- a/lib/ex_unit/lib/ex_unit/callbacks.ex
++++ b/lib/ex_unit/lib/ex_unit/callbacks.ex
+@@ -549,14 +549,7 @@ defmodule ExUnit.Callbacks do
+       end
+ 
+     child_spec = Supervisor.child_spec(child_spec_or_module, opts)
+-
+-    case Supervisor.start_child(sup, child_spec) do
+-      {:error, {:already_started, _pid}} ->
+-        {:error, {:duplicate_child_name, child_spec.id}}
+-
+-      other ->
+-        other
+-    end
++    Supervisor.start_child(sup, child_spec)
+   end
+ 
+   @doc """
+diff --git a/lib/ex_unit/test/ex_unit/formatter_test.exs 
b/lib/ex_unit/test/ex_unit/formatter_test.exs
+index afb66a52436..bb9642fbcc4 100644
+--- a/lib/ex_unit/test/ex_unit/formatter_test.exs
++++ b/lib/ex_unit/test/ex_unit/formatter_test.exs
+@@ -491,28 +491,25 @@ defmodule ExUnit.FormatterTest do
+   test "inspect failure" do
+     failure = [{:error, catch_assertion(assert :will_fail == %BadInspect{}), 
[]}]
+ 
+-    message = ~S'''
+-      got FunctionClauseError with message:
+-
+-          """
+-          no function clause matching in 
Inspect.ExUnit.FormatterTest.BadInspect.inspect/2
+-          """
+-
+-      while inspecting:
+-
+-          %{__struct__: ExUnit.FormatterTest.BadInspect, key: 0}
+-
+-      Stacktrace:
+-    '''
+-
+-    assert format_test_failure(test(), failure, 1, 80, &formatter/2) =~ """
++    assert format_test_failure(test(), failure, 1, 80, &formatter/2) =~ ~s'''
+              1) world (Hello)
+                 test/ex_unit/formatter_test.exs:1
+                 Assertion with == failed
+                 code:  assert :will_fail == %BadInspect{}
+                 left:  :will_fail
+-                right: #Inspect.Error<\n#{message}\
+-           """
++                right: #Inspect.Error<
++             got FunctionClauseError with message:
++
++                 """
++                 no function clause matching in 
Inspect.ExUnit.FormatterTest.BadInspect.inspect/2
++                 """
++
++             while inspecting:
++
++                 #{inspect(%BadInspect{}, structs: false)}
++
++             Stacktrace:
++           '''
+   end
+ 
+   defmodule BadMessage do
+diff --git a/lib/ex_unit/test/ex_unit/supervised_test.exs 
b/lib/ex_unit/test/ex_unit/supervised_test.exs
+index 577ae6b9676..a02dfe3c0c5 100644
+--- a/lib/ex_unit/test/ex_unit/supervised_test.exs
++++ b/lib/ex_unit/test/ex_unit/supervised_test.exs
+@@ -73,19 +73,14 @@ defmodule ExUnit.SupervisedTest do
+ 
+   test "starts a supervised process with ID checks" do
+     {:ok, pid} = start_supervised({MyAgent, 0})
++    assert is_pid(pid)
+ 
+-    assert {:error, {:duplicate_child_name, ExUnit.SupervisedTest.MyAgent}} =
+-             start_supervised({MyAgent, 0})
+-
+-    assert {:error, {{:already_started, ^pid}, _}} = 
start_supervised({MyAgent, 0}, id: :another)
++    assert {:error, _} = start_supervised({MyAgent, 0})
++    assert {:error, _} = start_supervised({MyAgent, 0}, id: :another)
+ 
+     assert_raise RuntimeError, ~r"Reason: bad child specification", fn ->
+       start_supervised!(%{id: 1, start: :oops})
+     end
+-
+-    assert_raise RuntimeError, ~r"Reason: already started", fn ->
+-      start_supervised!({MyAgent, 0}, id: :another)
+-    end
+   end
+ 
+   test "stops a supervised process" do

Reply via email to