public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-libs/libsmi/files/, net-libs/libsmi/
@ 2022-09-08  3:56 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2022-09-08  3:56 UTC (permalink / raw
  To: gentoo-commits

commit:     2360d9ea66979cfa5aa408ea50928074ce7ab8af
Author:     Nicholas Vinson <nvinson234 <AT> gmail <DOT> com>
AuthorDate: Thu Sep  8 03:54:03 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Sep  8 03:56:09 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2360d9ea

net-libs/libsmi: fix build with Clang 15 (implicit function declarations)

Signed-off-by: Nicholas Vinson <nvinson234 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...bsmi-0.5.0-implicit-function-declarations.patch | 74 ++++++++++++++++++++++
 net-libs/libsmi/libsmi-0.5.0-r2.ebuild             | 38 +++++++++++
 2 files changed, 112 insertions(+)

diff --git a/net-libs/libsmi/files/libsmi-0.5.0-implicit-function-declarations.patch b/net-libs/libsmi/files/libsmi-0.5.0-implicit-function-declarations.patch
new file mode 100644
index 000000000000..f0d52e4ae000
--- /dev/null
+++ b/net-libs/libsmi/files/libsmi-0.5.0-implicit-function-declarations.patch
@@ -0,0 +1,74 @@
+From: Nicholas Vinson <nvinson234@gmail.com>
+To: libsmi@ibr.cs.tu-bs.de
+Cc: Nicholas Vinson <nvinson234@gmail.com>
+Subject: Implicit function declaration patch
+
+When building libsmi with clang 15.0.0, clang fails to build due to
+errors similar to:
+
+call to undeclared function 'smiyyerror'; ISO C99 and later do not support
+implicit function declarations
+
+This patch corrects those issues by introducing the needed
+declarations defore the function call.
+
+Thanks,
+Nicholas Vinson
+
+--- a/lib/yang-data.h
++++ b/lib/yang-data.h
+@@ -158,10 +158,12 @@ _YangIdentifierRef  *listIdentifierRef(Y
+ /*
+  *  Node and Module functions
+  */
+ _YangNode *addYangNode(const char *value, YangDecl nodeKind, _YangNode *parentPtr);
+ 
++void createIdentifierRef(_YangNode *node, char* prefix, char* ident);
++
+ int removeYangNode(_YangNode* target, _YangNode* child);
+ 
+ _YangModuleInfo *createModuleInfo(_YangNode *modulePtr);
+ 
+ void createTypeInfo(_YangNode *node);
+--- a/lib/parser-yang.y
++++ b/lib/parser-yang.y
+@@ -19,10 +19,15 @@
+ #include <config.h>
+     
+ #ifdef BACKEND_YANG
+ 
+ #define _ISOC99_SOURCE
++/* define _DEFAULT_SOURCE to get timegm() */
++#define _DEFAULT_SOURCE 1
++/* define _BSD_SOURCE & _SVID_SOURCE for backwards compatibility */
++#define _BSD_SOURCE 1
++#define _SVID_SOURCE 1
+ #include <stdio.h>
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <ctype.h>
+@@ -44,10 +44,11 @@
+ #include "parser-yang.h"
+ #include "scanner-yang.h"
+ #include "yang-complex-types.h"
+ #include "util.h"
+ #include "error.h"
++#include "yang-check.h"
+     
+ #ifdef HAVE_DMALLOC_H
+ #include <dmalloc.h>
+ #endif
+ 
+--- a/lib/error.h
++++ b/lib/error.h
+@@ -40,6 +40,8 @@ extern char* smiGetErrorMsg(int id);
+ 
+ extern void smiPrintError(Parser *parser, int id, ...);
+ 
+ extern void smiPrintErrorAtLine(Parser *parser, int id, int line, ...);
+ 
++#include "smi-check.h"
++
+ #endif /* _ERROR_H */
+

diff --git a/net-libs/libsmi/libsmi-0.5.0-r2.ebuild b/net-libs/libsmi/libsmi-0.5.0-r2.ebuild
new file mode 100644
index 000000000000..1473aeacf5c6
--- /dev/null
+++ b/net-libs/libsmi/libsmi-0.5.0-r2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="A Library to Access SMI MIB Information"
+HOMEPAGE="https://www.ibr.cs.tu-bs.de/projects/libsmi/"
+SRC_URI="https://www.ibr.cs.tu-bs.de/projects/libsmi/download/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="static-libs"
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.5.0-implicit-function-declarations.patch
+)
+
+src_configure() {
+	econf $(use_enable static-libs static)
+}
+
+src_test() {
+	# sming test is known to fail and some other fail if LC_ALL!=C:
+	# https://mail.ibr.cs.tu-bs.de/pipermail/libsmi/2008-March/001014.html
+	sed -i '/^[[:space:]]*smidump-sming.test \\$/d' test/Makefile
+	LC_ALL=C emake -j1 check
+}
+
+src_install() {
+	default
+
+	dodoc ANNOUNCE ChangeLog README THANKS TODO \
+		doc/{*.txt,smi.dia,smi.dtd,smi.xsd} smi.conf-example
+
+	find "${ED}" -name '*.la' -delete || die
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-libs/libsmi/files/, net-libs/libsmi/
@ 2022-09-12 16:51 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2022-09-12 16:51 UTC (permalink / raw
  To: gentoo-commits

commit:     f06c026637c9e42deb6e8b0efe45fe3634475d6e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 12 16:43:52 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 16:43:52 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f06c0266

net-libs/libsmi: fix configure tests with Clang 15

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/libsmi-0.5.0-clang-15-configure.patch    | 42 ++++++++++++++++++++++
 ...bsmi-0.5.0-r2.ebuild => libsmi-0.5.0-r3.ebuild} |  8 +++++
 2 files changed, 50 insertions(+)

diff --git a/net-libs/libsmi/files/libsmi-0.5.0-clang-15-configure.patch b/net-libs/libsmi/files/libsmi-0.5.0-clang-15-configure.patch
new file mode 100644
index 000000000000..7955c4a36f6a
--- /dev/null
+++ b/net-libs/libsmi/files/libsmi-0.5.0-clang-15-configure.patch
@@ -0,0 +1,42 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -43,7 +43,8 @@ CC="$withval")
+ 
+ AC_MSG_CHECKING([for additional required compiler flags])
+ AC_TRY_RUN([#include <stdio.h>
+-  main() {
++  #include <stdlib.h>
++  int main() {
+   #ifdef __SUNPRO_C
+         exit(0);
+   #else
+@@ -105,7 +106,8 @@ dirseparator="$withval", dirseparator="")
+ AC_MSG_CHECKING([for path separator character])
+ if test "$pathseparator" = "" ; then
+   AC_TRY_RUN([#include <stdio.h>
+-    main() {
++    #include <stdlib.h>
++    int main() {
+     #ifdef _WIN32
+ 	  exit(0);
+     #else
+@@ -119,7 +121,8 @@ echo $pathseparator
+ AC_MSG_CHECKING([for dir separator character])
+ if test "$dirseparator" = "" ; then
+   AC_TRY_RUN([#include <stdio.h>
+-    main() {
++    #include <stdlib.h>
++    int main() {
+     #ifdef _WIN32
+ 	  exit(0);
+     #else
+@@ -145,7 +148,8 @@ AC_MSG_CHECKING([for 64 bit types])
+ # if used with the (correct) value -9223372036854775808LL.
+ #
+ AC_TRY_RUN([#include <stdio.h>
+-      main() {
++      #include <stdlib.h>
++      int main() {
+ 	  long long ll;
+ 	  unsigned long long ull;
+ 	  exit(0);

diff --git a/net-libs/libsmi/libsmi-0.5.0-r2.ebuild b/net-libs/libsmi/libsmi-0.5.0-r3.ebuild
similarity index 90%
rename from net-libs/libsmi/libsmi-0.5.0-r2.ebuild
rename to net-libs/libsmi/libsmi-0.5.0-r3.ebuild
index 92b2580e9492..ef7935dddac7 100644
--- a/net-libs/libsmi/libsmi-0.5.0-r2.ebuild
+++ b/net-libs/libsmi/libsmi-0.5.0-r3.ebuild
@@ -3,6 +3,8 @@
 
 EAPI=8
 
+inherit autotools
+
 DESCRIPTION="A Library to Access SMI MIB Information"
 HOMEPAGE="https://www.ibr.cs.tu-bs.de/projects/libsmi/ https://gitlab.ibr.cs.tu-bs.de/nm/libsmi"
 SRC_URI="https://www.ibr.cs.tu-bs.de/projects/libsmi/download/${P}.tar.gz"
@@ -20,8 +22,14 @@ BDEPEND="
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-0.5.0-implicit-function-declarations.patch
+	"${FILESDIR}"/${PN}-0.5.0-clang-15-configure.patch
 )
 
+src_prepare() {
+	default
+	eautoreconf
+}
+
 src_test() {
 	# sming test is known to fail and some other fail if LC_ALL!=C:
 	# https://mail.ibr.cs.tu-bs.de/pipermail/libsmi/2008-March/001014.html


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-12 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-12 16:51 [gentoo-commits] repo/gentoo:master commit in: net-libs/libsmi/files/, net-libs/libsmi/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2022-09-08  3:56 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox