Date: Sat, 7 Oct 2006 09:30:17 +0800 From: "psilotum" <psilotum@msa.hinet.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/104081: [NEW PORT] x11/lxpanel: LXPanel is a lightweight X11 desktop panel Message-ID: <200610070130.k971UH6j082973@psilotum.myphotos.cc> Resent-Message-ID: <200610070140.k971eK97083769@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 104081 >Category: ports >Synopsis: [NEW PORT] x11/lxpanel: LXPanel is a lightweight X11 desktop panel >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Oct 07 01:40:20 GMT 2006 >Closed-Date: >Last-Modified: >Originator: psilotum >Release: FreeBSD 6.2-PRERELEASE i386 >Organization: >Environment: System: FreeBSD psilotum.myphotos.cc 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #2: Fri Oct 6 19:36:23 CST >Description: LXpanel is a lightweight desktop panel like fbpanel. >How-To-Repeat: >Fix: --- lxpanel-0.1.shar begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # lxpanel # lxpanel/Makefile # lxpanel/distinfo # lxpanel/pkg-descr # lxpanel/pkg-plist # lxpanel/files # lxpanel/files/patch-cpu.c # lxpanel/files/patch-plugin.h # lxpanel/files/patch-plugin.c # echo c - lxpanel mkdir -p lxpanel > /dev/null 2>&1 echo x - lxpanel/Makefile sed 's/^X//' >lxpanel/Makefile << 'END-of-lxpanel/Makefile' X# New ports collection makefile for: lxpanel X# Date created: Sat Oct 7 01:22:35 CST 2006 X# Whom: Lin, Cheng-Tao <b89605222@ntu.edu.tw> X# X# $FreeBSD$ X# X XPORTNAME= lxpanel XPORTVERSION= 0.1 XCATEGORIES= x11 XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE} XMASTER_SITE_SUBDIR= ${PORTNAME} X XMAINTAINER= b89605222@ntu.edu.tw XCOMMENT= LXPanel is a lightweight X11 desktop panel X XUSE_X_PREFIX= yes XUSE_XLIB= yes XUSE_GNOME= gtk20 XGNU_CONFIGURE= yes XUSE_AUTOTOOLS= automake:19 XCONFIGURE_ARGS= --prefix=${PREFIX} XCONFIGURE_ENV= LDFLAGS="-L${X11BASE}/lib" CFLAGS="-I${LOCALBASE}/include" XCFLAGS+= -I${WRKSRC} XUSE_GMAKE= yes X X.if !defined(WITHOUT_NLS) X USE_GETTEXT= yes XPLIST_SUB+= NLS="" X.else XCONFIGURE_ARGS+=--disable-nls XPLIST_SUB+= NLS="@comment " X.endif X X.include <bsd.port.mk> END-of-lxpanel/Makefile echo x - lxpanel/distinfo sed 's/^X//' >lxpanel/distinfo << 'END-of-lxpanel/distinfo' XMD5 (lxpanel-0.1.tar.gz) = 45f8a5b3a5a22ac3e00ca1803591aae4 XSHA256 (lxpanel-0.1.tar.gz) = cb2d235299748b6b68cbed664dae6ae0e429b93560bf7579399b843870016347 XSIZE (lxpanel-0.1.tar.gz) = 343734 END-of-lxpanel/distinfo echo x - lxpanel/pkg-descr sed 's/^X//' >lxpanel/pkg-descr << 'END-of-lxpanel/pkg-descr' XLXpanel is a lightweight desktop panel like fbpanel. X XIt's not only with fbpanel features but also X X* supports i18n X* provides lxpanelctl to control lxpanel X XWWW: http://lxpanel.sourceforge.net/ END-of-lxpanel/pkg-descr echo x - lxpanel/pkg-plist sed 's/^X//' >lxpanel/pkg-plist << 'END-of-lxpanel/pkg-plist' Xbin/lxpanel Xbin/lxpanelctl X%%NLS%%locale/zh_TW/LC_MESSAGES/lxpanel.mo X%%DATADIR%%/default X%%DATADIR%%/images/bottom-left.xpm X%%DATADIR%%/images/bottom-right.xpm X%%DATADIR%%/images/default.xpm X%%DATADIR%%/images/emacs.svg X%%DATADIR%%/images/file-manager.svg X%%DATADIR%%/images/firefox2.svg X%%DATADIR%%/images/gnome-fs-desktop.svg X%%DATADIR%%/images/gnome-setting.svg X%%DATADIR%%/images/gnome_terminal.svg X%%DATADIR%%/images/my-computer.svg X%%DATADIR%%/images/redhat-internet.svg X%%DATADIR%%/images/thunderbird.svg X%%DATADIR%%/images/top-left.xpm X%%DATADIR%%/images/top-right.xpm X%%DATADIR%%/pager X@dirrm %%DATADIR%%/images X@dirrm %%DATADIR%% END-of-lxpanel/pkg-plist echo c - lxpanel/files mkdir -p lxpanel/files > /dev/null 2>&1 echo x - lxpanel/files/patch-cpu.c sed 's/^X//' >lxpanel/files/patch-cpu.c << 'END-of-lxpanel/files/patch-cpu.c' X--- src/plugins/cpu.c.orig Sat Oct 7 01:48:45 2006 X+++ src/plugins/cpu.c Sat Oct 7 02:00:22 2006 X@@ -24,7 +24,13 @@ X #include <string.h> X #include <sys/time.h> X #include <time.h> X-#include <sys/sysinfo.h> X+#ifdef __FreeBSD__ X+# include <sys/types.h> X+# include <sys/resource.h> X+# include <sys/sysctl.h> X+#else X+# include <sys/sysinfo.h> X+#endif X #include <stdlib.h> X #include <glib/gi18n.h> X X@@ -61,6 +67,38 @@ X struct cpu_stat cpu_anterior; X } cpu_t; X X+#ifdef __FreeBSD__ X+static void X+get_procstat(unsigned long *u, unsigned long *n, unsigned long *s, X+ unsigned long *i) X+{ X+ static int mib[2] = { -1, -1 }, init = 0, j, realhz; X+ long ct[CPUSTATES]; X+ X+ X+ if(init == 0) { X+ struct clockinfo ci; X+ j = sizeof(ci); X+ sysctlbyname("kern.clockrate", &ci, &j, NULL, 0); X+ realhz = ci.stathz ? ci.stathz : ci.hz; X+ X+ j = 2; X+ sysctlnametomib("kern.cp_time", mib, &j); X+ X+ init = 1; X+ j = sizeof(ct); X+ } X+ X+ sysctl(mib, 2, ct, &j, NULL, 0); X+ *u = ct[CP_USER] / realhz; X+ *n = ct[CP_NICE] / realhz; X+ *s = ct[CP_SYS] / realhz; X+ *i = ct[CP_IDLE] / realhz; X+ X+ return; X+ } X+#endif X+ X X static int X cpu_update(cpu_t *c) X@@ -68,18 +106,27 @@ X int cpu_u=0, cpu_s=0, cpu_n=0, cpu_i=100; X unsigned int i; X struct cpu_stat cpu, cpu_r; X+#ifndef __FreeBSD__ X+ FILE *stat; X+#endif X+ X FILE *stat; X float total; X X ENTER; X if(!c->pixmap) X RET(TRUE); X- X+#ifdef __FreeBSD__ X+ get_procstat(&cpu.u, &cpu.n, &cpu.s, &cpu.i); X+#else X+ X stat = fopen("/proc/stat", "r"); X if(!stat) X RET(TRUE); X fscanf(stat, "cpu %lu %lu %lu %lu", &cpu.u, &cpu.n, &cpu.s, &cpu.i); X fclose(stat); X+#endif X+ X X cpu_r.u = cpu.u - c->cpu_anterior.u; X cpu_r.n = cpu.n - c->cpu_anterior.n; END-of-lxpanel/files/patch-cpu.c echo x - lxpanel/files/patch-plugin.h sed 's/^X//' >lxpanel/files/patch-plugin.h << 'END-of-lxpanel/files/patch-plugin.h' X--- src/plugin.h.orig Sat Oct 7 02:01:56 2006 X+++ src/plugin.h Sat Oct 7 02:02:54 2006 X@@ -62,6 +62,7 @@ X #define STATIC_SPACE X #define STATIC_ICONS X #define STATIC_DESKNO X+#define STATIC_CPU X #endif X X END-of-lxpanel/files/patch-plugin.h echo x - lxpanel/files/patch-plugin.c sed 's/^X//' >lxpanel/files/patch-plugin.c << 'END-of-lxpanel/files/patch-plugin.c' X--- src/plugin.c.orig Sat Oct 7 02:04:15 2006 X+++ src/plugin.c Sat Oct 7 02:05:06 2006 X@@ -104,6 +104,10 @@ X REGISTER_PLUGIN_CLASS(deskno_plugin_class, 0); X #endif X X+#if defined(STATIC_CPU) && defined(PLUGIN_CPU) X+ REGISTER_PLUGIN_CLASS(cpu_plugin_class, 0); X+#endif X+ X RET(); X } X END-of-lxpanel/files/patch-plugin.c exit --- lxpanel-0.1.shar ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610070130.k971UH6j082973>