commit:     cd830b9a47db798235ae7041acac28d059824cdf
Author:     Fabio Rossi <rossi.f <AT> inwind <DOT> it>
AuthorDate: Mon Mar 10 09:55:03 2025 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Mon Mar 10 11:59:31 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd830b9a

sci-electronics/ghdl: fix tests for ghdl-4.1.0

- fixed tests backporting upstream related commits
- add support to gcc_14 compiler

Closes: https://bugs.gentoo.org/951113
Signed-off-by: Fabio Rossi <rossi.f <AT> inwind.it>
Closes: https://github.com/gentoo/gentoo/pull/40996
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 .../ghdl/files/ghdl-4.1.0-tests-fix.patch          | 266 +++++++++++++++++++++
 .../{ghdl-4.1.0-r1.ebuild => ghdl-4.1.0-r2.ebuild} |   7 +-
 2 files changed, 271 insertions(+), 2 deletions(-)

diff --git a/sci-electronics/ghdl/files/ghdl-4.1.0-tests-fix.patch 
b/sci-electronics/ghdl/files/ghdl-4.1.0-tests-fix.patch
new file mode 100644
index 000000000000..e01addfaf4d1
--- /dev/null
+++ b/sci-electronics/ghdl/files/ghdl-4.1.0-tests-fix.patch
@@ -0,0 +1,266 @@
+From a9fe853e63229603a8958fd80ff8b996dd49c950 Mon Sep 17 00:00:00 2001
+From: Tristan Gingold <[email protected]>
+Date: Sun, 26 May 2024 09:57:54 +0200
+Subject: [PATCH] testsuite/gna: fix vpi prototypes
+
+Fix #2663
+---
+ testsuite/gna/issue450/vpi2.c | 6 ++++--
+ testsuite/gna/issue98/vpi1.c  | 7 ++++---
+ 2 files changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/testsuite/gna/issue450/vpi2.c b/testsuite/gna/issue450/vpi2.c
+index 0debb546b5..f1d652bb71 100644
+--- a/testsuite/gna/issue450/vpi2.c
++++ b/testsuite/gna/issue450/vpi2.c
+@@ -40,7 +40,7 @@ void printContent (vpiHandle parent)
+     }
+ }
+ 
+-void printModules()
++PLI_INT32 printModules(s_cb_data *cb)
+ {
+   vpiHandle topModIterator;
+   vpiHandle topModHandle;
+@@ -53,7 +53,7 @@ void printModules()
+   vpi_printf ("got to here1 \n");
+   if (!topModIterator)
+     {
+-      return;
++      return -1;
+     }
+ 
+   /* use vpi_scan to iterate throught modules */
+@@ -64,6 +64,8 @@ void printModules()
+ 
+       printContent (topModHandle);
+     }
++
++  return 0;
+ }
+ 
+ 
+diff --git a/testsuite/gna/issue98/vpi1.c b/testsuite/gna/issue98/vpi1.c
+index 0adae07fe4..a14b89df23 100644
+--- a/testsuite/gna/issue98/vpi1.c
++++ b/testsuite/gna/issue98/vpi1.c
+@@ -1,8 +1,8 @@
+ #include <stdio.h>
+ #include <vpi_user.h>
+ 
+-void
+-vpi_proc (void)
++PLI_INT32
++vpi_proc (s_cb_data *cb)
+ {
+   vpiHandle net;
+   s_vpi_value val;
+@@ -11,11 +11,12 @@ vpi_proc (void)
+   if (net == NULL)
+     {
+       printf ("cannot get net\n");
+-      return;
++      return -1;
+     }
+   val.format = vpiBinStrVal;
+   vpi_get_value (net, &val);
+   printf ("value: %s\n", val.value.str);
++  return 0;
+ }
+ 
+ void my_handle_register()
+From 5c4d2509b47d416470cdac59bb81955f5aacfee3 Mon Sep 17 00:00:00 2001
+From: Tristan Gingold <[email protected]>
+Date: Sun, 26 May 2024 16:58:25 +0200
+Subject: [PATCH] testsuite/vpi: fix callback types (continue)
+
+---
+ testsuite/vpi/vpi002/vpi1.c |  7 ++++---
+ testsuite/vpi/vpi004/vpi1.c | 13 +++++++------
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/testsuite/vpi/vpi002/vpi1.c b/testsuite/vpi/vpi002/vpi1.c
+index d6f1b42fb7..53d51250ee 100644
+--- a/testsuite/vpi/vpi002/vpi1.c
++++ b/testsuite/vpi/vpi002/vpi1.c
+@@ -2,8 +2,8 @@
+ #include <vpi_user.h>
+ #define N_NAMES 12
+ 
+-void
+-vpi_proc (void)
++PLI_INT32
++vpi_proc (s_cb_data *cb)
+ {
+   vpiHandle net;
+   s_vpi_value val;
+@@ -54,12 +54,13 @@ vpi_proc (void)
+     if (net == NULL)
+         {
+         printf ("Error: Failed to find the net %s\n", names[name_index]);
+-        return;
++        return -1;
+         }
+     val.format = vpiBinStrVal;
+     vpi_get_value (net, &val);
+     printf ("value: %s\n", val.value.str);
+   }
++  return 0;
+ }
+ 
+ void my_handle_register()
+diff --git a/testsuite/vpi/vpi004/vpi1.c b/testsuite/vpi/vpi004/vpi1.c
+index 25d426fe7b..26ecf7c272 100644
+--- a/testsuite/vpi/vpi004/vpi1.c
++++ b/testsuite/vpi/vpi004/vpi1.c
+@@ -2,8 +2,8 @@
+ #include <vpi_user.h>
+ #define N_NAMES 12
+ 
+-void
+-vpi_proc (void)
++PLI_INT32
++vpi_proc (s_cb_data *cb)
+ {
+   s_vpi_vlog_info info;
+   int i;
+@@ -11,12 +11,12 @@ vpi_proc (void)
+   int ret = vpi_get_vlog_info(&info);
+   if (ret != 1) {
+     printf ("Error: Failed to get vlog_info\n");
+-    return;
++    return -1;
+   }
+ 
+   if (info.argc < 1) {
+      printf ("Error: Argc was 0\n");
+-     return;
++     return -1;
+   }
+   printf ("Argc: %d\n", info.argc);
+ 
+@@ -26,15 +26,16 @@ vpi_proc (void)
+ 
+   if (info.product == NULL) {
+     printf ("Error: product is NULL\n");
+-    return;
++    return -1;
+   }
+   printf ("Product: %s\n", info.product);
+ 
+   if (info.version == NULL) {
+     printf ("Error: version is NULL\n");
+-    return;
++    return -1;
+   }
+   printf ("Version: %s\n", info.version);
++  return 0;
+ }
+ 
+ void my_handle_register()
+From 659a5d7a018d011aad23235bfd3e306072436a8b Mon Sep 17 00:00:00 2001
+From: Tristan Gingold <[email protected]>
+Date: Sun, 26 May 2024 16:21:04 +0200
+Subject: [PATCH] testsuite/vpi: fix callback types
+
+---
+ testsuite/vpi/vpi001/vpi1.c | 7 ++++---
+ testsuite/vpi/vpi003/vpi1.c | 7 ++++---
+ 2 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/testsuite/vpi/vpi001/vpi1.c b/testsuite/vpi/vpi001/vpi1.c
+index c266b5cd75..a1ff9fb5d4 100644
+--- a/testsuite/vpi/vpi001/vpi1.c
++++ b/testsuite/vpi/vpi001/vpi1.c
+@@ -2,8 +2,8 @@
+ #include <vpi_user.h>
+ #define N_NAMES 12
+ 
+-void
+-vpi_proc (void)
++PLI_INT32
++vpi_proc (s_cb_data *cb)
+ {
+   vpiHandle net;
+   s_vpi_value val;
+@@ -39,12 +39,13 @@ vpi_proc (void)
+     if (net == NULL)
+         {
+         printf ("Error: Failed to find the net %s\n", names[name_index]);
+-        return;
++        return -1;
+         }
+     val.format = vpiBinStrVal;
+     vpi_get_value (net, &val);
+     printf ("value: %s\n", val.value.str);
+   }
++  return 0;
+ }
+ 
+ void my_handle_register()
+diff --git a/testsuite/vpi/vpi003/vpi1.c b/testsuite/vpi/vpi003/vpi1.c
+index d7a6f8241c..8bd18873d0 100644
+--- a/testsuite/vpi/vpi003/vpi1.c
++++ b/testsuite/vpi/vpi003/vpi1.c
+@@ -2,8 +2,8 @@
+ #include <vpi_user.h>
+ #define N_NAMES 0
+ 
+-void
+-vpi_proc (void)
++PLI_INT32
++vpi_proc (s_cb_data *cb)
+ {
+   vpiHandle net;
+   s_vpi_value val;
+@@ -29,12 +29,13 @@ vpi_proc (void)
+     if (net == NULL)
+         {
+         printf ("Error: Failed to find the net %s\n", names[name_index]);
+-        return;
++        return -1;
+         }
+     val.format = vpiBinStrVal;
+     vpi_get_value (net, &val);
+     printf ("value: %s\n", val.value.str);
+   }
++  return 0;
+ }
+ 
+ void my_handle_register()
+From 9e7a317cea2473a31e18f63b9392912b7da8e63d Mon Sep 17 00:00:00 2001
+From: Tristan Gingold <[email protected]>
+Date: Sun, 26 May 2024 17:22:54 +0200
+Subject: [PATCH] testsuite/vhpi: fix prototypes
+
+---
+ testsuite/vhpi/004trace_stdout/vhpi_lib.c | 2 +-
+ testsuite/vhpi/005trace_file/vhpi_lib.c   | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testsuite/vhpi/004trace_stdout/vhpi_lib.c 
b/testsuite/vhpi/004trace_stdout/vhpi_lib.c
+index 1bc1fca00b..df44f1e39c 100644
+--- a/testsuite/vhpi/004trace_stdout/vhpi_lib.c
++++ b/testsuite/vhpi/004trace_stdout/vhpi_lib.c
+@@ -23,7 +23,7 @@ void my_startup()
+   time.high = 0;
+   time.low = 0;
+ 
+-  vhpi_register_cb(&cb_data, NULL);
++  vhpi_register_cb(&cb_data, 0);
+ }
+ 
+ void (*vhpi_startup_routines[]) () =
+diff --git a/testsuite/vhpi/005trace_file/vhpi_lib.c 
b/testsuite/vhpi/005trace_file/vhpi_lib.c
+index 66ce5e1152..a0444c3f05 100644
+--- a/testsuite/vhpi/005trace_file/vhpi_lib.c
++++ b/testsuite/vhpi/005trace_file/vhpi_lib.c
+@@ -21,7 +21,7 @@ void my_startup()
+   time.high = 0;
+   time.low = 0;
+ 
+-  vhpi_register_cb(&cb_data, NULL);
++  vhpi_register_cb(&cb_data, 0);
+ }
+ 
+ void (*vhpi_startup_routines[]) () =

