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

(-)Makefile (-53 / +11 lines)
Lines 1-10 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	tint2
3
PORTNAME=	tint2
4
PORTVERSION=	0.11
4
PORTVERSION=	0.12.1
5
PORTREVISION=	4
6
CATEGORIES=	x11
5
CATEGORIES=	x11
7
MASTER_SITES=	GOOGLE_CODE
6
MASTER_SITES=	http://leigh123linux.fedorapeople.org/pub/${PORTNAME}/source/
8
7
9
MAINTAINER=	yamagi@yamagi.org
8
MAINTAINER=	yamagi@yamagi.org
10
COMMENT=	Lightweight freedesktop-compliant panel/taskbar/systray/clock
9
COMMENT=	Lightweight freedesktop-compliant panel/taskbar/systray/clock
Lines 12-70 Link Here
12
LICENSE=	GPLv2
11
LICENSE=	GPLv2
13
LICENSE_FILE=	${WRKSRC}/COPYING
12
LICENSE_FILE=	${WRKSRC}/COPYING
14
13
15
LIB_DEPENDS=	libcairo.so:${PORTSDIR}/graphics/cairo \
14
LIB_DEPENDS=	libImlib2.so:${PORTSDIR}/graphics/imlib2 \
16
		libImlib2.so:${PORTSDIR}/graphics/imlib2
15
		libstartup-notification-1.so:${PORTSDIR}/x11/startup-notification
17
16
18
PROJECTHOST=	tint2
17
USES=		alias cmake gettext pkgconfig
19
USES=		alias cmake pkgconfig tar:bzip2
18
USE_GNOME=	glib20 librsvg2 pango
20
USE_GNOME=	glib20 pango
19
USE_XORG=	x11 xcomposite xdamage xinerama xrandr xrender
21
USE_XORG=	xdamage xcomposite xinerama xrandr
22
20
23
CMAKE_ARGS=	-DENABLE_BATTERY:BOOL=ON -DMANDIR:PATH=man
21
CMAKE_ARGS=	-DMANDIR:PATH=man
24
22
25
OPTIONS_DEFINE=	DOCS EXAMPLES PYCONF
23
OPTIONS_DEFINE=	EXAMPLES
26
OPTIONS_DEFAULT=	PYCONF
24
EXAMPLES_CMAKE_ON=	-DENABLE_EXAMPLES:BOOL=ON
25
EXAMPLES_CMAKE_OFF=	-DENABLE_EXAMPLES:BOOL=OFF
27
OPTIONS_SUB=	yes
26
OPTIONS_SUB=	yes
28
PYCONF_DESC=	Configuration editing tool (requires python)
29
27
30
PORTEXAMPLES=	icon_and_text_1.tint2rc icon_and_text_2.tint2rc \
31
		icon_and_text_3.tint2rc icon_and_text_4.tint2rc \
32
		icon_only_1.tint2rc icon_only_2.tint2rc icon_only_3.tint2rc \
33
		icon_only_4.tint2rc icon_only_6.tint2rc icon_only_7.tint2rc \
34
		text_only_1.tint2rc text_only_2.tint2rc text_only_3.tint2rc \
35
		text_only_4.tint2rc text_only_5.tint2rc text_only_6.tint2rc tint2rc
36
PORTDOCS=	AUTHORS ChangeLog README
37
38
PYCONF_USES=	python
39
PYCONF_USE=	gnome=gtk20,pygtk2
40
PYCONF_CMAKE_ON=	-DENABLE_TINT2CONF:BOOL=ON
41
PYCONF_CMAKE_OFF=	-DENABLE_TINT2CONF:BOOL=OFF
42
43
.include <bsd.port.options.mk>
44
45
.if ${PORT_OPTIONS:MPYCONF}
46
PYCONF_SRC=	${WRKSRC}/src/tint2conf
47
post-patch:
48
	@${MV} ${PYCONF_SRC}/tintwizard.py ${PYCONF_SRC}/tintwizard.py.Dist
49
	@${SED} -e 's#pidof#pgrep#g' ${PYCONF_SRC}/tintwizard.py.Dist \
