From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Feb 8 04:10:19 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D9A016A4D0 for ; Sun, 8 Feb 2004 04:10:19 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 29D3943D55 for ; Sun, 8 Feb 2004 04:10:19 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i18CAJbv065010 for ; Sun, 8 Feb 2004 04:10:19 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i18CAJ5J065003; Sun, 8 Feb 2004 04:10:19 -0800 (PST) (envelope-from gnats) Resent-Date: Sun, 8 Feb 2004 04:10:19 -0800 (PST) Resent-Message-Id: <200402081210.i18CAJ5J065003@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Michael Ranner Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 309CC16A4D1 for ; Sun, 8 Feb 2004 04:08:56 -0800 (PST) Received: from dwarf.jawa.at (line-M-131.adsl-dynamic.inode.at [81.223.113.131]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEAF443D1D for ; Sun, 8 Feb 2004 04:08:54 -0800 (PST) (envelope-from mranner@dwarf.jawa.at) Received: from dwarf.jawa.at (localhost.jawa.at [127.0.0.1]) by dwarf.jawa.at (8.12.9p2/8.12.9) with ESMTP id i18C8EeQ011766 for ; Sun, 8 Feb 2004 13:08:14 +0100 (CET) (envelope-from mranner@dwarf.jawa.at) Received: (from root@localhost) by dwarf.jawa.at (8.12.9p2/8.12.9/Submit) id i18C8EjP011765; Sun, 8 Feb 2004 13:08:14 +0100 (CET) (envelope-from mranner) Message-Id: <200402081208.i18C8EjP011765@dwarf.jawa.at> Date: Sun, 8 Feb 2004 13:08:14 +0100 (CET) From: Michael Ranner To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/62535: [NEW PORT] sysutils/kcube: "Cpu load kicker-applet for KDE" X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2004 12:10:19 -0000 >Number: 62535 >Category: ports >Synopsis: [NEW PORT] sysutils/kcube: "Cpu load kicker-applet for KDE" >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: Sun Feb 08 04:10:18 PST 2004 >Closed-Date: >Last-Modified: >Originator: Michael Ranner >Release: FreeBSD 4.9-RELEASE-p1 i386 >Organization: >Environment: System: FreeBSD dwarf.jawa.at 4.9-RELEASE-p1 FreeBSD 4.9-RELEASE-p1 #4: Sat Nov 29 11:09:14 CET 2003 System: FreeBSD dwarf.jawa.at 5.2-RELEASE FreeBSD 5.2-RELEASE #4: Sat Feb 1 18:35:05 CET 2004 >Description: Kcube is a kicker-application that displays a realtime rotating 3d-object and the current cpu-load. The cpu-load also makes the object spin faster/slower. WWW: http://www.tuxed.de/kcube/ Generated with FreeBSD Port Tools 0.50 >How-To-Repeat: >Fix: --- kcube-0.61.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: # # kcube # kcube/files # kcube/files/patch-kcube.h # kcube/files/patch-kcube.cpp # kcube/Makefile # kcube/pkg-descr # kcube/pkg-plist # kcube/distinfo # echo c - kcube mkdir -p kcube > /dev/null 2>&1 echo c - kcube/files mkdir -p kcube/files > /dev/null 2>&1 echo x - kcube/files/patch-kcube.h sed 's/^X//' >kcube/files/patch-kcube.h << 'END-of-kcube/files/patch-kcube.h' X*** kcube/kcube.h.orig Thu Feb 13 19:25:29 2003 X--- kcube/kcube.h Sat Feb 7 22:39:59 2004 X*************** X*** 37,42 **** X--- 37,54 ---- X X #include "PrefForm.h" X X+ #ifdef Q_OS_BSD4 X+ #include X+ #if defined(__FreeBSD__) && __FreeBSD_version >= 500101 X+ #include X+ #else X+ #include X+ #endif X+ #include X+ #include X+ #include X+ #endif X+ X class Kcube : public KPanelApplet X { X Q_OBJECT END-of-kcube/files/patch-kcube.h echo x - kcube/files/patch-kcube.cpp sed 's/^X//' >kcube/files/patch-kcube.cpp << 'END-of-kcube/files/patch-kcube.cpp' X*** kcube/kcube.cpp.orig Thu Feb 13 22:12:49 2003 X--- kcube/kcube.cpp Sun Feb 8 11:30:04 2004 X*************** X*** 33,41 **** X--- 33,51 ---- X #include X X #include X+ #include X+ #include X+ X+ #include X X #include "kcube.h" X X+ struct nlist nl[] = { X+ #define X_CP_TIME 0 X+ { "_cp_time" }, X+ { "" }, X+ }; X+ X extern "C" X { X KPanelApplet* init( QWidget *parent, const QString configFile) X*************** X*** 64,70 **** X X // timer X cpu_timer = new QTimer(); X! cpu_timer->start(500, false); X connect (cpu_timer, SIGNAL ( timeout() ), this, SLOT ( cpu_timer_event() ) ); X draw_timer = new QTimer(); X draw_timer->start(50, false); X--- 74,80 ---- X X // timer X cpu_timer = new QTimer(); X! cpu_timer->start(1000, false); X connect (cpu_timer, SIGNAL ( timeout() ), this, SLOT ( cpu_timer_event() ) ); X draw_timer = new QTimer(); X draw_timer->start(50, false); X*************** X*** 82,87 **** X--- 92,98 ---- X prefform = new PrefForm(this); X prefform->setFixedSize( prefform->width(), prefform->height() ); X loadConfig(); X+ X } X X Kcube::~Kcube() X*************** X*** 119,132 **** X int Kcube::calc_cpu_total() X { X int use_nice = 0, t=0; X! int total, used; X char cpuid[6]; X! int cpu,nice,system,idle; X X FILE *fp; X fp = fopen("/proc/stat","rt"); X fscanf(fp,"%s %d %d %d %d",cpuid,&cpu,&nice,&system,&idle); X fclose(fp); X X used = cpu + system + nice; X total = used + idle + (1-use_nice)*nice; X--- 130,171 ---- X int Kcube::calc_cpu_total() X { X int use_nice = 0, t=0; X! long total, used; X char cpuid[6]; X! long cpu,nice,system,idle; X! #ifdef Q_OS_BSD4 X! static int name2oid[2] = { 0, 3 }; X! static int oidCpuTime[CTL_MAXNAME + 2]; X! static size_t oidCpuTimeLen = sizeof(oidCpuTime); X! long cpuTime[CPUSTATES]; X! size_t cpuTimeLen = sizeof(cpuTime); X! static char *name = "kern.cp_time"; X! static int initialized = 0; X! #endif X X+ #ifdef Q_OS_LINUX X FILE *fp; X fp = fopen("/proc/stat","rt"); X fscanf(fp,"%s %d %d %d %d",cpuid,&cpu,&nice,&system,&idle); X fclose(fp); X+ #endif X+ X+ #ifdef Q_OS_BSD4 X+ if (! initialized) { X+ if (sysctl(name2oid, 2, oidCpuTime, &oidCpuTimeLen, name, strlen(name)) < 0) X+ return 0; X+ oidCpuTimeLen /= sizeof(int); X+ initialized = 1; X+ } X+ X+ if (sysctl(oidCpuTime, oidCpuTimeLen, cpuTime, &cpuTimeLen, 0, 0) < 0) X+ return 0; X+ X+ idle = cpuTime[CP_IDLE]; X+ cpu = cpuTime[CP_USER]; X+ nice = cpuTime[CP_NICE]; X+ system = cpuTime[CP_SYS]; X+ #endif X X used = cpu + system + nice; X total = used + idle + (1-use_nice)*nice; X*************** X*** 148,154 **** X if ( load > prefform->high_color_cpu->text().toInt() ) setColors("high"); X else setColors("low"); X X! draw_timer->changeInterval( 51 - load/2 ); X label_load->setText( QString("%1%").arg(load) ); X } X X--- 187,193 ---- X if ( load > prefform->high_color_cpu->text().toInt() ) setColors("high"); X else setColors("low"); X X! draw_timer->changeInterval( 61 - load/2 ); X label_load->setText( QString("%1%").arg(load) ); X } X END-of-kcube/files/patch-kcube.cpp echo x - kcube/Makefile sed 's/^X//' >kcube/Makefile << 'END-of-kcube/Makefile' X# New ports collection makefile for: kcube X# Date created: 05 January 2004 X# Whom: Michael Ranner X# X# $FreeBSD$ X# X XPORTNAME= kcube XPORTVERSION= 0.61 XCATEGORIES= sysutils kde XMASTER_SITES= http://www.tuxed.de/kcube/download/ X XMAINTAINER= mranner@inode.at XCOMMENT= "Another cpu load kicker applet for KDE" X XUSE_KDELIBS_VER=3 XGNU_CONFIGURE= yes XUSE_GMAKE= yes XUSE_REINPLACE= yes XUSE_LIBTOOL=yes XINSTALLS_SHLIB= yes XCONFIGURE_TARGET= XCONFIGURE_ARGS+= --with-freebsd-pthread X X.include X.include "${PORTSDIR}/x11/kde3/Makefile.kde" X.include END-of-kcube/Makefile echo x - kcube/pkg-descr sed 's/^X//' >kcube/pkg-descr << 'END-of-kcube/pkg-descr' XKcube is a kicker-application that displays a realtime rotating X3d-object and the current cpu-load. The cpu-load also makes the Xobject spin faster/slower. X XWWW: http://www.tuxed.de/kcube/ END-of-kcube/pkg-descr echo x - kcube/pkg-plist sed 's/^X//' >kcube/pkg-plist << 'END-of-kcube/pkg-plist' Xlib/libkcube.so.1 Xlib/libkcube.la Xshare/apps/kicker/applets/kcube.desktop X@dirrm share/apps/kicker/applets X@dirrm share/nls END-of-kcube/pkg-plist echo x - kcube/distinfo sed 's/^X//' >kcube/distinfo << 'END-of-kcube/distinfo' XMD5 (kcube-0.61.tar.gz) = 98735371ce2e3838cc498c35a47488e4 END-of-kcube/distinfo exit --- kcube-0.61.shar ends here --- >Release-Note: >Audit-Trail: >Unformatted: