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

(-)Makefile (-14 / +7 lines)
Lines 6-22 Link Here
6
#
6
#
7
7
8
PORTNAME=	icewm
8
PORTNAME=	icewm
9
PORTVERSION=	1.2.37
9
PORTVERSION=	1.3.7
10
PORTREVISION=	5
11
CATEGORIES=	x11-wm
10
CATEGORIES=	x11-wm
12
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-stable/${PORTVERSION}
11
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-${PORTVERSION:R}/${PORTVERSION}/
13
12
14
MAINTAINER=	ports@eitanadler.com
13
MAINTAINER=	ports@eitanadler.com
15
COMMENT=	Window Manager designed for speed, usability and consistency
14
COMMENT=	Window Manager designed for speed, usability and consistency
16
15
17
WANT_GNOME=	yes
16
WANT_GNOME=	yes
18
USE_XORG=	x11 ice xinerama xext xrandr
17
USE_XORG=	x11 ice xinerama xext xrandr
19
USE_GNOME=	gnometarget
18
USE_GNOME=	gnometarget gtk20 # gdkpixbuf really :-)
20
USE_GMAKE=	yes
19
USE_GMAKE=	yes
21
GNU_CONFIGURE=	yes
20
GNU_CONFIGURE=	yes
22
CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib"
21
CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib"
Lines 29-35 Link Here
29
		--with-mkfontdir=${NONEXISTENT}
28
		--with-mkfontdir=${NONEXISTENT}
30
29
31
OPTIONS=	GNOMEDESKTOP	"Enable GNOME desktop support"		off \
30
OPTIONS=	GNOMEDESKTOP	"Enable GNOME desktop support"		off \
32
		IMLIB		"Build with Imlib support"		on \
33
		ESOUND		"Enable EsounD daemon support"		off \
31
		ESOUND		"Enable EsounD daemon support"		off \
34
		XFT		"Enable Xft support for fonts"		on \
32
		XFT		"Enable Xft support for fonts"		on \
35
		XINERAMA	"Enable Xinerama support"		off \
33
		XINERAMA	"Enable Xinerama support"		off \
Lines 38-44 Link Here
38
		NLS		"Enable National Language Support"	on
36
		NLS		"Enable National Language Support"	on
39
37
40
# Restrict to stable (even) versions, indicated by the second component.
38
# Restrict to stable (even) versions, indicated by the second component.
41
PORTSCOUT=	limitw:1,even
39
#PORTSCOUT=	limitw:1,even
42
40
43
.include <bsd.port.pre.mk>
41
.include <bsd.port.pre.mk>
44
42
Lines 51-64 Link Here
51
PLIST_SUB+=	GNOMEDESKTOP="@comment "
49
PLIST_SUB+=	GNOMEDESKTOP="@comment "
52
.endif
50
.endif
53
51
54
.if !defined(WITHOUT_IMLIB)
55
USE_GNOME+=	imlib
56
CONFIGURE_ARGS+=--with-imlib
57
.else
58
USE_XORG=	xpm
59
CONFIGURE_ARGS+=--without-imlib
60
.endif
61
62
.if defined(WITH_ESOUND)
52
.if defined(WITH_ESOUND)
63
USE_GNOME+=	esound
53
USE_GNOME+=	esound
64
CONFIGURE_ARGS+=--with-icesound=esound
54
CONFIGURE_ARGS+=--with-icesound=esound
Lines 109-114 Link Here
109
		 s|/usr/share/gnome|${LOCALBASE}/share/gnome|g' \
99
		 s|/usr/share/gnome|${LOCALBASE}/share/gnome|g' \
110
		 ${WRKSRC}/src/gnome2.cc
100
		 ${WRKSRC}/src/gnome2.cc
111
101
102
post-configure:
103
	${REINPLACE_CMD} -e 's|icewm-set-gnomewm||g' ${WRKSRC}/Makefile
104
112
post-install:
105
post-install:
113
.for dir in taskbar themes/Infadel2/taskbar
106
.for dir in taskbar themes/Infadel2/taskbar
114
	@${LN} -sf ${STARTUP_PIXMAP} ${DATADIR}/${dir}/start.xpm
107
	@${LN} -sf ${STARTUP_PIXMAP} ${DATADIR}/${dir}/start.xpm