50
		> ${PYCONF_SRC}/tintwizard.py
51
.endif
52
53
do-install:
54
	${INSTALL_PROGRAM} ${WRKSRC}/tint2 ${STAGEDIR}${PREFIX}/bin
55
	${MKDIR} ${STAGEDIR}${PREFIX}/share/tint2
56
	${INSTALL_DATA} ${WRKSRC}/default_icon.png ${STAGEDIR}${PREFIX}/share/tint2
57
	${INSTALL_MAN} ${WRKSRC}/doc/tint2.1 ${STAGEDIR}${MANPREFIX}/man/man1
58
.if ${PORT_OPTIONS:MPYCONF}
59
	${INSTALL_PROGRAM} ${PYCONF_SRC}/tint2conf ${STAGEDIR}${PREFIX}/bin
60
	${INSTALL_SCRIPT} ${PYCONF_SRC}/tintwizard.py ${STAGEDIR}${PREFIX}/bin
61
	${INSTALL_DATA} ${PYCONF_SRC}/tint2conf.desktop ${STAGEDIR}${PREFIX}/share/applications
62
	${INSTALL_DATA} ${PYCONF_SRC}/tint2conf.png ${STAGEDIR}${PREFIX}/share/pixmaps
63
	${INSTALL_DATA} ${PYCONF_SRC}/tint2conf.svg ${STAGEDIR}${PREFIX}/share/pixmaps
64
.endif
65
	${MKDIR} ${STAGEDIR}${DOCSDIR}
66
	${MKDIR}  ${STAGEDIR}${EXAMPLESDIR}
67
	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
68
	${INSTALL_DATA} ${PORTEXAMPLES:S|^|${WRKSRC}/sample/|} ${STAGEDIR}${EXAMPLESDIR}
69
70
.include <bsd.port.mk>
28
.include <bsd.port.mk>
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (tint2-0.11.tar.bz2) = fe106e6a6057d2631abddde9f82d3fd4fb1985c4fb93f10d3886417a9e22471d
1
SHA256 (tint2-0.12.1.tar.gz) = 5731394b812215f56441146d2a50dcf063efda0a19ccf51b3599ddbe07b14559
2
SIZE (tint2-0.11.tar.bz2) = 91716
2
SIZE (tint2-0.12.1.tar.gz) = 230228
(-)files/patch-CMakeLists.txt (+11 lines)
Line 0 Link Here
1
--- CMakeLists.txt.orig	2015-08-04 09:22:00 UTC
2
+++ CMakeLists.txt
3
@@ -114,7 +114,7 @@ endif()
4
 
5
 set( MANDIR share/man CACHE PATH "Directory for man pages" )
6
 set( DATADIR share CACHE PATH "Directory for shared data" )
7
-set( SYSCONFDIR /etc CACHE PATH "Directory for configuration files" )
8
+set( SYSCONFDIR etc CACHE PATH "Directory for configuration files" )
9
 set( DOCDIR share/doc/tint2 CACHE PATH "Directory for documentation files" )
10
 
11
 add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_version.sh" "\"${PROJECT_SOURCE_DIR}\"" )
(-)files/patch-src-battery-battery.c (-144 lines)
Lines 1-144 Link Here
1
Index: src/battery/battery.c
2
===================================================================
3
--- src/battery/battery.c	(Revision 514)
4
+++ src/battery/battery.c	(Revision 515)
5
@@ -24,13 +24,18 @@
6
 #include <cairo-xlib.h>
7
 #include <pango/pangocairo.h>
8
 
9
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
10
+#if defined(__OpenBSD__) || defined(__NetBSD__)
11
 #include <machine/apmvar.h>
12
 #include <err.h>
13
 #include <sys/ioctl.h>
14
 #include <unistd.h>
15
 #endif
16
 
17
+#if defined(__FreeBSD__)
18
+#include <sys/types.h>
19
+#include <sys/sysctl.h>
20
+#endif
21
+
22
 #include "window.h"
23
 #include "server.h"
24
 #include "area.h"
25
@@ -59,11 +64,10 @@
26
 char *path_current_now;
27
 char *path_status;
28
 
