diff options
Diffstat (limited to 'x11/e17-module-cpu')
-rw-r--r-- | x11/e17-module-cpu/Makefile | 23 | ||||
-rw-r--r-- | x11/e17-module-cpu/distinfo | 6 | ||||
-rw-r--r-- | x11/e17-module-cpu/files/patch-e_mod_main.c | 93 | ||||
-rw-r--r-- | x11/e17-module-cpu/pkg-plist | 20 |
4 files changed, 22 insertions, 120 deletions
diff --git a/x11/e17-module-cpu/Makefile b/x11/e17-module-cpu/Makefile index fa8c0da18c55..015ecef1a6cb 100644 --- a/x11/e17-module-cpu/Makefile +++ b/x11/e17-module-cpu/Makefile @@ -6,27 +6,24 @@ # PORTNAME= cpu -PORTVERSION= 20060707 -PORTREVISION= 1 +PORTVERSION= 20060926 +PORTREVISION= 0 CATEGORIES= x11 -MASTER_SITES= http://mbsd.msk.ru/dist/ +MASTER_SITES= http://sunner.elcomnet.ru/~stas/ PKGNAMEPREFIX= e17-module- DISTNAME= ${PORTNAME}-${PORTVERSION} -MAINTAINER= ssedov@mbsd.msk.ru +MAINTAINER= stas@FreeBSD.org COMMENT= An e17 module which allows users to monitor cpu load -BUILD_DEPENDS= enlightenment:${PORTSDIR}/x11-wm/enlightenment-devel -RUN_DEPENDS= ${BUILD_DEPENDS} +BUILD_DEPENDS= enlightenment-config:${PORTSDIR}/x11-wm/enlightenment-devel +RUN_DEPENDS= enlightenment-config:${PORTSDIR}/x11-wm/enlightenment-devel USE_BZIP2= yes -USE_X_PREFIX= yes USE_GMAKE= yes +USE_GNOME= gnometarget pkgconfig +USE_EFL= edje GNU_CONFIGURE= yes -CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \ - LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib" - -PLIST_SUB+= MODULE_ARCH=freebsd${OSREL}-${ARCH} .if !defined(WITHOUT_NLS) USE_GETTEXT= yes @@ -36,4 +33,6 @@ CONFIGURE_ARGS= --disable-nls PLIST_SUB+= NLS="@comment " .endif -.include <bsd.port.mk> +.include <bsd.port.pre.mk> +.include "../../x11-wm/enlightenment-devel/bsd.efl.mk" +.include <bsd.port.post.mk> diff --git a/x11/e17-module-cpu/distinfo b/x11/e17-module-cpu/distinfo index 5b0ebc87a26d..7a0ddda8eeeb 100644 --- a/x11/e17-module-cpu/distinfo +++ b/x11/e17-module-cpu/distinfo @@ -1,3 +1,3 @@ -MD5 (cpu-20060707.tar.bz2) = c4f763fc3cf8bcac6da1fb90a54c60ac -SHA256 (cpu-20060707.tar.bz2) = 8b81a3acae9a48613ef4d10ef0f037687e084f572f4f1c7e023739fd7d4acac7 -SIZE (cpu-20060707.tar.bz2) = 298803 +MD5 (cpu-20060926.tar.bz2) = 1cd0a1463cb4e30bcc1bcb65416ed54b +SHA256 (cpu-20060926.tar.bz2) = a66b516bfb10e0b9094bbc4bc6fdc3c34946cf0873142e7eb151a952e704ab0d +SIZE (cpu-20060926.tar.bz2) = 261091 diff --git a/x11/e17-module-cpu/files/patch-e_mod_main.c b/x11/e17-module-cpu/files/patch-e_mod_main.c deleted file mode 100644 index 79b3a8ba3412..000000000000 --- a/x11/e17-module-cpu/files/patch-e_mod_main.c +++ /dev/null @@ -1,93 +0,0 @@ ---- e_mod_main.c.orig Sun Jul 9 14:15:46 2006 -+++ e_mod_main.c Sun Jul 9 15:58:09 2006 -@@ -3,6 +3,12 @@ - #include "e_mod_config.h" - #include "config.h" - -+#if defined(__FreeBSD__) -+# include <sys/types.h> -+# include <sys/sysctl.h> -+# include <sys/resource.h> -+#endif -+ - static Cpu *_cpu_init(E_Module *m); - static void _cpu_shutdown(Cpu *n); - static void _cpu_config_menu_new(Cpu *n); -@@ -460,31 +466,66 @@ - FILE *f; - int cpu = -1; - -+#if defined(__FreeBSD__) -+ cpu = 1; /* We can't retrive per-cpu statistics, so we'll assume UP arch*/ -+#else - if (!(f = fopen("/proc/stat", "r"))) - return -1; - - while (fscanf(f, "cp%s %*u %*u %*u %*u %*u %*u %*u %*u\n", (char *)&tmp) == 1) - cpu++; -- - fclose(f); -+#endif -+ - return cpu; - } - - static void - _cpu_face_get_load(Cpu_Face *cf) - { -+ int cpu_count; -+ Edje_Message_Float msg; -+#if defined(__FreeBSD__) -+ long cp_time[CPUSTATES]; -+ static long old_used, old_tot; -+ long new_used, new_tot; -+ size_t len; -+#else - static unsigned long old_u[4], old_n[4], old_s[4], old_i[4], old_wa[4], old_hi[4], old_si[4]; - unsigned long new_u, new_n, new_s, new_i, new_wa = 0, new_hi = 0, new_si = 0, ticks_past; - int tmp_u, tmp_n, tmp_s, tmp_i; - char dummy[16]; - FILE *stat; -- int cpu_count; -- Edje_Message_Float msg; -+#endif - - cpu_count = _cpu_face_get_cpu_count(cf); - if (cpu_count == -1) - return; - -+#if defined(__FreeBSD__) -+ len = sizeof(cp_time); -+ -+ if (sysctlbyname("kern.cp_time", &cp_time, &len, NULL, 0) < 0) { -+ warn("sysctl()"); -+ return; -+ } -+ -+ new_used = cp_time[CP_USER] + cp_time[CP_NICE] + cp_time[CP_SYS]; -+ new_tot = new_used + cp_time[CP_IDLE]; -+ -+ if (new_tot == old_tot) -+ msg.val = 0; -+ else -+ msg.val = 100 * (float)(new_used - old_used) / (float)(new_tot - old_tot); -+ -+ cpu_stats[0] = msg.val; -+ edje_object_message_send(cf->cpu_obj, EDJE_MESSAGE_FLOAT, 0, &msg); -+ -+ old_tot = new_tot; -+ old_used = new_used; -+ -+#else -+ - if (!(stat = fopen("/proc/stat", "r"))) - return; - -@@ -537,6 +578,7 @@ - i++; - } - fclose(stat); -+#endif - } - - static void diff --git a/x11/e17-module-cpu/pkg-plist b/x11/e17-module-cpu/pkg-plist index 33b6656b67a2..42144630fef3 100644 --- a/x11/e17-module-cpu/pkg-plist +++ b/x11/e17-module-cpu/pkg-plist @@ -1,15 +1,11 @@ lib/enlightenment/modules/cpu/cpu.edj -lib/enlightenment/modules/cpu/%%MODULE_ARCH%%/module.a -lib/enlightenment/modules/cpu/module.eap -lib/enlightenment/modules/cpu/%%MODULE_ARCH%%/module.la -lib/enlightenment/modules/cpu/%%MODULE_ARCH%%/module.so +lib/enlightenment/modules/cpu/%%E17_ARCH%%/module.a +lib/enlightenment/modules/cpu/%%E17_ARCH%%/module.la +lib/enlightenment/modules/cpu/%%E17_ARCH%%/module.so +lib/enlightenment/modules/cpu/module.desktop +lib/enlightenment/modules/cpu/module.edj lib/enlightenment/modules/cpu/module_icon.png -%%NLS%%share/locale/bg/LC_MESSAGES/cpu.mo -%%NLS%%share/locale/eo/LC_MESSAGES/cpu.mo -%%NLS%%share/locale/fi/LC_MESSAGES/cpu.mo -%%NLS%%share/locale/it/LC_MESSAGES/cpu.mo -%%NLS%%share/locale/ja/LC_MESSAGES/cpu.mo -%%NLS%%share/locale/ru/LC_MESSAGES/cpu.mo -%%NLS%%share/locale/sv/LC_MESSAGES/cpu.mo -@dirrm lib/enlightenment/modules/cpu/%%MODULE_ARCH%% +@dirrm lib/enlightenment/modules/cpu/%%E17_ARCH%% @dirrm lib/enlightenment/modules/cpu +@dirrmtry lib/enlightenment/modules +@dirrmtry lib/enlightenment |