(-)distinfo (-3 / +2 lines)
Lines 1-3 Link Here
1
MD5 (icewm-1.2.37.tar.gz) = 970a21588d26eb361020fd60a61a482c
1
SHA256 (icewm-1.3.7.tar.gz) = ca1a78046ae340c324c441ce24a9675c24a8bafd3eb6ed8205345785da08887b
2
SHA256 (icewm-1.2.37.tar.gz) = bfb60165cddafb458cbfd4b4b9203aa351e37cb75e0ad0c64e818b6fd2140595
2
SIZE (icewm-1.3.7.tar.gz) = 898197
3
SIZE (icewm-1.2.37.tar.gz) = 841879
(-)pkg-message (-7 lines)
Lines 2-11 Link Here
2
2
3
IceWM has been installed.
3
IceWM has been installed.
4
4
5
If you want a set of icons to use with IceWM see:
6
7
* http://themes.freshmeat.net/projects/iceicons/
8
9
If you want more themes see:
5
If you want more themes see:
10
6
11
* http://themes.freshmeat.net/browse/925/
7
* http://themes.freshmeat.net/browse/925/
Lines 13-19 Link Here
13
If you do not see icons in the tray when they should be there, please try
9
If you do not see icons in the tray when they should be there, please try
14
rebuilding with the "IMLIB" option enabled.
10
rebuilding with the "IMLIB" option enabled.
15
11
16
Graphical configuration tools for IceWM are outdated and obsolete, but there
17
is a useful menu generator in the ports tree: "deskutils/menumaker".
18
19
==============================================================================
12
==============================================================================
(-)files/patch-src__aapm.cc (-264 / +5 lines)
Lines 1-269 Link Here
1
--- ./src/aapm.cc.orig	2009-01-25 09:39:51.000000000 -0500
1
--- ./src/aapm.cc.orig	2010-10-31 10:09:36.000000000 -0400
2
+++ ./src/aapm.cc	2009-09-03 16:12:50.000000000 -0400
2
+++ ./src/aapm.cc	2010-11-02 19:56:53.000000000 -0400
3
@@ -31,8 +31,12 @@
3
@@ -243,6 +243,7 @@
4
 #include <sys/file.h>
4
 }
5
 #include <sys/ioctl.h>
6
 #include <sys/types.h>
7
+#ifdef i386
8
 #include <machine/apm_bios.h>
9
 #endif
10
+#include <sys/sysctl.h>
11
+#include <dev/acpica/acpiio.h>
12
+#endif
13
 
14
 #ifdef __NetBSD__
15
 #include <sys/file.h>
16
@@ -63,7 +67,7 @@
17
 
18
 
5
 
19
 void ApmStr(char *s, bool Tool) {
20
-#ifdef __FreeBSD__
21
+#if defined(__FreeBSD__) && defined(i386) 
22
     struct apm_info ai;
23
 #elif defined __NetBSD__
24
     struct apm_power_info ai;
25
@@ -88,7 +92,7 @@
26
         error = 1;
27
         return ;
28
     }
29
-#ifdef __FreeBSD__
30
+#if defined(__FreeBSD__) && defined(i386)
31
     if (ioctl(fd,APMIO_GETINFO, &ai) == -1)