29
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
30
+#if defined(__OpenBSD__) || defined(__NetBSD__)
31
 int apm_fd;
32
 #endif
33
 
34
-
35
 void update_batterys(void* arg)
36
 {
37
 	int i;
38
@@ -103,7 +107,7 @@
39
 	path_energy_full = 0;
40
 	path_current_now = 0;
41
 	path_status = 0;
42
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
43
+#if defined(__OpenBSD__) || defined(__NetBSD__)
44
 	apm_fd = -1;
45
 #endif
46
 }
47
@@ -118,7 +122,7 @@
48
 	if (path_status) g_free(path_status);
49
 	if (battery_low_cmd) g_free(battery_low_cmd);
50
 
51
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
52
+#if defined(__OpenBSD__) || defined(__NetBSD__)
53
 	if ((apm_fd != -1) && (close(apm_fd) == -1))
54
 		warn("cannot close /dev/apm");
55
 #endif
56
@@ -129,7 +133,7 @@
57
 {
58
 	if (!battery_enabled) return;
59
 
60
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
61
+#if defined(__OpenBSD__) || defined(__NetBSD__)
62
 	apm_fd = open("/dev/apm", O_RDONLY);
63
 	if (apm_fd < 0) {
64
 		warn("init_battery: failed to open /dev/apm.");
65
@@ -137,7 +141,7 @@
66
 		return;
67
 	}
68
 
69
-#else
70
+#elif !defined(__FreeBSD__)
71
 	// check battery
72
 	GDir *directory = 0;
73
 	GError *error = NULL;
74
@@ -258,17 +262,21 @@
75
 
76
 
77
 void update_battery() {
78
-#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
79
+#if !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
80
 	// unused on OpenBSD, silence compiler warnings
81
 	FILE *fp;
82
 	char tmp[25];
83
 	int64_t current_now = 0;
84
 #endif
85
+#if defined(__FreeBSD__)
86
+	int sysctl_out =  0;
87
+	size_t len = 0;
88
+#endif
89
 	int64_t energy_now = 0, energy_full = 0;
90
 	int seconds = 0;
91
 	int8_t new_percentage = 0;
92
 
93
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
94
+#if defined(__OpenBSD__) || defined(__NetBSD__)
95
 	struct apm_power_info info;
96
 	if (ioctl(apm_fd, APM_IOC_GETPOWER, &(info)) < 0)
97
 		warn("power update: APM_IOC_GETPOWER");
98
@@ -298,6 +306,45 @@
99
 
100
 	new_percentage = info.battery_life;
101
 
102
+#elif defined(__FreeBSD__)
103
+	len = sizeof(sysctl_out);
104
+
105
+	if (sysctlbyname("hw.acpi.battery.state", &sysctl_out, &len, NULL, 0) != 0)
106
+		fprintf(stderr, "power update: no such sysctl");
107
+
108
+	// attemp to map the battery state to linux
109
+	battery_state.state = BATTERY_UNKNOWN;
110
+
111
+	switch(sysctl_out) {
112
+		case 1:
113
+			battery_state.state = BATTERY_DISCHARGING;
114
+			break;
115
+		case 2:
116
+			battery_state.state = BATTERY_CHARGING;
117
+			break;
118
+		default:
119
+			battery_state.state = BATTERY_FULL;
120
+			break;
121
+	}
122
+
123
+	// no mapping for freebsd
124
+	energy_full = 0;
125
+	energy_now = 0;
126
+
127
+	if (sysctlbyname("hw.acpi.battery.time", &sysctl_out, &len, NULL, 0) != 0)
128
+		seconds = -1;
129
+	else
130
+		seconds = sysctl_out * 60;
131
+
132
+	// charging or error
133
+	if (seconds < 0)
134
+		seconds = 0;
135
+
136
+	if (sysctlbyname("hw.acpi.battery.life", &sysctl_out, &len, NULL, 0) != 0)
137
+		new_percentage = -1;
138
+	else
139
+		new_percentage = sysctl_out;
140
+
141
 #else
142
 	fp = fopen(path_status, "r");
143
 	if(fp != NULL) { 
144
(-)pkg-descr (-1 / +1 lines)
Lines 13-16 Link Here
13
    * clock with font, color and transparency
13
    * clock with font, color and transparency
14
    * multi-monitor : panel position adjust to monitor, taskbar by monitor
14
    * multi-monitor : panel position adjust to monitor, taskbar by monitor
15
15
16
WWW: http://code.google.com/p/tint2/
16
WWW: https://gitlab.com/o9000/tint2
(-)pkg-plist (-5 / +38 lines)
Lines 1-8 Link Here
1
bin/tint2
1
bin/tint2
2
bin/tint2conf
3
etc/xdg/tint2/tint2rc
2
man/man1/tint2.1.gz
4
man/man1/tint2.1.gz
5
share/applications/tint2.desktop
6
share/applications/tint2conf.desktop
7
%%DOCSDIR%%/AUTHORS
8
%%DOCSDIR%%/ChangeLog
9
%%DOCSDIR%%/README.md
10
share/icons/hicolor/scalable/apps/tint2.svg
11
share/icons/hicolor/scalable/apps/tint2conf.svg
12
share/locale/bs/LC_MESSAGES/tint2conf.mo
13
share/locale/fr/LC_MESSAGES/tint2conf.mo
14
share/locale/hr/LC_MESSAGES/tint2conf.mo
15
share/locale/pl/LC_MESSAGES/tint2conf.mo
16
share/locale/sr/LC_MESSAGES/tint2conf.mo
3
%%DATADIR%%/default_icon.png
17
%%DATADIR%%/default_icon.png
4
%%PYCONF%%bin/tint2conf
18
%%EXAMPLES%%%%DATADIR%%/horizontal-dark-opaque.tint2rc
5
%%PYCONF%%bin/tintwizard.py
19
%%EXAMPLES%%%%DATADIR%%/horizontal-dark-transparent.tint2rc
6
%%PYCONF%%share/applications/tint2conf.desktop
20
%%EXAMPLES%%%%DATADIR%%/horizontal-light-opaque.tint2rc
7
%%PYCONF%%share/pixmaps/tint2conf.png
21
%%EXAMPLES%%%%DATADIR%%/horizontal-light-transparent.tint2rc
8
%%PYCONF%%share/pixmaps/tint2conf.svg
22
%%EXAMPLES%%%%DATADIR%%/icon_and_text_1.tint2rc
23
%%EXAMPLES%%%%DATADIR%%/icon_and_text_2.tint2rc
24
%%EXAMPLES%%%%DATADIR%%/icon_and_text_3.tint2rc
25
%%EXAMPLES%%%%DATADIR%%/icon_and_text_4.tint2rc
26
%%EXAMPLES%%%%DATADIR%%/icon_only_1.tint2rc
27
%%EXAMPLES%%%%DATADIR%%/icon_only_2.tint2rc
28
%%EXAMPLES%%%%DATADIR%%/icon_only_3.tint2rc
29
%%EXAMPLES%%%%DATADIR%%/icon_only_4.tint2rc
30
%%EXAMPLES%%%%DATADIR%%/icon_only_6.tint2rc
31
%%EXAMPLES%%%%DATADIR%%/icon_only_7.tint2rc
32
%%EXAMPLES%%%%DATADIR%%/text_only_1.tint2rc
33
%%EXAMPLES%%%%DATADIR%%/text_only_2.tint2rc
34
%%EXAMPLES%%%%DATADIR%%/text_only_3.tint2rc
35
%%EXAMPLES%%%%DATADIR%%/text_only_4.tint2rc
36
%%EXAMPLES%%%%DATADIR%%/text_only_5.tint2rc
37
%%EXAMPLES%%%%DATADIR%%/text_only_6.tint2rc
38
%%EXAMPLES%%%%DATADIR%%/vertical-dark-opaque.tint2rc
39
%%EXAMPLES%%%%DATADIR%%/vertical-dark-transparent.tint2rc
40
%%EXAMPLES%%%%DATADIR%%/vertical-light-opaque.tint2rc
41
%%EXAMPLES%%%%DATADIR%%/vertical-light-transparent.tint2rc

Return to bug 202137