Update of /cvsroot/fink/experimental/rangerrick/finkinfo/x11
In directory usw-pr-cvs1:/tmp/cvs-serv17045

Added Files:
        hot-babe-0.1.2-1.info hot-babe-0.1.2-1.patch 
Log Message:
not for young eyes  ;)


--- NEW FILE: hot-babe-0.1.2-1.info ---
Package: hot-babe
Version: 0.1.2
Revision: 1
Patch: %f.patch
CompileScript: make
InstallScript: make install prefix=%p mandir=%p/share/man DESTDIR=%d
Source: http://dindinx.net/hotbabe/downloads/%n-%v.tar.bz2
Description: NC-17 CPU meter
DescDetail: <<
Hot-babe is a small graphical utility which display the system activity
in a very special way.  When the CPU is idle, it displays a dressed
girl, and when the activity goes up, as the temperature increases, the
girl begins to undress, to finish totally naked when the system activity
reaches 100%.  Of course, if you can be shocked by nudity, don't use it!
<<
License: GPL
Maintainer: Benjamin Reed <[EMAIL PROTECTED]>
Homepage: http://dindinx.net/hotbabe/

--- NEW FILE: hot-babe-0.1.2-1.patch ---
diff -uNbr hot-babe-0.1.2/Makefile hot-babe-0.1.2-patched/Makefile
--- hot-babe-0.1.2/Makefile     Sat Sep 21 11:28:43 2002
+++ hot-babe-0.1.2-patched/Makefile     Wed Oct 16 22:19:56 2002
@@ -1,6 +1,7 @@
 # where to install this program
-PREFIX = /usr/local
-DESTDIR = ${PREFIX}
+prefix = /usr/local
+mandir = $(prefix)/man
+DESTDIR = 
 
 # optimization cflags
 CFLAGS = -O2 -Wall -g `gtk-config --cflags` `gdk-pixbuf-config --cflags`
@@ -19,5 +20,7 @@
        rm -f hot-babe *.o
 
 install:
-       install -d $(DESTDIR)/bin
-       install $(INSTALL) hot-babe $(DESTDIR)/bin
+       install -d $(DESTDIR)$(prefix)/bin
+       install -m 755 hot-babe $(DESTDIR)$(prefix)/bin
+       install -d $(DESTDIR)$(mandir)/man1
+       install -m 644 hot-babe.1 $(DESTDIR)$(mandir)/man1/hot-babe.1
diff -uNbr hot-babe-0.1.2/hot-babe.c hot-babe-0.1.2-patched/hot-babe.c
--- hot-babe-0.1.2/hot-babe.c   Sat Sep 21 10:53:24 2002
+++ hot-babe-0.1.2-patched/hot-babe.c   Wed Oct 16 22:28:02 2002
@@ -27,6 +27,15 @@
 #include <stdlib.h>
 #include <string.h>
 
+/* darwin includes */
+#if defined(__APPLE__)
+# include <mach/host_info.h>
+# include <mach/mach_types.h>
+# include <mach/message.h>
+static host_cpu_load_info_data_t curcount;
+static mach_port_t host_priv_port;
+#endif
+
 /* x11 includes */
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
@@ -76,11 +85,22 @@
 {
   unsigned int  cpuload;
   u_int64_t     load, total, oload, ototal;
-  u_int64_t     ab, ac, ad, ae;
   int           i;
-  FILE         *stat;
 
-  stat = fopen("/proc/stat", "r");
+#if defined(__APPLE__)
+
+  mach_msg_type_number_t count;
+  kern_return_t kr;
+  count = HOST_CPU_LOAD_INFO_COUNT;
+  kr = host_statistics (host_priv_port, HOST_CPU_LOAD_INFO, (host_info_t) &curcount, 
+&count);
+  load  = curcount.cpu_ticks[CPU_STATE_USER] + curcount.cpu_ticks[CPU_STATE_SYSTEM];
+  total = load + curcount.cpu_ticks[CPU_STATE_IDLE];
+
+#else
+
+  u_int64_t     ab, ac, ad, ae;
+  FILE *stat;
+  ntat n fopen("/proc/stat", "r");
   fscanf(stat, "%*s %Ld %Ld %Ld %Ld", &ab, &ac, &ad, &ae);
   fclose(stat);
 
@@ -91,6 +111,8 @@
   if(!bm.noNice) load += ac;
   total = ab + ac + ad + ae;  /* cpu.total; */
 
+#endif
+
   i = bm.loadIndex;
   oload = bm.load[i];
   ototal = bm.total[i];
@@ -244,6 +266,11 @@
 
 static void hotbabe_setup_samples(void)
 {
+
+#if defined(__APPLE__)
+  host_priv_port = mach_host_self();
+#endif
+
   int       i;
   u_int64_t load = 0, total = 0;
 
@@ -288,7 +315,7 @@
 
   bm.samples     = 16;
   bm.incremental = FALSE;
-  bm.delay       = 15000;
+  bm.delay       = 100000;
   bm.noNice      = FALSE;
 
   for (i=1 ; i<argc ; i++)



-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to
$1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to