public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-dialup/mwavem/, net-dialup/mwavem/files/
@ 2020-11-26 10:33 David Seifert
  0 siblings, 0 replies; 2+ messages in thread
From: David Seifert @ 2020-11-26 10:33 UTC (permalink / raw
  To: gentoo-commits

commit:     c3868b2816dccb819eb62eb0570be4d0eb57e413
Author:     Jakov Smolic <jakov.smolic <AT> sartura <DOT> hr>
AuthorDate: Thu Nov 26 10:32:45 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 10:32:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3868b28

net-dialup/mwavem: port to EAPI 7

Closes: https://github.com/gentoo/gentoo/pull/18402
Closes: https://bugs.gentoo.org/724974
Closes: https://bugs.gentoo.org/707684
Package-Manager: Portage-3.0.9, Repoman-3.0.1
Signed-off-by: Jakov Smolic <jakov.smolic <AT> sartura.hr>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 net-dialup/mwavem/files/mwavem-2.0-ar.patch        | 10 ++++++
 .../mwavem/files/mwavem-2.0-fno-common.patch       | 22 ++++++++++++
 net-dialup/mwavem/mwavem-2.0-r2.ebuild             | 40 ++++++++++++----------
 3 files changed, 54 insertions(+), 18 deletions(-)

diff --git a/net-dialup/mwavem/files/mwavem-2.0-ar.patch b/net-dialup/mwavem/files/mwavem-2.0-ar.patch
new file mode 100644
index 00000000000..b0ce341ae6f
--- /dev/null
+++ b/net-dialup/mwavem/files/mwavem-2.0-ar.patch
@@ -0,0 +1,10 @@
+--- a/configure.in
++++ b/configure.in
+@@ -12,6 +12,7 @@ dnl Find programs for building and installation.
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_PROG_INSTALL
++AM_PROG_AR
+ 
+ dnl Check for libraries
+ AC_CHECK_LIB(pthread, main)

diff --git a/net-dialup/mwavem/files/mwavem-2.0-fno-common.patch b/net-dialup/mwavem/files/mwavem-2.0-fno-common.patch
new file mode 100644
index 00000000000..02e5b4780fd
--- /dev/null
+++ b/net-dialup/mwavem/files/mwavem-2.0-fno-common.patch
@@ -0,0 +1,22 @@
+--- a/src/include/unidiags.h
++++ b/src/include/unidiags.h
+@@ -65,7 +65,7 @@ bits    Source bits     Definition
+ 
+ #define BIT(x)                (1<<x)
+ 
+-UINT shit;
++extern UINT shit;
+ 
+ typedef struct _V34INFO {                /* for key 18 */
+        UINT INFOa_bits4049  :10;
+--- a/src/manager/dspsrv.c
++++ b/src/manager/dspsrv.c
+@@ -75,7 +75,7 @@ HANDLE                hMwThread;
+ DWORD                 MwThreadId;
+ /* @TBD CRITICAL_SECTION      MwTerminateSection; */
+ BOOL                  MwTerminate = FALSE;
+-HANDLE                hDrv;
++extern HANDLE                hDrv;
+ HANDLE                hMwProcess;
+ 
+ BOOL AllocateHeaps( void );

diff --git a/net-dialup/mwavem/mwavem-2.0-r2.ebuild b/net-dialup/mwavem/mwavem-2.0-r2.ebuild
index c682b08f9ea..fa58e465d95 100644
--- a/net-dialup/mwavem/mwavem-2.0-r2.ebuild
+++ b/net-dialup/mwavem/mwavem-2.0-r2.ebuild
@@ -1,12 +1,9 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="5"
+EAPI=7
 
-AT_M4DIR="m4"
-AUTOTOOLS_AUTORECONF=1
-
-inherit autotools-utils
+inherit autotools
 
 DESCRIPTION="User level application for IBM Mwave modem"
 HOMEPAGE="http://oss.software.ibm.com/acpmodem/"
@@ -16,37 +13,44 @@ LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="amd64 x86"
 
-DOCS=( AUTHORS ChangeLog FAQ NEWS README README.devfs THANKS )
-
 PATCHES=(
-	"${FILESDIR}/${P}-gentoo.patch"
-	"${FILESDIR}/${P}-glibc-2.10.patch"
+	"${FILESDIR}"/${P}-gentoo.patch
+	"${FILESDIR}"/${P}-glibc-2.10.patch
+	"${FILESDIR}"/${P}-fno-common.patch
+	"${FILESDIR}"/${P}-ar.patch
 )
 
+HTML_DOCS=( doc/mwave.html )
+
+src_prepare() {
+	default
+	rm README.freebsd || die
+	mv configure.{in,ac} || die
+	AT_M4DIR=m4 eautoreconf
+}
+
 src_install() {
-	autotools-utils_src_install
+	default
 
-	dosbin "${FILESDIR}/mwave-dev-handler"
+	dosbin "${FILESDIR}"/mwave-dev-handler
 
 	insinto /etc/devfs.d
-	newins "${FILESDIR}/mwave.devfs" mwave
+	newins "${FILESDIR}"/mwave.devfs mwave
 
 	insinto /etc/modprobe.d
-	newins "${FILESDIR}/mwave.modules" mwave.conf
+	newins "${FILESDIR}"/mwave.modules mwave.conf
 
-	docinto doc
 	dodoc doc/mwave.sgml doc/mwave.txt
-	dohtml doc/mwave.html
 }
 
 pkg_postinst() {
-	if [ -e "${ROOT}/dev/.devfsd" ]; then
+	if [[ -e "${EROOT}"/dev/.devfsd ]]; then
 		# device node is created by devfs
 		ebegin "Restarting devfsd to reread devfs rules"
 			killall -HUP devfsd
 		eend $?
 	else
 		elog "Create device node if needed, using command like this:"
-		elog "# mknod --mode=0660 \"${ROOT}/dev/modems/mwave\" c 10 219"
+		elog "# mknod --mode=0660 \"${EROOT}/dev/modems/mwave\" c 10 219"
 	fi
 }


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

* [gentoo-commits] repo/gentoo:master commit in: net-dialup/mwavem/, net-dialup/mwavem/files/
@ 2025-02-10  8:56 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2025-02-10  8:56 UTC (permalink / raw
  To: gentoo-commits

commit:     bddf10139c64151ed822ad7adadea7162c63637f
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Sun Jan 26 09:09:15 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb 10 08:55:00 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bddf1013

net-dialup/mwavem: update EAPI 7 -> 8, fix compilation errors

Fixes C23 problems and difference in pthread_t between musl and glibc
Included in C23 problems: Actual usage of va_args instead of handrolled
pointers, system includes, removal of redefinitions of system functions
and completion of externs with function arguments.

Closes: https://bugs.gentoo.org/897844
Closes: https://bugs.gentoo.org/715926
Closes: https://bugs.gentoo.org/945184
Closes: https://bugs.gentoo.org/921186
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40311
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-dialup/mwavem/files/mwavem-2.0-C23.patch     | 128 +++++++++++++++++++++++
 net-dialup/mwavem/files/mwavem-2.0-pthread.patch |  14 +++
 net-dialup/mwavem/mwavem-2.0-r3.ebuild           |  57 ++++++++++
 3 files changed, 199 insertions(+)

diff --git a/net-dialup/mwavem/files/mwavem-2.0-C23.patch b/net-dialup/mwavem/files/mwavem-2.0-C23.patch
new file mode 100644
index 000000000000..d9c269b45d12
--- /dev/null
+++ b/net-dialup/mwavem/files/mwavem-2.0-C23.patch
@@ -0,0 +1,128 @@
+Just use system definitions and don't shortcut externs,
+wherever possible.
+There's a default way to use va_args, don't reinvent wheel
+https://bugs.gentoo.org/715926
+https://bugs.gentoo.org/921186
+https://bugs.gentoo.org/945184
+--- a/configure.in
++++ b/configure.in
+@@ -5,6 +5,7 @@
+ 
+ dnl Find operating system, vendor, architecture
+ AC_CANONICAL_SYSTEM
++AC_USE_SYSTEM_EXTENSIONS
+ 
+ AM_INIT_AUTOMAKE(mwavem,2.0)
+ 
+--- a/src/meio/meiovect.c
++++ b/src/meio/meiovect.c
+@@ -65,14 +65,14 @@
+ /*   external function declarations					  */
+ /*------------------------------------------------------------------------*/
+ 
+-extern ULONG APIENTRY dspMeioOpeni();
+-extern ULONG dspMeioClosei();
+-extern ULONG APIENTRY dspMeioQueryi();
+-extern ULONG APIENTRY dspMeioConnecti();
+-extern ULONG APIENTRY dspMeioDisconnecti();
+-extern ULONG APIENTRY dspMeioUpdateConnectioni();
+-extern ULONG APIENTRY dspMeioQueryConnectioni();
+-extern ULONG APIENTRY dspMeioResynci();
++extern ULONG APIENTRY dspMeioOpeni(HDSP hDsp, HMEIO FAR *phMeio, ULONG Options);
++extern ULONG dspMeioClosei(HMEIO hMeio, ULONG Options);
++extern ULONG APIENTRY dspMeioQueryi(HMEIO MMeio, MEIO_QUERYTYPE Request, ULONG FAR *fpBufferSize, VOID FAR *fpBuffer);
++extern ULONG APIENTRY dspMeioConnecti(HMEIO hMeio, HCONNECTION FAR *fpConnection, ULONG OwnerPort, ULONG UserPort, ULONG SharingOptions, ULONG ulState, ULONG Reserved);
++extern ULONG APIENTRY dspMeioDisconnecti(HCONNECTION hConnection, ULONG ulReserved);
++extern ULONG APIENTRY dspMeioUpdateConnectioni(HCONNECTION hConnection, MEIO_CONNECTATTRIBUTE Attribute, LONG lValue);
++extern ULONG APIENTRY dspMeioQueryConnectioni(HCONNECTION hConnection, MEIO_CONNECTATTRIBUTE Attribute, LONG FAR *fpValue);
++extern ULONG APIENTRY dspMeioResynci(MEIO_OBJ_TYPE ObjectType, ULONG Object, ULONG ulOptions);
+ 
+ /*------------------------------------------------------------------------*/
+ /* MeioAPIDispatch()                                                      */
+--- a/src/mwmlw32/mwmload.c
++++ b/src/mwmlw32/mwmload.c
+@@ -53,6 +53,7 @@
+ #include <sys/timeb.h>
+ #include <time.h>
+ #include <mwqservr.h>
++#include <stdarg.h>
+ #include "mww32.h"
+ /*#include <pbmplus.h>*/
+ #include <mwave.h>
+@@ -74,6 +75,8 @@
+ #define MODNAME "MWMODEM"
+ void mwavem_dprintf(char *szFormat, ...)
+ {
++  va_list args;
++  va_start(args, szFormat);
+   /*if (usDebugWindow)
+   {*/
+     struct timeb timebuffer;
+@@ -91,11 +94,12 @@
+       else
+         strcpy(ach, MODNAME ": ");
+ 
+-    vsprintf(ach+strlen(ach),szFormat,(char *)(&szFormat+1));
++    vsprintf(ach+strlen(ach),szFormat, args);
+     strcat(ach, "\r\n");
+ 
+     OutputDebugString(ach);
+  /* } */
++  va_end(args);
+ }
+ 
+ 
+--- a/src/mwmlw32/mwmrsp.c
++++ b/src/mwmlw32/mwmrsp.c
+@@ -44,9 +44,9 @@
+  *            First release to the public
+  *
+  */
++#include <unistd.h>
+ #include <mwmspcfc.h>
+ static char szThisFile[] = "MWMRSP.C";
+-extern void swab();
+ 
+ ULONG mwmrspEchoFAXResponse(PMWM_DSPINFO pmwmDspInfo,USHORT usControlStat)
+ {
+--- a/src/mwmpw32/mwmclss2.c
++++ b/src/mwmpw32/mwmclss2.c
+@@ -1227,8 +1227,6 @@
+ 
+ 
+ 
+-extern void swab() __THROW;
+-
+ USHORT  mwmClss2FLIDCommand(STATEINFO *psi)
+ {
+   USHORT usParserStatus = 0;
+--- a/src/mwmpw32/mwmparse.c
++++ b/src/mwmpw32/mwmparse.c
+@@ -54,6 +54,7 @@
+ #include <stddef.h>
+ #include <sys/timeb.h>
+ #include <time.h>
++#include <unistd.h>
+ 
+ #include <port_types.h>
+ #include <port_functions.h>
+@@ -324,8 +325,6 @@
+   return 0;
+ }
+ 
+-extern void swab() __THROW;
+-
+ USHORT mwmParseEchoString(STATEINFO *psi,PSZ achString)
+ {
+   USHORT usParserStatus = 0;
+--- a/src/mwmutil/mwmutil.c
++++ b/src/mwmutil/mwmutil.c
+@@ -189,8 +189,6 @@
+ 
+ } /*readFile*/
+ 
+-extern char *strcasestr () __THROW __attribute_pure__;
+-
+ /* Give a file buffer, find a return ptr to section name (or NULL if not found) */
+ char * getSection(LPCTSTR lpSectionName,char *file) {    // Section name, bracket delimited
+   char *line;

diff --git a/net-dialup/mwavem/files/mwavem-2.0-pthread.patch b/net-dialup/mwavem/files/mwavem-2.0-pthread.patch
new file mode 100644
index 000000000000..27713035b000
--- /dev/null
+++ b/net-dialup/mwavem/files/mwavem-2.0-pthread.patch
@@ -0,0 +1,14 @@
+Use correct type for thread handle. It already uses pthread_t for other half of the
+assignment
+https://bugs.gentoo.org/897844
+--- a/src/manager/mwaveapi.c
++++ b/src/manager/mwaveapi.c
+@@ -79,7 +79,7 @@
+ BOOL g_bIPCSupportActive = FALSE;         // True if our IPC support layer is initialized and active
+ unsigned g_uIPCsInUse;                    // One bit per IPC in use for this subsystem
+ BOOL g_abCancellingIPCs[MWAPI_MaxIPCs];   // TRUE if we're attempting to cancel an IPC thread
+-HANDLE g_ahIPCThreads[MWAPI_MaxIPCs];     // Thread handle of IPC thread
++pthread_t g_ahIPCThreads[MWAPI_MaxIPCs];  // Thread handle of IPC thread
+ PFN g_pfnIPCNotice[MWAPI_MaxIPCs];
+ 
+ BOOL   bDspDisabled = FALSE;

diff --git a/net-dialup/mwavem/mwavem-2.0-r3.ebuild b/net-dialup/mwavem/mwavem-2.0-r3.ebuild
new file mode 100644
index 000000000000..953bbaa51b10
--- /dev/null
+++ b/net-dialup/mwavem/mwavem-2.0-r3.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="User level application for IBM Mwave modem"
+HOMEPAGE="http://oss.software.ibm.com/acpmodem/"
+SRC_URI="ftp://www-126.ibm.com/pub/acpmodem/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-gentoo.patch
+	"${FILESDIR}"/${P}-glibc-2.10.patch
+	"${FILESDIR}"/${P}-fno-common.patch
+	"${FILESDIR}"/${P}-ar.patch
+	"${FILESDIR}"/${P}-C23.patch
+	"${FILESDIR}"/${P}-pthread.patch
+)
+
+HTML_DOCS=( doc/mwave.html )
+DOCS=( doc/mwave.sgml doc/mwave.txt )
+
+src_prepare() {
+	default
+	rm README.freebsd || die
+
+	AT_M4DIR=m4 eautoreconf
+}
+
+src_install() {
+	default
+
+	dosbin "${FILESDIR}"/mwave-dev-handler
+
+	insinto /etc/devfs.d
+	newins "${FILESDIR}"/mwave.devfs mwave
+
+	insinto /etc/modprobe.d
+	newins "${FILESDIR}"/mwave.modules mwave.conf
+}
+
+pkg_postinst() {
+	if [[ -e "${EROOT}"/dev/.devfsd ]]; then
+		# device node is created by devfs
+		ebegin "Restarting devfsd to reread devfs rules"
+			killall -HUP devfsd
+		eend $?
+	else
+		elog "Create device node if needed, using command like this:"
+		elog "# mknod --mode=0660 \"${EROOT}/dev/modems/mwave\" c 10 219"
+	fi
+}


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

end of thread, other threads:[~2025-02-10  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-26 10:33 [gentoo-commits] repo/gentoo:master commit in: net-dialup/mwavem/, net-dialup/mwavem/files/ David Seifert
  -- strict thread matches above, loose matches on Subject: below --
2025-02-10  8: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