public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-libs/netwib/files/, net-libs/netwib/
@ 2023-03-18 21:23 David Seifert
  0 siblings, 0 replies; only message in thread
From: David Seifert @ 2023-03-18 21:23 UTC (permalink / raw
  To: gentoo-commits

commit:     686d9515136b4e06bcd234438ec28aa2ffafc866
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 18 21:22:44 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Mar 18 21:22:44 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=686d9515

net-libs/netwib: fix build with clang 16

Closes: https://bugs.gentoo.org/710626
Closes: https://bugs.gentoo.org/828721
Closes: https://bugs.gentoo.org/879735
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../netwib/files/netwib-5.39.0-C99-decls.patch     | 19 +++++
 net-libs/netwib/files/netwib-5.39.0-config.patch   | 35 +++++++++
 .../netwib/files/netwib-5.39.0-sched_yield.patch   | 85 ++++++++++++++++++++++
 net-libs/netwib/netwib-5.39.0-r1.ebuild            | 56 ++++++++++++++
 net-libs/netwib/netwib-5.39.0.ebuild               | 61 ----------------
 5 files changed, 195 insertions(+), 61 deletions(-)

diff --git a/net-libs/netwib/files/netwib-5.39.0-C99-decls.patch b/net-libs/netwib/files/netwib-5.39.0-C99-decls.patch
new file mode 100644
index 000000000000..4509b3703160
--- /dev/null
+++ b/net-libs/netwib/files/netwib-5.39.0-C99-decls.patch
@@ -0,0 +1,19 @@
+--- a/genemake
++++ b/genemake
+@@ -1279,6 +1279,7 @@
+ 
+ #---
+ cat > `checkcompilfile` <<EOF
++ #include <string.h>
+  int ether_hostton(char *para1, char *para2);
+  int main(void)
+  { char p1[10], p2[10];
+@@ -1668,7 +1669,7 @@
+  #include <pwd.h>
+  #include <grp.h>
+  int main(void)
+- { getgrgid_r(NULL, NULL, NULL, 0, NULL);
++ { getgrgid_r(0, NULL, NULL, 0, NULL);
+    return(0);
+  }
+ EOF

diff --git a/net-libs/netwib/files/netwib-5.39.0-config.patch b/net-libs/netwib/files/netwib-5.39.0-config.patch
new file mode 100644
index 000000000000..922c9d0dd887
--- /dev/null
+++ b/net-libs/netwib/files/netwib-5.39.0-config.patch
@@ -0,0 +1,35 @@
+--- a/config.dat
++++ b/config.dat
+@@ -7,11 +7,11 @@
+ 
+ ##########################################################################
+ ### directories where netwib will be installed
+-NETWIBDEF_INSTPREFIX=/usr/local
++NETWIBDEF_INSTPREFIX="${EPREFIX}/usr"
+ NETWIBDEF_INSTINCLUDE=${NETWIBDEF_INSTPREFIX}/include
+ NETWIBDEF_INSTLIB=${NETWIBDEF_INSTPREFIX}/lib
+ NETWIBDEF_INSTBIN=${NETWIBDEF_INSTPREFIX}/bin
+-NETWIBDEF_INSTMAN=${NETWIBDEF_INSTPREFIX}/man
++NETWIBDEF_INSTMAN=${NETWIBDEF_INSTPREFIX}/share/man
+ NETWIBDEF_INSTMAN3=${NETWIBDEF_INSTMAN}/man3
+ 
+ ### installation destination directory
+@@ -19,14 +19,14 @@
+ 
+ ##########################################################################
+ ### programs
+-NETWIBDEF_PROGCC=gcc
+-NETWIBDEF_PROGAR=ar
+-NETWIBDEF_PROGRANLIB=ranlib
++NETWIBDEF_PROGCC="${CC}"
++NETWIBDEF_PROGAR="${AR}"
++NETWIBDEF_PROGRANLIB="${RANLIB}"
+ NETWIBDEF_PROGGREP=grep
+ 
+ ##########################################################################
+ ### compiler options
+-NETWIBDEF_PROGCC_OPT="-Wall -O2"
++NETWIBDEF_PROGCC_OPT="${CFLAGS:-} ${CPPFLAGS:-}"
+ NETWIBDEF_PROGCC_INC=""
+ NETWIBDEF_PROGCC_LIB=""
+ NETWIBDEF_PROGCC_OPTPIC=""

diff --git a/net-libs/netwib/files/netwib-5.39.0-sched_yield.patch b/net-libs/netwib/files/netwib-5.39.0-sched_yield.patch
new file mode 100644
index 000000000000..06bb248bc949
--- /dev/null
+++ b/net-libs/netwib/files/netwib-5.39.0-sched_yield.patch
@@ -0,0 +1,85 @@
+--- a/genemake
++++ b/genemake
+@@ -1598,21 +1598,6 @@
+ fi
+ 
+ #---
+-NETWIBDEF_HAVEFUNC_PTHREAD_YIELD=0
+-if [ $NETWIBDEF_HAVEINCL_PTHREAD = 1 ] ; then
+-  cat > `checkcompilfile` <<EOF
+-   #include <pthread.h>
+-   int main(void)
+-   { pthread_yield();
+-     return(0);
+-   }
+-EOF
+-  checkcompilstd "pthread_yield" "" "" ""
+-  NETWIBDEF_HAVEFUNC_PTHREAD_YIELD=`checkcompilyes`
+-  checkceclean
+-fi
+-
+-#---
+ NETWIBDEF_HAVEFUNC_SCHED_YIELD=0
+ if [ $NETWIBDEF_HAVEINCL_SCHED = 1 ] ; then
+   cat > `checkcompilfile` <<EOF
+@@ -2042,7 +2027,6 @@
+ echo "#define NETWIBDEF_HAVEFUNC_PTHREAD_MUTEX_TIMEDLOCK $NETWIBDEF_HAVEFUNC_PTHREAD_MUTEX_TIMEDLOCK" >> $deffile
+ echo "#define NETWIBDEF_HAVEFUNC_PTHREAD_RWLOCK_TIMEDRDLOCK $NETWIBDEF_HAVEFUNC_PTHREAD_RWLOCK_TIMEDRDLOCK" >> $deffile
+ echo "#define NETWIBDEF_HAVEFUNC_PTHREAD_RWLOCK_TIMEDWRLOCK $NETWIBDEF_HAVEFUNC_PTHREAD_RWLOCK_TIMEDWRLOCK" >> $deffile
+-echo "#define NETWIBDEF_HAVEFUNC_PTHREAD_YIELD $NETWIBDEF_HAVEFUNC_PTHREAD_YIELD" >> $deffile
+ echo "#define NETWIBDEF_HAVEFUNC_SCHED_YIELD $NETWIBDEF_HAVEFUNC_SCHED_YIELD" >> $deffile
+ echo "#define NETWIBDEF_HAVEFUNC_GETPWNAM_R $NETWIBDEF_HAVEFUNC_GETPWNAM_R" >> $deffile
+ echo "#define NETWIBDEF_HAVEFUNC_GETGRNAM_R $NETWIBDEF_HAVEFUNC_GETGRNAM_R" >> $deffile
+@@ -2205,7 +2189,6 @@
+     HAVEFUNC_PTHREAD_MUTEX_TIMEDLOCK) echo $NETWIBDEF_HAVEFUNC_PTHREAD_MUTEX_TIMEDLOCK ;;
+     HAVEFUNC_PTHREAD_RWLOCK_TIMEDRDLOCK) echo $NETWIBDEF_HAVEFUNC_PTHREAD_RWLOCK_TIMEDRDLOCK ;;
+     HAVEFUNC_PTHREAD_RWLOCK_TIMEDWRLOCK) echo $NETWIBDEF_HAVEFUNC_PTHREAD_RWLOCK_TIMEDWRLOCK ;;
+-    HAVEFUNC_PTHREAD_YIELD) echo $NETWIBDEF_HAVEFUNC_PTHREAD_YIELD ;;
+     HAVEFUNC_SCHED_YIELD) echo $NETWIBDEF_HAVEFUNC_SCHED_YIELD ;;
+     HAVEFUNC_GETPWNAM_R) echo $NETWIBDEF_HAVEFUNC_GETPWNAM_R ;;
+     HAVEFUNC_GETGRNAM_R) echo $NETWIBDEF_HAVEFUNC_GETGRNAM_R ;;
+--- a/netwib/def_windows.h
++++ b/netwib/def_windows.h
+@@ -100,7 +100,6 @@
+ #define NETWIBDEF_HAVEFUNC_PTHREAD_MUTEX_TIMEDLOCK 0
+ #define NETWIBDEF_HAVEFUNC_PTHREAD_RWLOCK_TIMEDRDLOCK 0
+ #define NETWIBDEF_HAVEFUNC_PTHREAD_RWLOCK_TIMEDWRLOCK 0
+-#define NETWIBDEF_HAVEFUNC_PTHREAD_YIELD 0
+ #define NETWIBDEF_HAVEFUNC_SCHED_YIELD 0
+ #define NETWIBDEF_HAVEFUNC_GETPWNAM_R 0
+ #define NETWIBDEF_HAVEFUNC_GETGRNAM_R 0
+--- a/netwib/inc/missing.h
++++ b/netwib/inc/missing.h
+@@ -3,7 +3,6 @@
+ #if 0
+ /* Some systems have the function in their library, but
+    prototypes are missing. Those one can be used instead. */
+- int pthread_yield(void);
+  int getpagesize(void);
+  int usleep(unsigned int useconds);
+  int getpwnam_r(const char *name,
+--- a/netwib/sys/internal.c
++++ b/netwib/sys/internal.c
+@@ -221,8 +221,6 @@
+               NETWIBDEF_HAVEFUNC_PTHREAD_RWLOCK_TIMEDRDLOCK);
+   netwib_co_i("NETWIBDEF_HAVEFUNC_PTHREAD_RWLOCK_TIMEDWRLOCK",
+               NETWIBDEF_HAVEFUNC_PTHREAD_RWLOCK_TIMEDWRLOCK);
+-  netwib_co_i("NETWIBDEF_HAVEFUNC_PTHREAD_YIELD",
+-              NETWIBDEF_HAVEFUNC_PTHREAD_YIELD);
+   netwib_co_i("NETWIBDEF_HAVEFUNC_SCHED_YIELD",
+               NETWIBDEF_HAVEFUNC_SCHED_YIELD);
+   netwib_co_i("NETWIBDEF_HAVEFUNC_GETPWNAM_R",
+--- a/netwib/sys/priv/pause.c
++++ b/netwib/sys/priv/pause.c
+@@ -6,10 +6,7 @@
+ {
+ 
+ #if defined NETWIBDEF_SYSNAME_Unix
+- #if NETWIBDEF_HAVEFUNC_PTHREAD_YIELD == 1
+-  pthread_yield();
+-  return(NETWIB_ERR_OK);
+- #elif NETWIBDEF_HAVEFUNC_SCHED_YIELD == 1
++ #if NETWIBDEF_HAVEFUNC_SCHED_YIELD == 1
+   sched_yield();
+   return(NETWIB_ERR_OK);
+  #endif

diff --git a/net-libs/netwib/netwib-5.39.0-r1.ebuild b/net-libs/netwib/netwib-5.39.0-r1.ebuild
new file mode 100644
index 000000000000..21a268557647
--- /dev/null
+++ b/net-libs/netwib/netwib-5.39.0-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# NOTE: netwib, netwox and netwag go together, bump all or bump none
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Library of Ethernet, IP, UDP, TCP, ICMP, ARP and RARP protocols"
+HOMEPAGE="
+	http://www.laurentconstantin.com/en/netw/netwib/
+	http://ntwib.sourceforge.net/
+"
+SRC_URI="
+	mirror://sourceforge/ntwib/${P}-src.tgz
+	doc? ( mirror://sourceforge/ntwib/${P}-doc_html.tgz )"
+S="${WORKDIR}/${P}-src/src"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc x86"
+IUSE="doc"
+
+DEPEND="
+	net-libs/libnet:1.1
+	net-libs/libpcap"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-C99-decls.patch
+	"${FILESDIR}"/${P}-config.patch
+	"${FILESDIR}"/${P}-sched_yield.patch
+)
+
+src_configure() {
+	tc-export AR CC RANLIB
+	sed -e "s:/lib:/$(get_libdir):" \
+		-i config.dat || die
+
+	sh genemake || die
+}
+
+src_install() {
+	default
+
+	dodoc \
+		../README.TXT \
+		../doc/{changelog.txt,credits.txt,integration.txt} \
+		../doc/{problemreport.txt,problemusageunix.txt,todo.txt}
+
+	if use doc; then
+		docinto html
+		dodoc -r "${WORKDIR}"/${P}-doc_html/{index.html,${PN}}
+	fi
+}

diff --git a/net-libs/netwib/netwib-5.39.0.ebuild b/net-libs/netwib/netwib-5.39.0.ebuild
deleted file mode 100644
index c73eb6097f01..000000000000
--- a/net-libs/netwib/netwib-5.39.0.ebuild
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# NOTE: netwib, netwox and netwag go together, bump all or bump none
-
-EAPI=8
-
-inherit toolchain-funcs
-
-DESCRIPTION="Library of Ethernet, IP, UDP, TCP, ICMP, ARP and RARP protocols"
-HOMEPAGE="
-	http://www.laurentconstantin.com/en/netw/netwib/
-	http://ntwib.sourceforge.net/
-"
-SRC_URI="mirror://sourceforge/ntwib/${P}-src.tgz
-	doc? ( mirror://sourceforge/ntwib/${P}-doc_html.tgz )"
-S="${WORKDIR}/${P}-src/src"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~amd64 ~hppa ~ppc x86"
-IUSE="doc"
-
-DEPEND="
-	net-libs/libnet:1.1
-	net-libs/libpcap
-"
-RDEPEND="${DEPEND}"
-
-src_prepare() {
-	default
-
-	sed -i \
-		-e 's:/man$:/share/man:g' \
-		-e "s:/lib:/$(get_libdir):" \
-		-e "s:/usr/local:/usr:" \
-		-e "s:=ar:=$(tc-getAR):" \
-		-e "s:=ranlib:=$(tc-getRANLIB):" \
-		-e "s:=gcc:=$(tc-getCC):" \
-		-e "s:-O2:${CFLAGS}:" \
-		config.dat || die
-}
-
-src_configure() {
-	sh genemake || die
-}
-
-src_install() {
-	default
-	dodoc ../README.TXT
-	if use doc; then
-		mkdir "${ED}"/usr/share/doc/${PF}/html || die
-		mv "${WORKDIR}"/${P}-doc_html/{index.html,${PN}} \
-			"${ED}"/usr/share/doc/${PF}/html || die
-	fi
-
-	cd "${S}"/.. || die
-	dodoc \
-		doc/{changelog.txt,credits.txt,integration.txt} \
-		doc/{problemreport.txt,problemusageunix.txt,todo.txt}
-}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-18 21:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-18 21:23 [gentoo-commits] repo/gentoo:master commit in: net-libs/netwib/files/, net-libs/netwib/ David Seifert

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