View | Details | Raw Unified | Return to bug 58596
Collapse All | Expand All

(-)./xosview/Makefile (-7 / +23 lines)
Lines 12-28 Link Here
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
13
MASTER_SITE_SUBDIR=	${PORTNAME}
13
MASTER_SITE_SUBDIR=	${PORTNAME}
14
14
15
MAINTAINER=	ports@FreeBSD.org
15
MAINTAINER=	clsung@FreeBSD.org
16
COMMENT=	A graphical performance meter
16
COMMENT=	A graphical performance meter
17
17
18
USE_X_PREFIX=	yes
18
USE_X_PREFIX=	yes
19
GNU_CONFIGURE=	yes
19
GNU_CONFIGURE=	yes
20
USE_REINPLACE=	yes
20
MAN1=		xosview.1
21
MAN1=		xosview.1
21
22
22
.include <bsd.port.pre.mk>
23
post-patch:
24
	@${REINPLACE_CMD} -e 's,iostream.h,iostream,' \
25
		${WRKSRC}/xwin.h \
26
		${WRKSRC}/Host.h \
27
		${WRKSRC}/Xrm.cc \
28
		${WRKSRC}/llist.cc \
29
		${WRKSRC}/timeval.h \
30
		${WRKSRC}/xosview.cc
31
	@${REINPLACE_CMD} -e 's,string.h,string,' \
32
		${WRKSRC}/xwin.h \
33
		${WRKSRC}/Host.cc \
34
		${WRKSRC}/Xrm.cc \
35
		${WRKSRC}/llist.cc \
36
		${WRKSRC}/timeval.h \
37
		${WRKSRC}/xosview.cc
38
	@${REINPLACE_CMD} -e 's,fstream.h,fstream,' \
39
		${WRKSRC}/bitfieldmeter.cc \
40
		${WRKSRC}/fieldmeter.cc \
41
		${WRKSRC}/fieldmeterdecay.cc \
42
		${WRKSRC}/fieldmetergraph.cc
23
43
24
.if ${OSVERSION} >= 500113
44
.include <bsd.port.mk>
25
BROKEN=         "Does not compile (bad C++ code)"
26
.endif
27
28
.include <bsd.port.post.mk>
(-)./xosview/files/patch-Host.h (+10 lines)
Line 0 Link Here
1
--- Host.h.orig	Sun Jan 24 06:20:39 1999
2
+++ Host.h	Mon Oct 27 21:31:31 2003
3
@@ -19,6 +19,7 @@
4
 #include <arpa/inet.h>
5
 #include <iostream.h>
6
 #include "bool.h"
7
+using namespace std;
8
 
