public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/libsmi/files/, net-libs/libsmi/
Date: Thu,  8 Sep 2022 03:56:25 +0000 (UTC)	[thread overview]
Message-ID: <1662609369.2360d9ea66979cfa5aa408ea50928074ce7ab8af.sam@gentoo> (raw)

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
+}


             reply	other threads:[~2022-09-08  3:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  3:56 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-09-12 16:51 [gentoo-commits] repo/gentoo:master commit in: net-libs/libsmi/files/, net-libs/libsmi/ Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1662609369.2360d9ea66979cfa5aa408ea50928074ce7ab8af.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox