aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authortobik <tobik@FreeBSD.org>2017-08-16 03:09:51 +0800
committertobik <tobik@FreeBSD.org>2017-08-16 03:09:51 +0800
commit670fc9635bc1105fe11817d54c06696a1086dc16 (patch)
tree2a853a93cad784d1c50ec615836d062d4ec509da /net
parent918dc14ac6d3011c4b6d0d89ab5b54e855371b72 (diff)
downloadfreebsd-ports-gnome-670fc9635bc1105fe11817d54c06696a1086dc16.tar.gz
freebsd-ports-gnome-670fc9635bc1105fe11817d54c06696a1086dc16.tar.zst
freebsd-ports-gnome-670fc9635bc1105fe11817d54c06696a1086dc16.zip
net/wmwifi: Fix runtime on amd64
Currently wmwifi doesn't start on amd64 and simply fails with wmwifi: No wireless interface found! The code assumes that sizeof(int) == sizeof(size_t) which isn't the case on amd64 (and other architectures) and all sysctl() calls will fail because of it. While here: - Fix a build failure when automake+autoconf are installed in the build environment. By patching configure.in the build wants to regenerate configure which doesn't work correctly: gmake[1]: Entering directory '/usr/ports/net/wmwifi/work/wmwifi-0.4-bsd' cd . && aclocal aclocal-1.15: warning: autoconf input should be named 'configure.ac', not 'configure.in' /usr/local/share/aclocal/gdk-pixbuf.m4:12: warning: underquoted definition of AM_PATH_GDK_PIXBUF /usr/local/share/aclocal/gdk-pixbuf.m4:12: run info Automake 'Extending aclocal' /usr/local/share/aclocal/gdk-pixbuf.m4:12: or see http://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal cd . && automake --gnu Makefile automake-1.15: warning: autoconf input should be named 'configure.ac', not 'configure.in' configure.in:3: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see: configure.in:3: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation configure.in:6: error: required file './compile' not found configure.in:6: 'automake --add-missing' can install 'compile' gmake[1]: *** [Makefile:82: Makefile.in] Error 1 gmake[1]: Leaving directory '/usr/ports/net/wmwifi/work/wmwifi-0.4-bsd' *** Error code 1 Remove files/patch-configure.in and pass CFLAGS through CONFIGURE_ENV instead. - Add LICENSE, LICENSE_FILE - Add missing dependency on libXext [1] https://forums.freebsd.org/threads/61981/ PR: 221531 Reported by: forester on the FreeBSD forums [1] Approved by: uqs (maintainer) MFH: 2017Q3
Diffstat (limited to 'net')
-rw-r--r--net/wmwifi/Makefile13
-rw-r--r--net/wmwifi/files/patch-configure.in11
-rw-r--r--net/wmwifi/files/patch-wireless.c39
3 files changed, 38 insertions, 25 deletions
diff --git a/net/wmwifi/Makefile b/net/wmwifi/Makefile
index 654eece11668..6498b133676c 100644
--- a/net/wmwifi/Makefile
+++ b/net/wmwifi/Makefile
@@ -4,7 +4,7 @@
PORTNAME= wmwifi
PORTVERSION= 0.4
DISTVERSIONSUFFIX=-bsd
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= net
MASTER_SITES= http://digitalssg.net/debian/ \
LOCAL/uqs
@@ -12,11 +12,14 @@ MASTER_SITES= http://digitalssg.net/debian/ \
MAINTAINER= uqs@FreeBSD.org
COMMENT= Dockapp displaying the signal strength of WiFi connection
-GNU_CONFIGURE= yes
-USE_XORG= x11 xpm
-USES= gmake
+LICENSE= GPLv2+
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+USES= gmake localbase
+USE_XORG= x11 xext xpm
-CPPFLAGS+= -I${LOCALBASE}/include
+CONFIGURE_ENV= X_CFLAGS="${CFLAGS}"
+GNU_CONFIGURE= yes
PLIST_FILES= bin/wmwifi
diff --git a/net/wmwifi/files/patch-configure.in b/net/wmwifi/files/patch-configure.in
deleted file mode 100644
index b6ced86bb8a9..000000000000
--- a/net/wmwifi/files/patch-configure.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- configure.in.orig Sat Jul 2 14:29:13 2005
-+++ configure.in Sat Jul 2 14:29:20 2005
-@@ -11,7 +11,7 @@
- AC_PATH_XTRA
- AC_PATH_X
- dnl echo $X_CFLAGS $X_LIBS
--CFLAGS="$X_CFLAGS $X_LIBS"
-+CFLAGS="$CFLAGS $X_CFLAGS $X_LIBS"
- AC_CHECK_LIB(X11, XCopyArea, [], [], $X_LIBS)
- AC_CHECK_LIB(Xext, XShapeCombineMask, [], [], $X_LIBS)
- AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [], [], $X_LIBS)
diff --git a/net/wmwifi/files/patch-wireless.c b/net/wmwifi/files/patch-wireless.c
index 028b39ac31d1..69bf4938040f 100644
--- a/net/wmwifi/files/patch-wireless.c
+++ b/net/wmwifi/files/patch-wireless.c
@@ -1,5 +1,5 @@
---- src/wireless.c.orig 2004-03-09 20:39:17.000000000 +0100
-+++ src/wireless.c 2007-11-01 17:58:13.170763665 +0100
+--- src/wireless.c.orig 2004-03-09 19:39:17 UTC
++++ src/wireless.c
@@ -25,7 +25,13 @@
#include <net/if_mib.h>
#include <net/if_var.h>
@@ -14,7 +14,14 @@
#else
#error "sorry, your OS is not supported yet"
#endif
-@@ -143,6 +149,7 @@
+@@ -138,11 +144,13 @@ int get_wlaniface(int old, int dir)
+ int i, max, step, found, index;
+ struct ifmibdata ifmd;
+ struct ifmediareq ifmr;
+- int name[6], len, s;
++ int name[6], s;
++ size_t len;
+ char *iface[IFNAMSIZ];
max = get_max_ifs();
step = 0;
@@ -22,7 +29,7 @@
if (old > max)
old = max; /* just be sure to not be out of bounds */
-@@ -178,8 +185,8 @@
+@@ -178,8 +186,8 @@ int get_wlaniface(int old, int dir)
len = sizeof(ifmd);
sysctl(name, 6, &ifmd, &len, NULL, 0);
@@ -33,7 +40,7 @@
continue;
s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
-@@ -193,9 +200,11 @@
+@@ -193,9 +201,11 @@ int get_wlaniface(int old, int dir)
if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0)
{
@@ -47,7 +54,7 @@
}
close(s);
/* we cannot monitor interfaces in hostap mode, so just
-@@ -207,6 +216,10 @@
+@@ -207,12 +217,17 @@ int get_wlaniface(int old, int dir)
found++;
}
}
@@ -58,7 +65,21 @@
return index;
}
/* how many interfaces do we have? this includes non-wireless! */
-@@ -224,9 +237,18 @@
+ int get_max_ifs(void)
+ {
+- int count, len;
++ int count;
++ size_t len;
+
+ len = sizeof(count);
+ sysctlbyname("net.link.generic.system.ifcount", &count, &len, NULL, 0);
+@@ -220,13 +235,23 @@ int get_max_ifs(void)
+ }
+ int wifi_info(struct wifi *wfi)
+ {
+- int name[6], len; /* interface name */
++ int name[6]; /* interface name */
++ size_t len;
struct ifmibdata ifmd;
struct ifreq ifr; /* interface stats */
@@ -77,7 +98,7 @@
/* lets find the current interface name */
name[0] = CTL_NET;
name[1] = PF_LINK;
-@@ -247,13 +269,38 @@
+@@ -247,13 +272,38 @@ int wifi_info(struct wifi *wfi)
perror("socket");
exit(1);
}
@@ -117,7 +138,7 @@
strncpy(ifr.ifr_name, wfi->ifname, strlen(wfi->ifname));
wireq.wi_type = WI_RID_COMMS_QUALITY;
wireq.wi_len = WI_MAX_DATALEN;
-@@ -272,7 +319,7 @@
+@@ -272,7 +322,7 @@ int wifi_info(struct wifi *wfi)
* wi_val[2] = noise
*/
wfi->link = (int) wireq.wi_val[1];