32
     {
33
         static int error = 0;
34
@@ -231,6 +235,7 @@
35
 void YApm::AcpiStr(char *s, bool Tool) {
6
 void YApm::AcpiStr(char *s, bool Tool) {
7
+	size_t len;
36
     char buf[80], buf2[80], bat_info[250];
8
     char buf[80], buf2[80], bat_info[250];
37
     FILE *fd;
9
     FILE *fd;
38
+    int      acpifd;
39
     //name of the battery
10
     //name of the battery
40
     char *BATname;
41
     //battery is present or absent
42
@@ -250,12 +255,14 @@
43
     //status of ac-adapter online/offline
44
     int ACstatus;
45
     int i;
46
+    size_t len;
47
 
48
     *s='\0';
49
 
50
     //assign some default values, in case
51
     //the file in /proc/acpi will contain unexpected values
52
     ACstatus = -1;
53
+#ifndef __FreeBSD__
54
     if (acpiACName && acpiACName[0] != 0) {
55
         strcat3(buf, "/proc/acpi/ac_adapter/", acpiACName, "/state", sizeof(buf));
56
         fd = fopen(buf, "r");
57
@@ -285,6 +292,17 @@
58
             fclose(fd);
59
         }
60
     }
61
+#else
62
+    len = sizeof(i);
63
+    if (sysctlbyname("hw.acpi.acline", &i, &len, NULL, 0) >= 0) {
64
+	if (i == 1)
65
+	    ACstatus = AC_ONLINE;
66
+	else if (i = 0)
67
+	    ACstatus = AC_OFFLINE;
68
+	else
69
+	    ACstatus = AC_UNKNOWN;
70
+    }
71
+#endif
72
 
73
     int n = 0;
74
     for (i = 0; i < batteryNum; i++) {
75
@@ -299,6 +317,7 @@
76
         BATrate = -1;
77
         BATtime_remain = -1;
78
 
79
+#ifndef __FreeBSD__
80
         strcat3(buf, "/proc/acpi/battery/", BATname, "/state", sizeof(buf));
81
         fd = fopen(buf, "r");
82
         if (fd == NULL) {
83
@@ -347,10 +366,43 @@
84
             }
85
             fclose(fd);
86
         }
87
+#else
88
+	int      acpifd;
89
+
90
+#define ACPIDEV         "/dev/acpi"
91
+	acpifd = open(ACPIDEV, O_RDONLY);
92
+	if (acpifd != -1) {
93
+	    union acpi_battery_ioctl_arg battio;
94
+	    
95
+	    battio.unit = i;
96
+	    if (ioctl(acpifd, ACPIIO_BATT_GET_BATTINFO, &battio) != -1) {
97
+		if (battio.battinfo.state != ACPI_BATT_STAT_NOT_PRESENT) {
98
+		    BATpresent = BAT_PRESENT;
99
+		    if (battio.battinfo.state == 0)
100
+			BATstatus = BAT_FULL;
101
+		    else if (battio.battinfo.state & ACPI_BATT_STAT_CHARGING)
102
+			BATstatus = BAT_CHARGING;
103
+		    else if (battio.battinfo.state & ACPI_BATT_STAT_DISCHARG)
104
+			BATstatus = BAT_DISCHARGING;
105
+		    else
106
+			BATstatus = BAT_UNKNOWN;
107
+		    if (battio.battinfo.cap != -1 && acpiBatteries[i]->capacity_full != -1)
108
+			BATcapacity_remain = acpiBatteries[i]->capacity_full *
109
+			    battio.battinfo.cap / 100;
110
+		    if (battio.battinfo.min != -1)
111
+			BATtime_remain = battio.battinfo.min;
112
+		    if (battio.battinfo.rate != -1)
113
+			BATrate = battio.battinfo.rate;
114
+		} else
115
+		    BATpresent = BAT_ABSENT;
116
+	    }
117
+	}
118
+#endif
119
 
120
         if (BATpresent == BAT_PRESENT) { //battery is present now
121
             if (acpiBatteries[i]->present == BAT_ABSENT) { //and previously was absent
122
                 //read full-capacity value
123
+#ifndef __FreeBSD__
124
                 strcat3(buf, "/proc/acpi/battery/", BATname, "/info", sizeof(buf));
125
                 fd = fopen(buf, "r");
126
                 if (fd != NULL) {
127
@@ -372,6 +424,21 @@
128
                     if (BATcapacity_remain > BATcapacity_full && BATcapacity_design > 0)
129
                         BATcapacity_full = BATcapacity_design;
130
                 }
131
+#else
132
+		union acpi_battery_ioctl_arg battio;
133
+#define UNKNOWN_CAP 0xffffffff                                                  
134
+#define UNKNOWN_VOLTAGE 0xffffffff                                              
135
+	    
136
+		battio.unit = i;
137
+		if (ioctl(acpifd, ACPIIO_BATT_GET_BIF, &battio) != -1) {
138
+		    if (battio.bif.dcap != UNKNOWN_CAP)
139
+			BATcapacity_design = battio.bif.dcap;
140
+		    if (battio.bif.lfcap != UNKNOWN_CAP)
141
+			BATcapacity_full = battio.bif.lfcap;
142
+                    if (BATcapacity_remain > BATcapacity_full && BATcapacity_design > 0)
143
+                        BATcapacity_full = BATcapacity_design;
144
+		}
145
+#endif
146
                 acpiBatteries[i]->capacity_full = BATcapacity_full;
147
             }
148
             else {
149
@@ -380,6 +447,11 @@
150
         }
151
         acpiBatteries[i]->present = BATpresent;
152
 
153
+#ifdef __FreeBSD__
154
+	close(acpifd);
155
+#endif
156
+
157
+        bat_info[0] = 0;
158
         if (!Tool &&
159
             taskBarShowApmTime &&
160
             BATpresent == BAT_PRESENT &&
161
@@ -387,7 +459,8 @@
162
             BATstatus == BAT_DISCHARGING &&
163
             //did we parse the needed values successfully?
164
             BATcapacity_full >= 0 && BATcapacity_remain >= 0 && BATrate > 0) {
165
-            BATtime_remain = (int) (60 * (double)(BATcapacity_remain) / BATrate);
166
+	    if (BATtime_remain == -1)
167
+        	BATtime_remain = (int) (60 * (double)(BATcapacity_remain) / BATrate);
168
             sprintf(bat_info, "%d:%02d", BATtime_remain / 60, BATtime_remain % 60);
169
         }
170
         else if (BATpresent == BAT_PRESENT &&
171
@@ -397,17 +470,19 @@
172
             sprintf(bat_info, "%3.0f%%",
173
                     100 * (double)BATcapacity_remain / BATcapacity_full);
174
         }
175
-        else {
176
-            //battery is absent or we didn't parse some needed values
177
-            bat_info[0] = 0;
178
-        }
179
 
180
         if (BATstatus == BAT_CHARGING) {
181
             if (Tool)
182
                 strcat(bat_info, _(" - Charging"));
183
             else
184
                 strcat(bat_info, _("C"));
185
-        }
186
+	} else if (BATstatus == BAT_FULL && Tool)
187
+                strcat(bat_info, _(" - Full"));
188
+
189
+	if (Tool && BATrate > 0) {
190
+	    sprintf(buf, " %d", BATrate);
191
+            strcat(bat_info, buf);
192
+	}
193
 
194
         if ((n > 0) && (*bat_info)) {
195
             if (Tool)
196
@@ -738,6 +813,7 @@
197
 YApm::YApm(YWindow *aParent): YWindow(aParent) {
198
     struct dirent **de;
199
     int n, i;
200
+    size_t s;
201
     FILE *pmu_info;
202
                     char buf[80];
203
                     FILE *fd;
204
@@ -747,6 +823,7 @@
205
     fCurrentState = 0;
206
 
207
     //search for acpi info first
208
+#ifndef __FreeBSD__
209
     n = scandir("/sys/class/power_supply", &de, 0, alphasort);
210
     if (n < 0) {
211
         n = scandir("/proc/acpi/battery", &de, 0, alphasort);
212
@@ -824,7 +901,34 @@
213
             acpiACName = (char*)malloc(sizeof(char));
214
             *acpiACName = '\0';
215
         }
216
+#else
217
+    int acpifd;
218
+    
219
+    acpifd = open(ACPIDEV, O_RDONLY);
220
+    if (acpifd != -1) {
221
+	mode = ACPI;
222
+
223
+        //scan for batteries
224
+        i = 0;
225
+        while (i < 64 && batteryNum < MAX_ACPI_BATTERY_NUM) {
226
+	    union acpi_battery_ioctl_arg battio;
227
+	    
228
+	    battio.unit = i;
229
+	    if (ioctl(acpifd, ACPIIO_BATT_GET_BATTINFO, &battio) != -1) {
230
+    		acpiBatteries[batteryNum] =
231
+	            (bat_info*)malloc(sizeof(bat_info));
232
+	    	asprintf(&acpiBatteries[batteryNum]->name, "Battery%d", i);
233
+	        //initially set as absent, to force reading of
234
+	        //full-capacity value
235
+	        acpiBatteries[batteryNum]->present = BAT_ABSENT;
236
+	        acpiBatteries[batteryNum]->capacity_full = -1;
237
+	        batteryNum++;
238
+	    }
239
+	    i++;
240
+	}
241
 
242
+	asprintf(&acpiACName, "AC1");
243
+#endif
244
     } else if ( (pmu_info = fopen("/proc/pmu/info", "r")) != NULL) {
245
        mode = PMU;
246
        char line[80];
247
@@ -870,7 +974,21 @@
248
 }
249
 
250
 void YApm::updateToolTip() {
251
-    setToolTip(fCurrentState);
252
+    char s[64] = {' ', ' ', ' ', 0, 0, 0, 0, 0};
253
+
254
+    switch (mode) {
255
+    case ACPI:
256
+        AcpiStr(s, 1);
257
+        break;
258
+    case APM:
259
+        ApmStr(s, 1);
260
+        break;
261
+    case PMU:
262
+        PmuStr(s, 1);
263
+        break;
264
+    }
265
+
266
+    setToolTip(s);
267
 }
268
 
269
 int YApm::calcInitialWidth() {

Return to bug 151904