diff options
author | Renato Botelho <garga@FreeBSD.org> | 2009-02-25 13:03:48 +0000 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2009-02-25 13:03:48 +0000 |
commit | 2aa0766b5df255a51c1819768e2ac1624d863bd8 (patch) | |
tree | 8e5acfb42bae49dcee596e38e1dedaba13f4229f /sysutils/wmcube-gdk | |
parent | 63c035eed9c57c429ac138c878bb8c4030e78a0e (diff) | |
download | ports-2aa0766b5df255a51c1819768e2ac1624d863bd8.tar.gz ports-2aa0766b5df255a51c1819768e2ac1624d863bd8.zip |
Notes
Diffstat (limited to 'sysutils/wmcube-gdk')
-rw-r--r-- | sysutils/wmcube-gdk/Makefile | 31 | ||||
-rw-r--r-- | sysutils/wmcube-gdk/files/patch-wmcube.c | 121 | ||||
-rw-r--r-- | sysutils/wmcube-gdk/files/pkg-message.in (renamed from sysutils/wmcube-gdk/pkg-message) | 4 | ||||
-rw-r--r-- | sysutils/wmcube-gdk/pkg-descr | 2 | ||||
-rw-r--r-- | sysutils/wmcube-gdk/pkg-plist | 75 |
5 files changed, 165 insertions, 68 deletions
diff --git a/sysutils/wmcube-gdk/Makefile b/sysutils/wmcube-gdk/Makefile index c7e0fb958553..5d3e830493bb 100644 --- a/sysutils/wmcube-gdk/Makefile +++ b/sysutils/wmcube-gdk/Makefile @@ -13,32 +13,33 @@ MASTER_SITES= http://www.ne.jp/asahi/linux/timecop/software/ PKGNAMESUFFIX= -gdk DISTNAME= ${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION} -MAINTAINER= ports@FreeBSD.org +MAINTAINER= garga@FreeBSD.org COMMENT= wmcube-gdk is a modified version of the dockapp wmCube USE_XORG= xpm USE_GNOME= gtk12 MAKEFILE= Makefile.FREEBSD +SUB_FILES= pkg-message + +DATADIR= ${PREFIX}/share/${PORTNAME}${PKGNAMESUFFIX} +DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX} +PORTDOCS= CHANGES README README.GDK TODO do-install: - @${INSTALL_PROGRAM} ${WRKSRC}/wmcube \ - ${PREFIX}/bin/wmcube-gdk - @${CHMOD} g+s ${PREFIX}/bin/wmcube-gdk - @${CHOWN} root:kmem ${PREFIX}/bin/wmcube-gdk + @${INSTALL_PROGRAM} -m 2755 -o root -g kmem ${WRKSRC}/wmcube \ + ${PREFIX}/bin/${PORTNAME}${PKGNAMESUFFIX} post-install: .for files in *.wmc - @${MKDIR} ${DATADIR}${PKGNAMESUFFIX} - @${INSTALL_DATA} ${WRKSRC}/3dObjects/${files} \ - ${DATADIR}${PKGNAMESUFFIX} -.endfor -.ifndef(NOPORTDOCS) - @${MKDIR} ${DOCSDIR}${PKGNAMESUFFIX} -.for file in CHANGES README README.GDK TODO - @${INSTALL_DATA} ${WRKSRC}/${file} \ - ${DOCSDIR}${PKGNAMESUFFIX} + @${MKDIR} ${DATADIR} + @${INSTALL_DATA} ${WRKSRC}/3dObjects/${files} ${DATADIR} .endfor +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} +. for doc in ${PORTDOCS} + @${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR} +. endfor .endif #NOPORTDOCS - @${SED} -e "s|%%PREFIX%%|${PREFIX}|" ${PKGMESSAGE} + @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff --git a/sysutils/wmcube-gdk/files/patch-wmcube.c b/sysutils/wmcube-gdk/files/patch-wmcube.c index b6026aaa448b..01f9db4427d8 100644 --- a/sysutils/wmcube-gdk/files/patch-wmcube.c +++ b/sysutils/wmcube-gdk/files/patch-wmcube.c @@ -1,6 +1,23 @@ ---- wmcube.c.orig Tue Aug 28 12:08:13 2001 -+++ wmcube.c Tue Dec 18 14:37:25 2001 -@@ -778,7 +777,7 @@ +--- wmcube.c.orig 2009-02-25 09:56:08.000000000 -0300 ++++ wmcube.c 2009-02-25 09:56:28.000000000 -0300 +@@ -174,6 +174,7 @@ + #ifdef FREEBSD + static kvm_t *kd; + static struct nlist nlst[] = { {"_cp_time"}, {0} }; ++static int cp_time_mib[2]; + #endif + + void prep_digits(void) +@@ -226,7 +227,7 @@ + XWMHints wmhints; + /* for mask */ + GdkBitmap *mask; +- unsigned char mask_data[8 * 64]; ++ gchar mask_data[8 * 64]; + int i; + GdkColor bright; + /* for that stupid shadow line */ +@@ -778,7 +779,7 @@ newx -= CHAR_WIDTH; } @@ -9,7 +26,17 @@ for (i = 0; (c = buf[i]); i++) { if (c == '%') copy_xpm_area(60, 0, 7, 9, newx, y); -@@ -1250,7 +1249,7 @@ +@@ -899,7 +900,8 @@ + + while ((i > -1) && (temparr[i] > key)) { + temparr[i + 1] = temparr[i]; +- zorder[i + 1] = zorder[i--]; ++ zorder[i + 1] = zorder[i]; ++ i--; + } + + zorder[i + 1] = k; +@@ -1250,7 +1252,7 @@ exit(0); } @@ -18,7 +45,7 @@ if (strcmp(tmp, "WMCUBE_COORDINATES") != 0) { printf -@@ -1259,7 +1258,7 @@ +@@ -1259,7 +1261,7 @@ exit(0); } @@ -27,7 +54,7 @@ counter = atoi(tmp); while ((strcmp(tmp, "WMCUBE_LINES") != 0) -@@ -1280,7 +1279,7 @@ +@@ -1280,7 +1282,7 @@ fclose(fp); exit(0); } @@ -36,7 +63,37 @@ if (feof(fp)) { printf -@@ -1398,7 +1397,7 @@ +@@ -1297,23 +1299,23 @@ + + planesORlines = 0; + while (1) { +- + cline = (int *) realloc(cline, (i + 2) * sizeof(int)); + mem_alloc_error(cline); +- fscanf(fp, "%d %d", &cline[i++], &cline[i++]); +- /* printf("\n%d %d",cline[i-2],cline[i-1]); */ ++ fscanf(fp, "%d %d", &cline[i], &cline[i+1]); ++ /* printf("\n%d %d",cline[i],cline[i+1]); */ + if (feof(fp)) + break; + +- if (cline[i - 2] > nofcoords || cline[i - 1] > nofcoords) { ++ if (cline[i] > nofcoords || cline[i+1] > nofcoords) { + printf("\nError in objectfile (WMCUBE_LINES section):\n" + "coordinates %d or/and %d doesnt exist\n\n", +- cline[i - 2], cline[i - 1]); ++ cline[i], cline[i+1]); + fclose(fp); + exit(0); + } ++ i = i + 2; + } +- noflines = i - 2; ++ noflines = i; + } else if (strcmp(tmp, "WMCUBE_PLANES") == 0) { + + planesORlines = 1; +@@ -1398,7 +1400,7 @@ char cpuid[6]; char check_cpu[6]; @@ -45,7 +102,7 @@ if ((fp = fopen("/proc/stat", "rb")) == NULL) { perror("/proc/stat required for this system"); -@@ -1409,7 +1408,7 @@ +@@ -1409,7 +1411,7 @@ return 0; for (i = -2; i < which_cpu; i++) { @@ -54,7 +111,7 @@ } if (strcmp(check_cpu, cpuid) != 0) { -@@ -1431,7 +1430,7 @@ +@@ -1431,7 +1433,7 @@ fp = fopen("/proc/stat", "rt"); for (i = -2; i < which_cpu; i++) { @@ -63,3 +120,49 @@ } fclose(fp); +@@ -1582,18 +1584,23 @@ + #include <nlist.h> + #include <fcntl.h> + #include <sys/dkstat.h> ++#include <sys/sysctl.h> + + int init_calc_cpu() + { ++ size_t len = 2; ++ if (sysctlnametomib("kern.cp_time", cp_time_mib, &len) < 0) { ++ printf("\nWarning: unable to sysctl kern.cp_time\n\n"); + +- if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL) { +- printf("\nError: unable to open kvm\n\n"); +- exit(0); +- } +- kvm_nlist(kd, nlst); +- if (nlst[0].n_type == 0) { +- printf("\nError: unable to get nlist\n\n"); +- exit(1); ++ if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL) { ++ printf("\nError: unable to open kvm\n\n"); ++ exit(0); ++ } ++ kvm_nlist(kd, nlst); ++ if (nlst[0].n_type == 0) { ++ printf("\nError: unable to get nlist\n\n"); ++ exit(1); ++ } + } + + /* drop setgid & setuid (hi GOBBLES, who the fuck are you? */ +@@ -1615,6 +1622,13 @@ + int cpu, nice, system, idle; + unsigned long int cpu_time[CPUSTATES]; + ++ if (cp_time_mib[0] != 0) { ++ size_t cpu_time_len = sizeof (cpu_time); ++ if (sysctl(cp_time_mib, 2, cpu_time, &cpu_time_len, NULL, 0) < 0) { ++ printf("\nError sysctl\n\n"); ++ exit(0); ++ } ++ } else + if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time)) + != sizeof(cpu_time)) { + printf("\nError reading kvm\n\n"); diff --git a/sysutils/wmcube-gdk/pkg-message b/sysutils/wmcube-gdk/files/pkg-message.in index 6c77fc332cdc..e4e8b76c75dc 100644 --- a/sysutils/wmcube-gdk/pkg-message +++ b/sysutils/wmcube-gdk/files/pkg-message.in @@ -1,7 +1,7 @@ --------------------------------------------------- The extra 3d objects are located in: - %%PREFIX%%/share/wmcube-gdk + %%DATADIR%% To run wmcube type: - wmcube-gdk -o %%PREFIX%%/share/wmcube-gdk & + wmcube-gdk -o %%DATADIR%% & --------------------------------------------------- diff --git a/sysutils/wmcube-gdk/pkg-descr b/sysutils/wmcube-gdk/pkg-descr index 4c46238aae4e..1b3481140b22 100644 --- a/sysutils/wmcube-gdk/pkg-descr +++ b/sysutils/wmcube-gdk/pkg-descr @@ -5,5 +5,3 @@ load / zoom buttons. The roll in sequence of the original wmCube has been removed. WWW: http://www.ne.jp/asahi/linux/timecop/ - -- Patrick Li <pat@FreeBSD.org> diff --git a/sysutils/wmcube-gdk/pkg-plist b/sysutils/wmcube-gdk/pkg-plist index 97301b796a43..ed02914928ed 100644 --- a/sysutils/wmcube-gdk/pkg-plist +++ b/sysutils/wmcube-gdk/pkg-plist @@ -1,41 +1,36 @@ bin/wmcube-gdk -%%PORTDOCS%%share/doc/wmcube-gdk/CHANGES -%%PORTDOCS%%share/doc/wmcube-gdk/README -%%PORTDOCS%%share/doc/wmcube-gdk/README.GDK -%%PORTDOCS%%share/doc/wmcube-gdk/TODO -share/wmcube-gdk/2planes-solid.wmc -share/wmcube-gdk/4d.wmc -share/wmcube-gdk/8star-small.wmc -share/wmcube-gdk/8star.wmc -share/wmcube-gdk/ball-solid.wmc -share/wmcube-gdk/ball.wmc -share/wmcube-gdk/celtic.wmc -share/wmcube-gdk/cross.wmc -share/wmcube-gdk/cross2-solid.wmc -share/wmcube-gdk/cross2.wmc -share/wmcube-gdk/cross3-solid.wmc -share/wmcube-gdk/cross3.wmc -share/wmcube-gdk/cross4-solid.wmc -share/wmcube-gdk/crystal.wmc -share/wmcube-gdk/cube-solid.wmc -share/wmcube-gdk/cube.wmc -share/wmcube-gdk/diamond.wmc -share/wmcube-gdk/dice-solid.wmc -share/wmcube-gdk/e.wmc -share/wmcube-gdk/e2.wmc -share/wmcube-gdk/foo.wmc -share/wmcube-gdk/gnustep.wmc -share/wmcube-gdk/hyperpyramid.wmc -share/wmcube-gdk/jeep.wmc -share/wmcube-gdk/multicube.wmc -share/wmcube-gdk/peace.wmc -share/wmcube-gdk/pyramid.wmc -share/wmcube-gdk/radioactive.wmc -share/wmcube-gdk/shield.wmc -share/wmcube-gdk/spaceshuttle.wmc -share/wmcube-gdk/spiral.wmc -share/wmcube-gdk/star.wmc -share/wmcube-gdk/starcube.wmc -share/wmcube-gdk/wmlogo.wmc -@dirrm share/wmcube-gdk -%%PORTDOCS%%@dirrm share/doc/wmcube-gdk +%%DATADIR%%/2planes-solid.wmc +%%DATADIR%%/4d.wmc +%%DATADIR%%/8star-small.wmc +%%DATADIR%%/8star.wmc +%%DATADIR%%/ball-solid.wmc +%%DATADIR%%/ball.wmc +%%DATADIR%%/celtic.wmc +%%DATADIR%%/cross.wmc +%%DATADIR%%/cross2-solid.wmc +%%DATADIR%%/cross2.wmc +%%DATADIR%%/cross3-solid.wmc +%%DATADIR%%/cross3.wmc +%%DATADIR%%/cross4-solid.wmc +%%DATADIR%%/crystal.wmc +%%DATADIR%%/cube-solid.wmc +%%DATADIR%%/cube.wmc +%%DATADIR%%/diamond.wmc +%%DATADIR%%/dice-solid.wmc +%%DATADIR%%/e.wmc +%%DATADIR%%/e2.wmc +%%DATADIR%%/foo.wmc +%%DATADIR%%/gnustep.wmc +%%DATADIR%%/hyperpyramid.wmc +%%DATADIR%%/jeep.wmc +%%DATADIR%%/multicube.wmc +%%DATADIR%%/peace.wmc +%%DATADIR%%/pyramid.wmc +%%DATADIR%%/radioactive.wmc +%%DATADIR%%/shield.wmc +%%DATADIR%%/spaceshuttle.wmc +%%DATADIR%%/spiral.wmc +%%DATADIR%%/star.wmc +%%DATADIR%%/starcube.wmc +%%DATADIR%%/wmlogo.wmc +@dirrm %%DATADIR%% |