9
 class Host {
10
 public:
(-)./xosview/files/patch-Xrm.h (+11 lines)
Line 0 Link Here
1
--- Xrm.h.orig	Sun Jan 24 06:20:39 1999
2
+++ Xrm.h	Mon Oct 27 21:26:37 2003
3
@@ -16,7 +16,7 @@
4
 #include <X11/Xlib.h>
5
 #include <X11/Xresource.h>
6
 
7
-class ostream;
8
+using namespace std;
9
 
10
 class Xrm {
11
 public:
(-)./xosview/files/patch-kernel.cc (-4 / +133 lines)
Lines 1-5 Link Here
1
--- bsd/kernel.cc.orig	Mon Jul 17 11:52:31 2000
1
--- bsd/kernel.cc.orig	Tue Oct  9 10:40:51 2001
2
+++ bsd/kernel.cc	Tue Aug 21 12:23:41 2001
2
+++ bsd/kernel.cc	Mon Oct 27 20:03:03 2003
3
@@ -46,6 +46,7 @@
3
@@ -46,6 +46,7 @@
4
 #endif
4
 #endif
5
 
5
 
Lines 30-36 Link Here
30
   int	totalinuse, totalsize;
30
   int	totalinuse, totalsize;
31
   int rnswap, nswap = swapctl(SWAP_NSWAP, 0, 0);
31
   int rnswap, nswap = swapctl(SWAP_NSWAP, 0, 0);
32
   struct swapent *swapiter;
32
   struct swapent *swapiter;
33
@@ -828,25 +834,25 @@
33
@@ -557,13 +563,21 @@
34
 	 * Make sure that the userland devstat version matches the kernel
35
 	 * devstat version.
36
 	 */
37
+#if __FreeBSD_version >= 500000
38
+	if (devstat_checkversion(kd) < 0) {
39
+#else
40
 	if (checkversion() < 0) {
41
+#endif
42
 		nodisk++;
43
 		return;
44
 	}
45
 
46
 	/* find out how many devices we have */
47
+#if __FreeBSD_version >= 500000
48
+	if ((num_devices = devstat_getnumdevs(kd)) < 0) {
49
+#else
50
 	if ((num_devices = getnumdevs()) < 0) {
51
+#endif
52
 		nodisk++;
53
 		return;
54
 	}
55
@@ -578,7 +592,11 @@
56
 	 * changed here, since it almost certainly has.  We only look for
57
 	 * errors.
58
 	 */
59
+#if __FreeBSD_version >= 500000
60
+	if (devstat_getdevs(kd,&cur) == -1) {
61
+#else
62
 	if (getdevs(&cur) == -1) {
63
+#endif
64
 		nodisk++;
65
 		return;
66
 	}
67
@@ -590,7 +608,11 @@
68
 
69
 	/* only interested in disks */
70
 	matches = NULL;
71
+#if __FreeBSD_version >= 500000
72
+	if (devstat_buildmatch("da", &matches, &num_matches) != 0) {
73
+#else
74
 	if (buildmatch("da", &matches, &num_matches) != 0) {
75
+#endif
76
 		nodisk++;
77
 		return;
78
 	}
79
@@ -605,7 +627,11 @@
80
 	 * device list has changed, so we don't look for return values of 0
81
 	 * or 1.  If we get back -1, though, there is an error.
82
 	 */
83
+#if __FreeBSD_version >= 500000
84
+	if (devstat_selectdevs(&dev_select, &num_selected,
85
+#else
86
 	if (selectdevs(&dev_select, &num_selected,
87
+#endif
88
 		       &num_selections, &select_generation,
89
 		       generation, cur.dinfo->devices, num_devices,
90
 		       matches, num_matches,
91
@@ -632,7 +658,11 @@
92
 		 * the selection process again, in case a device that we
93
 		 * were previously displaying has gone away.
94
 		 */
95
+#if __FreeBSD_version >= 500000
96
+		switch (devstat_getdevs(kd,&cur)) {
97
+#else
98
 		switch (getdevs(&cur)) {
99
+#endif
100
 		case -1:
101
 			return (0);
102
 		case 1: {
103
@@ -640,7 +670,11 @@
104
 
105
 			num_devices = cur.dinfo->numdevs;
106
 			generation = cur.dinfo->generation;
107
+#if __FreeBSD_version >= 500000
108
+			retval = devstat_selectdevs(&dev_select, &num_selected,
109
+#else
110
 			retval = selectdevs(&dev_select, &num_selected,
111
+#endif
112
 					    &num_selections, &select_generation,
113
 					    generation, cur.dinfo->devices,
114
 					    num_devices, matches, num_matches,
115
@@ -664,14 +698,22 @@
116
 		 * Calculate elapsed time up front, since it's the same for all
117
 		 * devices.
118
 		 */
119
+#if __FreeBSD_version >= 500000
120
+		busy_seconds = cur.snap_time - last.snap_time;
121
+#else
122
 		busy_seconds = compute_etime(cur.busy_time, last.busy_time);
123
+#endif
124
 
125
 		/* this is the first time thru so just copy cur to last */
126
 		if (last.dinfo->numdevs == 0) {
127
 			tmp_dinfo = last.dinfo;
128
 			last.dinfo = cur.dinfo;
129
 			cur.dinfo = tmp_dinfo;
130
+#if __FreeBSD_version >= 500000
131
+			last.snap_time = cur.snap_time;
132
+#else
133
 			last.busy_time = cur.busy_time;
134
+#endif
135
 			return (0);
136
 		}
137
 
138
@@ -685,7 +727,11 @@
139
 
140
 			di = dev_select[dn].position;
141
 
142
+#if __FreeBSD_version >= 500000
143
+			if (devstat_compute_statistics(&cur.dinfo->devices[di],
144
+#else
145
 			if (compute_stats(&cur.dinfo->devices[di],
146
+#endif
147
 				  &last.dinfo->devices[di], busy_seconds,
148
 				  &total_bytes, &total_transfers,
149
 				  NULL, NULL,
150
@@ -700,7 +746,11 @@
151
 		last.dinfo = cur.dinfo;
152
 		cur.dinfo = tmp_dinfo;
153
 
154
+#if __FreeBSD_version >= 500000
155
+		last.snap_time = cur.snap_time;
156
+#else
157
 		last.busy_time = cur.busy_time;
158
+#endif
159
 
160
 	} else {
161
 		/* no disks found ? */
162
@@ -828,25 +878,25 @@
34
   OpenKDIfNeeded(); 
163
   OpenKDIfNeeded(); 
35
   nintr = (nlst[EINTRCNT_SYM_INDEX].n_value -
164
   nintr = (nlst[EINTRCNT_SYM_INDEX].n_value -
36
 	   nlst[INTRCNT_SYM_INDEX].n_value)   / sizeof(int);
165
 	   nlst[INTRCNT_SYM_INDEX].n_value)   / sizeof(int);
Lines 63-69 Link Here
63
     /* FreeBSD has an array of interrupt counts, indexed by device number.
192
     /* FreeBSD has an array of interrupt counts, indexed by device number.
64
        These are also indirected by IRQ num with intr_countp: */
193
        These are also indirected by IRQ num with intr_countp: */
65
     safe_kvm_read (nlst[INTRCOUNTP_SYM_INDEX].n_value,
194
     safe_kvm_read (nlst[INTRCOUNTP_SYM_INDEX].n_value,
66
@@ -875,8 +881,8 @@
195
@@ -875,8 +925,8 @@
67
       intrCount[i] = kvm_intrptrs[i];
196
       intrCount[i] = kvm_intrptrs[i];
68
 #endif /* _BSDI_VERSION */
197
 #endif /* _BSDI_VERSION */
69
 
198
 
(-)./xosview/files/patch-xwin.h (+10 lines)
Line 0 Link Here
1
--- xwin.h.orig	Mon Feb 25 03:52:00 2002
2
+++ xwin.h	Mon Oct 27 21:13:29 2003
3
@@ -11,6 +11,7 @@
4
 #endif
5
 #include <iostream.h>
6
 #include <string.h>
7
+using namespace std;
8
 
9
 #define XWIN_H_CVSID "$Id$"
10

Return to bug 58596