diff --git a/sci-electronics/ghdl/ghdl-4.1.0-r1.ebuild 
b/sci-electronics/ghdl/ghdl-4.1.0-r2.ebuild
similarity index 92%
rename from sci-electronics/ghdl/ghdl-4.1.0-r1.ebuild
rename to sci-electronics/ghdl/ghdl-4.1.0-r2.ebuild
index d51899749000..802fddb11784 100644
--- a/sci-electronics/ghdl/ghdl-4.1.0-r1.ebuild
+++ b/sci-electronics/ghdl/ghdl-4.1.0-r2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-ADA_COMPAT=( gcc_13 )
+ADA_COMPAT=( gcc_{13,14} )
 LLVM_COMPAT=( {16..17} )        # Check configure script for supported LLVM 
versions.
 
 inherit ada edo llvm-r1 toolchain-funcs
@@ -45,7 +45,10 @@ BDEPEND="
        dev-util/patchelf
 "
 
-PATCHES=( "${FILESDIR}/${PN}-4.0.0_pre20231218-no-pyunit.patch" )
+PATCHES=(
+       "${FILESDIR}/${PN}-4.0.0_pre20231218-no-pyunit.patch"
+       "${FILESDIR}"/${P}-tests-fix.patch
+)
 
 pkg_setup() {
        ada_pkg_setup

Reply via email to