1
0
mirror of https://github.com/gryf/gryf-overlay.git synced 2026-03-23 21:13:32 +01:00

- Added new version of Calibre,

- Added patch for bubblemon dockapp (bug#310399, upgrade GTK to 2.18), removed
  some old patches
- Added newest version of newsbeuter (+ stfl lib)
This commit is contained in:
root
2010-03-25 23:02:02 +01:00
parent 707f68ee83
commit 58e78d874f
14 changed files with 507 additions and 194 deletions

View File

@@ -1,169 +0,0 @@
--- bubblemon-dockapp-1.46/sys_linux.c 2003-10-01 04:30:41.000000000 +0200
+++ bubblemon-dockapp-1.46-patched/sys_linux.c 2007-02-18 17:43:46.000000000 +0100
@@ -69,89 +69,92 @@ int system_cpu(void)
return cpuload;
}
+/* code was taken from wmsysmon which is better */
int system_memory(void)
{
- u_int64_t my_mem_used, my_mem_max;
- u_int64_t my_swap_used, my_swap_max;
-#ifdef KERNEL_26
- char *p;
-#endif
-
- static int mem_delay = 0;
- FILE *mem;
- static u_int64_t aa, ab, ac, ad;
-#ifndef KERNEL_26
- static u_int64_t ae, af, ag, ah;
-#endif
- /* put this in permanent storage instead of stack */
- static char shit[2048];
-
- /* we might as well get both swap and memory at the same time.
- * sure beats opening the same file twice */
+ static int mem_delay = 0;
if (mem_delay-- <= 0) {
+ FILE *memfp;
+ char buf[1024];
+ long mem_total = 0;
+ long mem_buffers = 0;
+ long mem_cache = 0;
+ long swap_total = 0;
+ long swap_free = 0;
#ifdef KERNEL_26
- mem = fopen("/proc/meminfo", "r");
- memset(shit, 0, sizeof(shit));
- fread(shit, 2048, 1, mem);
- p = strstr(shit, "MemTotal");
- if (p) {
- sscanf(p, "MemTotal:%Ld", &aa);
- my_mem_max = aa << 10;
-
- p = strstr(p, "Active");
- if (p) {
- sscanf(p, "Active:%Ld", &ab);
- my_mem_used = ab << 10;
-
- p = strstr(p, "SwapTotal");
- if (p) {
- sscanf(p, "SwapTotal:%Ld", &ac);
- my_swap_max = ac << 10;
-
- p = strstr(p, "SwapFree");
- if (p) {
- sscanf(p, "SwapFree:%Ld", &ad);
- my_swap_used = my_swap_max - (ad << 10);
+ static char *p_mem_tot=NULL, *p_mem_free, *p_mem_buffers, *p_mem_cache;
+ static char *p_swap_total, *p_swap_free;
+
+ static long mem_free = 0;
+
+ memfp = fopen("/proc/meminfo", "r");
+ fread(buf, 1024, 1, memfp);
- bm.mem_used = my_mem_used;
- bm.mem_max = my_mem_max;
- bm.swap_used = my_swap_used;
- bm.swap_max = my_swap_max;
- }
+ if (!p_mem_tot)
+ {
+ p_mem_tot = strstr(buf, "MemTotal:" ) + 13;
+ p_mem_free = strstr(buf, "MemFree:" ) + 13;
+ p_mem_buffers = strstr(buf, "Buffers:" ) + 13;
+ p_mem_cache = strstr(buf, "Cached:" ) + 13;
+ p_swap_total = strstr(buf, "SwapTotal:") + 13;
+ p_swap_free = strstr(buf, "SwapFree:" ) + 13;
}
- }
- }
- fclose(mem);
- mem_delay = 25;
+
+
+ sscanf(p_mem_tot, "%ld", &mem_total );
+ sscanf(p_mem_free, "%ld", &mem_free );
+ sscanf(p_mem_buffers, "%ld", &mem_buffers);
+ sscanf(p_mem_cache, "%ld", &mem_cache );
+ sscanf(p_swap_total, "%ld", &swap_total );
+ sscanf(p_swap_free, "%ld", &swap_free );
+
+ fclose(memfp);
+
+ bm.mem_used = (mem_total - mem_free - mem_buffers - mem_cache) * 1024;
+ bm.mem_max = mem_total * 1024;
+ bm.swap_used = (swap_total - swap_free) * 1024;
+ bm.swap_max = swap_total * 1024;
+ mem_delay = 25;
#else
- mem = fopen("/proc/meminfo", "r");
- fgets(shit, 2048, mem);
-
- fscanf(mem, "%*s %Ld %Ld %Ld %Ld %Ld %Ld", &aa, &ab, &ac,
- &ad, &ae, &af);
- fscanf(mem, "%*s %Ld %Ld", &ag, &ah);
- fclose(mem);
- mem_delay = 25;
-
- /* calculate it */
- my_mem_max = aa; /* memory.total; */
- my_swap_max = ag; /* swap.total; */
-
- my_mem_used = ah + ab - af - ae; /* swap.used + memory.used - memory.cached - memory.buffer; */
-
- if (my_mem_used > my_mem_max) {
- my_swap_used = my_mem_used - my_mem_max;
- my_mem_used = my_mem_max;
- } else {
- my_swap_used = 0;
- }
+ int last_mem = 0, last_swap = 0, first = 1;
+ long swap_used = 0;
+ long mem_used = 0;
+ int Mem_l;
+ int Swap_l;
+ int i, ents;
+
+ memfp = fopen("/proc/meminfo", "r");
+ for(i = 0; fgets(buf, 1024, memfp); i++) {
+ if(strstr(buf, "Mem:")) Mem_l = i;
+ else if(strstr(buf, "Swap:")) Swap_l = i;
+ }
+
+ memfp = freopen("/proc/meminfo", "r", memfp);
- bm.mem_used = my_mem_used;
- bm.mem_max = my_mem_max;
- bm.swap_used = my_swap_used;
- bm.swap_max = my_swap_max;
+ for(i = 0, ents = 0; ents < 2 && fgets(buf, 1024, memfp); i++) {
+ if(i == Mem_l) {
+ sscanf(buf, "%*s %ld %ld %*d %*d %ld %ld",
+ &mem_total,
+ &mem_used,
+ &mem_buffers,
+ &mem_cache);
+ ents++;
+ } else if(i == Swap_l) {
+ sscanf(buf, "%*s %ld %ld %ld",
+ &swap_total,
+ &swap_used,
+ &swap_free);
+ ents++;
+ }
+ }
+ fclose(memfp);
+
+ bm.mem_used = mem_used - mem_buffers - mem_cache;
+ bm.mem_max = mem_total;
+ bm.swap_used = swap_used;
+ bm.swap_max = swap_total;
+ mem_delay = 25;
#endif
-
/* memory info changed - update things */
return 1;
}

View File

@@ -0,0 +1,124 @@
diff -ur bubblemon-dockapp-1.46.orig/bubblemon.c bubblemon-dockapp-1.46/bubblemon.c
--- bubblemon-dockapp-1.46.orig/bubblemon.c 2003-10-01 03:37:32.000000000 +0300
+++ bubblemon-dockapp-1.46/bubblemon.c 2007-05-28 18:10:43.000000000 +0300
@@ -58,6 +58,7 @@
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <X11/Xresource.h>
+#include <gtk/gtk.h>
#include "include/master.xpm"
#include "include/bubblemon.h"
@@ -575,7 +576,7 @@
attri.colormap = gdk_colormap_get_system();
attri.wmclass_name = "bubblemon";
attri.wmclass_class = "bubblemon";
- attri.window_type = GDK_WINDOW_TOPLEVEL;
+ attri.window_type = GDK_WINDOW_CHILD;
bm.iconwin = gdk_window_new(bm.win, &attri,
GDK_WA_TITLE | GDK_WA_WMCLASS);
@@ -593,7 +594,6 @@
wmhints.window_group = win;
wmhints.flags =
StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
- XSetWMHints(GDK_WINDOW_XDISPLAY(bm.win), win, &wmhints);
bm.gc = gdk_gc_new(bm.win);
@@ -606,6 +606,7 @@
gdk_window_set_back_pixmap(bm.iconwin, bm.pixmap, False);
gdk_window_show(bm.win);
+ XSetWMHints(GDK_WINDOW_XDISPLAY(bm.win), win, &wmhints);
#ifdef KDE_DOCKAPP
/* makes the dockapp visible inside KDE wm */
gdk_window_show(bm.iconwin);
diff -ur bubblemon-dockapp-1.46.orig/Makefile bubblemon-dockapp-1.46/Makefile
--- bubblemon-dockapp-1.46.orig/Makefile 2003-10-04 03:22:07.000000000 +0300
+++ bubblemon-dockapp-1.46/Makefile 2007-05-28 18:11:20.000000000 +0300
@@ -11,30 +11,49 @@
# no user serviceable parts below
EXTRA += $(WMAN)
+# gtk cflags and gtk lib flags
+GTK2_CFLAGS = $(shell pkg-config gtk+-2.0 --cflags)
+GTK2_LIBS = $(shell pkg-config gtk+-2.0 --libs)
+
+
# optimization cflags
-CFLAGS = -O3 -ansi -Wall `gtk-config --cflags` ${EXTRA}
+#CFLAGS = -O3 -Wall ${EXTRA}
+CFLAGS = ${GENTOO_CFLAGS} ${EXTRA}
+
# profiling cflags
-# CFLAGS = -ansi -Wall -pg -O3 `gtk-config --cflags` ${EXTRA} -DPRO
+# CFLAGS = -ansi -Wall -pg -O3 ${EXTRA} -DPRO
# test coverage cflags
-# CFLAGS = -fprofile-arcs -ftest-coverage -Wall -ansi -g `gtk-config --cflags` ${EXTRA} -DPRO
+# CFLAGS = -fprofile-arcs -ftest-coverage -Wall -ansi -g ${EXTRA} -DPRO
-SHELL=sh
+SHELL = sh
OS = $(shell uname -s)
+SRCS = bubblemon.c
OBJS = bubblemon.o
+BUBBLEMON = bubblemon
+
+LDFLAGS = -shared -Wl
+
+STRIP = strip
+
CC = gcc
+INSTALLMAN = -m 644
+
+
# special things for Linux
ifeq ($(OS), Linux)
- OBJS += sys_linux.o
- LIBS = `gtk-config --libs | sed "s/-lgtk//g"`
- INSTALL = -m 755
+ SRCS += sys_linux.c
+ OBJS += sys_linux.o
+ INSTALL = -m 755
+ INSTALLMAN = -m 644
endif
# special things for FreeBSD
ifeq ($(OS), FreeBSD)
+ SRCS += sys_freebsd.c
OBJS += sys_freebsd.o
- LIBS = `gtk-config --libs | sed "s/-lgtk//g"` -lkvm
+ LIBS = -lkvm
INSTALL = -c -g kmem -m 2755 -o root
endif
@@ -62,17 +81,21 @@
ifeq ($(COMPILER), gcc)
CFLAGS=-O3 -Wall
endif
- CFLAGS +=`gtk-config --cflags` ${EXTRA}
+ CFLAGS += ${EXTRA}
+ SRCS += sys_sunos.c
OBJS += sys_sunos.o
- LIBS = `gtk-config --libs` -lkstat -lm
+ LIBS = -lkstat -lm
INSTALL = -m 755
endif
+all: $(BUBBLEMON)
-all: bubblemon
+bubblemon: clean_obj
+ $(CC) $(GTK2_CFLAGS) $(CFLAGS) -o $(BUBBLEMON) \
+ $(LIBS) $(GTK2_LIBS) $(SRCS)
-bubblemon: $(OBJS)
- $(CC) $(CFLAGS) -o bubblemon $(OBJS) $(LIBS)
+clean_obj:
+ rm -rf *.o
clean:
rm -f bubblemon *.o *.bb* *.gcov gmon.* *.da *~

View File

@@ -0,0 +1,31 @@
--- bubblemon-dockapp-1.46_gentoo/bubblemon.c 2010-03-25 22:27:19.000000000 +0100
+++ bubblemon-dockapp-1.46/bubblemon.c 2010-03-25 22:30:04.000000000 +0100
@@ -44,7 +44,7 @@
*/
#define _GNU_SOURCE
-#define VERSION "1.41"
+#define VERSION "1.46"
/* general includes */
#include <stdio.h>
@@ -276,6 +276,8 @@
int main(int argc, char **argv)
{
+ /* This is needed to proper dockapp work on >=GTK+-2.18 */
+ setenv("GDK_NATIVE_WINDOWS", "1", 0);
char execute[256];
int proximity = 0;
int ch;
@@ -607,10 +609,7 @@
gdk_window_show(bm.win);
XSetWMHints(GDK_WINDOW_XDISPLAY(bm.win), win, &wmhints);
-#ifdef KDE_DOCKAPP
- /* makes the dockapp visible inside KDE wm */
gdk_window_show(bm.iconwin);
-#endif
/* We begin with zero bubbles */
bm.n_bubbles = 0;

View File

@@ -1,3 +0,0 @@
MD5 f1f86fe5c725bf3a6f5fef8709992931 bubblemon-dockapp-1.46.tar.gz 40001
RMD160 79e8be36cd11a2c6f4998cd747b6125696603a81 bubblemon-dockapp-1.46.tar.gz 40001
SHA256 f928073d3c69b2668e89b93cdcca5f390437831aab3eac3aa2129f8713e79dbf bubblemon-dockapp-1.46.tar.gz 40001