ports/118472: [patch] x11-wm/jewel unbreak fix build with GCC 4.2 + adopt maintainship

Pietro Cerutti gahr at gahr.ch
Thu Dec 6 22:10:01 UTC 2007


>Number:         118472
>Category:       ports
>Synopsis:       [patch] x11-wm/jewel unbreak fix build with GCC 4.2 + adopt maintainship
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 06 22:10:00 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Pietro Cerutti
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
>Environment:


System: FreeBSD 8.0-CURRENT #15: Thu Dec  6 12:47:48 CET 2007
    root at gahrtop.localhost:/usr/obj/usr/src/sys/MSI1034



>Description:


The following patch:

- fixes some GCC 4.2 errors (namespace, forward-declarations, ...)
- cleans all warnings
- refactor Makefile (pkg-plist, PORTDOCS, post-patch)
- set maintainship to me

Tested on:
8.0-CURRENT i386
7.0-BETA3 sparc64


>How-To-Repeat:


cd /usr/ports/x11-wm/jewel && make


>Fix:


--- _jewel.diff begins here ---
--- Makefile.orig	2007-12-06 22:56:35.000000000 +0100
+++ Makefile	2007-12-06 22:56:22.000000000 +0100
@@ -8,52 +8,40 @@
 
 PORTNAME=	jewel
 PORTVERSION=	0.12.41
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	x11-wm
 MASTER_SITES=	http://mjr.towers.org.uk/comp/
 
-MAINTAINER=	ports at FreeBSD.org
+MAINTAINER=	gahr at gahr.ch
 COMMENT=	Window manager based on aewm++
 
-ALL_TARGET=	jewel
-DOCDIR=		share/doc/${PORTNAME}
+ALL_TARGET=	all
 DOCS=		Changelog Changelog.DLR Changelog.jewel INSTALL LICENSE README
 MAN1=		jewel.1x
-PLIST=		${WRKDIR}/pkg-plist
-USE_X_PREFIX=	yes
 USE_GMAKE=	yes
 
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 700042
-BROKEN=		Broken with gcc 4.2
-.endif
-
 post-patch:
-	@${MV} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.orig
-	@${SED} -e "s,^CC,#CC,g ; s,^CFLAGS,#CFLAGS,g ; \
-		s,^prefix,#prefix,g ; s,prefix,PREFIX,g ; \
-		s,/usr/X11R6,${X11BASE},g ; \
-		s,CC,CXX,g ; s,CFLAGS,CXXFLAGS,g" < ${WRKSRC}/Makefile.orig \
-		> ${WRKSRC}/Makefile
-
-pre-install:
-	${ECHO_CMD} bin/jewel > ${PLIST}
-.if !defined(NOPORTDOCS)
-.for ii in ${DOCS}
-	${ECHO_CMD} ${DOCDIR}/${ii} >> ${PLIST}
-.endfor
-	${ECHO_CMD} @dirrm ${DOCDIR} >> ${PLIST}
-.endif
+	@${REINPLACE_CMD} -e 's|^CC|#CC|g; \
+		s|^CFLAGS|#CFLAGS|g; \
+		s|^prefix|#prefix|g; \
+		s|prefix|PREFIX|g; \
+		s|/usr/X11R6|${X11BASE}|g; \
+		s|CC|CXX|g; \
+		s|CFLAGS|CXXFLAGS|g' \
+		${WRKSRC}/Makefile
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/jewel ${PREFIX}/bin/jewel
-	${INSTALL_MAN} ${WRKSRC}/jewel.1x ${PREFIX}/man/man1
+	${INSTALL_PROGRAM} ${WRKSRC}/goodies/appbar/appbar ${PREFIX}/bin/jewel-appbar
+	${INSTALL_PROGRAM} ${WRKSRC}/goodies/fspanel/fspanel ${PREFIX}/bin/jewel-fspanel
+	${INSTALL_PROGRAM} ${WRKSRC}/goodies/setrootimage/setrootimage ${PREFIX}/bin/jewel-setrootimage
+	${INSTALL_PROGRAM} ${WRKSRC}/goodies/xsession/xsession ${PREFIX}/bin/jewel-xsession
+	${INSTALL_MAN} ${WRKSRC}/${MAN1} ${PREFIX}/man/man1
 .if !defined(NOPORTDOCS)
-	${MKDIR} ${PREFIX}/${DOCDIR}
+	${MKDIR} ${DOCSDIR}
 .for ii in ${DOCS}
-	${INSTALL_DATA} ${WRKSRC}/${ii} ${PREFIX}/${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/${ii} ${DOCSDIR}/
 .endfor
 .endif
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
--- /dev/null	2007-12-06 22:28:28.000000000 +0100
+++ pkg-plist	2007-12-06 22:02:53.000000000 +0100
@@ -0,0 +1,12 @@
+bin/jewel
+bin/jewel-appbar
+bin/jewel-fspanel
+bin/jewel-setrootimage
+bin/jewel-xsession
+%%PORTDOCS%%%%DOCSDIR%%/Changelog
+%%PORTDOCS%%%%DOCSDIR%%/Changelog.DLR
+%%PORTDOCS%%%%DOCSDIR%%/Changelog.jewel
+%%PORTDOCS%%%%DOCSDIR%%/INSTALL
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
--- /dev/null	2007-12-06 22:28:28.000000000 +0100
+++ files/patch-goodies-appbar_icon.cc	2007-12-06 21:15:31.000000000 +0100
@@ -0,0 +1,29 @@
+--- goodies/appbar/icon.cc.orig	2007-12-06 21:09:37.000000000 +0100
++++ goodies/appbar/icon.cc	2007-12-06 21:15:12.000000000 +0100
+@@ -35,7 +35,7 @@
+ 
+ #include "icon.hh"
+ 
+-char * default_icon_xpm[] = {
++const char * default_icon_xpm[] = {
+ "16 16 16 1",
+ " 	c None",
+ ".	c #323232",
+@@ -101,7 +101,7 @@
+ 	
+ 	if(! XpmCreatePixmapFromData(dpy, 
+ 		icon_win,
+-		default_icon_xpm,
++		(char **)default_icon_xpm,
+ 		&icon_pixmap,
+ 		&icon_pixmap_mask,
+ 		&icon_pixmap_attr)==XpmSuccess)
+@@ -165,7 +165,7 @@
+ 		
+ 		if(! XpmCreatePixmapFromData(dpy, 
+ 			icon_win,
+-			default_icon_xpm,
++			(char **)default_icon_xpm,
+ 			&icon_pixmap,
+ 			&icon_pixmap_mask,
+ 			&icon_pixmap_attr)==XpmSuccess)
--- /dev/null	2007-12-06 22:28:28.000000000 +0100
+++ files/patch-goodies-appbar_icon.hh	2007-12-06 21:15:58.000000000 +0100
@@ -0,0 +1,11 @@
+--- goodies/appbar/icon.hh.orig	2007-12-06 21:10:35.000000000 +0100
++++ goodies/appbar/icon.hh	2007-12-06 21:12:21.000000000 +0100
+@@ -43,8 +43,6 @@
+ #include <X11/extensions/shape.h>
+ #include <stdlib.h>
+ 
+-extern char * default_icon_xpm[];
+-
+ class Icon 
+ {
+ private:
--- /dev/null	2007-12-06 22:28:28.000000000 +0100
+++ files/patch-goodies-appbar_main.cc	2007-12-06 20:49:03.000000000 +0100
@@ -0,0 +1,12 @@
+--- goodies/appbar/main.cc.orig	2007-12-06 20:48:09.000000000 +0100
++++ goodies/appbar/main.cc	2007-12-06 20:48:46.000000000 +0100
+@@ -33,6 +33,9 @@
+  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+  */
+ 
++#include <iostream>
++using namespace std;
++
+ #include "appbar.hh"
+ 
+ int main(int argc, char* argv[])
--- /dev/null	2007-12-06 22:28:28.000000000 +0100
+++ files/patch-goodies-appbar_scanner.cc	2007-12-06 20:50:41.000000000 +0100
@@ -0,0 +1,29 @@
+--- goodies/appbar/scanner.cc.orig	2007-12-06 20:49:35.000000000 +0100
++++ goodies/appbar/scanner.cc	2007-12-06 20:50:28.000000000 +0100
+@@ -156,7 +156,7 @@
+ {
+ 	s_token.empty();	
+ 
+-	while(char_class[character]==type)
++	while(char_class[(int) character]==type)
+ 	{
+ 		s_token += character;
+ 
+@@ -177,7 +177,7 @@
+ 		if (!spaces) {
+ 			char_class[' ']=whitespace;	
+ 
+-			while(char_class[character]==whitespace)
++			while(char_class[(int)character]==whitespace)
+ 			{
+ 				if( inputFile.eof() ) return;
+ 		
+@@ -192,7 +192,7 @@
+ 		}
+ 	}
+ 
+-	if (! inputFile.eof() ) { concat( char_class[character] ); }
++	if (! inputFile.eof() ) { concat( char_class[(int)character] ); }
+ }
+ 
+ bool Scanner::match( std::string m )
--- /dev/null	2007-12-06 22:37:41.000000000 +0100
+++ files/patch-goodies-fspanel_fspanel.c	2007-12-06 22:37:18.000000000 +0100
@@ -0,0 +1,12 @@
+--- goodies/fspanel/fspanel.c.orig	2007-12-06 22:35:02.000000000 +0100
++++ goodies/fspanel/fspanel.c	2007-12-06 22:37:02.000000000 +0100
+@@ -393,7 +393,8 @@
+ 
+ void scale_icon (task *tk)
+ {
+-	int xx, yy, x, y, w, h, d, bw;
++	int xx, yy, x, y;
++	unsigned int w, h, d, bw;
+ 	Pixmap pix, mk = None;
+ 	XGCValues gcv;
+ 	GC mgc=None;
--- /dev/null	2007-12-06 22:28:28.000000000 +0100
+++ files/patch-goodies-setrootimage_image.hh	2007-12-06 21:35:02.000000000 +0100
@@ -0,0 +1,10 @@
+--- goodies/setrootimage/image.hh.orig	2007-12-06 21:28:22.000000000 +0100
++++ goodies/setrootimage/image.hh	2007-12-06 21:34:53.000000000 +0100
+@@ -27,6 +27,7 @@
+ #include <cstdio>
+ 
+ #include <list>
++using namespace std;
+ 
+ class BImageControl;
+ class BImage;
--- /dev/null	2007-12-06 22:28:28.000000000 +0100
+++ files/patch-goodies-setrootimage_setrootimage.cc	2007-12-06 21:24:46.000000000 +0100
@@ -0,0 +1,41 @@
+--- goodies/setrootimage/setrootimage.cc.orig	2007-12-06 21:20:21.000000000 +0100
++++ goodies/setrootimage/setrootimage.cc	2007-12-06 21:24:15.000000000 +0100
+@@ -31,6 +31,9 @@
+  * Released under the GNU GPL license
+  * www.gnu.org
+  */
++#include <iostream>
++using namespace std;
++
+ #include <X11/Xlib.h>
+ #include <X11/xpm.h>
+ #include <stdlib.h>
+@@ -56,10 +59,11 @@
+ 		temp_blue[1] = the_color[i];
+ 	}
+ 
+-	color.red = strtol(temp_red,0,16);
++	color.pixel = 0;
++   color.red = strtol(temp_red,0,16);
+ 	color.green = strtol(temp_green,0,16);
+ 	color.blue = strtol(temp_blue,0,16);
+-	
++
+ 	return color;
+ }
+ 
+@@ -86,10 +90,10 @@
+ 	Pixmap root_pix = None;
+ 	BColor to, from;
+ 	
+-	char* opt_color="no color";
+-	char* opt_from="708090";
+-	char* opt_to="ffffff"; 
+-	char* opt_display="";
++	char* opt_color=(char *)"no color";
++	char* opt_from=(char *)"708090";
++	char* opt_to=(char *)"ffffff"; 
++	char* opt_display=(char *)"";
+ 
+ 	int width=0;
+ 	int height=0;
--- /dev/null	2007-12-06 22:28:28.000000000 +0100
+++ files/patch-windowmanager.cc	2007-12-06 20:47:24.000000000 +0100
@@ -0,0 +1,77 @@
+--- windowmanager.cc.orig	2007-12-06 20:41:35.000000000 +0100
++++ windowmanager.cc	2007-12-06 20:47:01.000000000 +0100
+@@ -51,24 +51,24 @@
+ 	// Set the global window manager object to this please =)
+     	wm = this;
+ 	
+-	window_manager_name="jewel";
++	window_manager_name=(char *)"jewel";
+ 
+ 	// Make the default options equal something
+-    	opt_font = DEF_FONT;
+-	opt_fm = DEF_FM;
+-    	opt_fg = DEF_FG;
+-    	opt_fc = DEF_FC;
+-    	opt_bg = DEF_BG;
+-    	opt_bd = DEF_BD;
+-    	opt_tj = TEXT_JUSTIFY;
+-	opt_wm = WIRE_MOVE;
+-	opt_es = EDGE_SNAP;
+-	opt_newkey = DEF_NEWKEY;
+-    	opt_new1 = DEF_NEW1;
+-    	opt_new2 = DEF_NEW2;
++    	opt_font = (char *)DEF_FONT;
++	   opt_fm = (char *)DEF_FM;
++    	opt_fg = (char *)DEF_FG;
++    	opt_fc = (char *)DEF_FC;
++    	opt_bg = (char *)DEF_BG;
++    	opt_bd = (char *)DEF_BD;
++    	opt_tj = (char *)TEXT_JUSTIFY;
++	   opt_wm = (char *)WIRE_MOVE;
++	   opt_es = (char *)EDGE_SNAP;
++	   opt_newkey = (char *)DEF_NEWKEY;
++    	opt_new1 = (char *)DEF_NEW1;
++    	opt_new2 = (char *)DEF_NEW2;
+     	opt_bw = DEF_BW;
+     	opt_display=NULL;
+-	maxDesktops=MAX_DESKTOPS;
++	   maxDesktops=MAX_DESKTOPS;
+ 
+ // These macro's are nice to test values passed in 
+ // the command line arguments	
+@@ -1557,21 +1557,21 @@
+ 		// find the client in the list...
+ 		it = find(clientList->begin(), clientList->end(), c);
+ 
+-		if ( it == NULL || it == clientList->end()) {
++		if ( it == clientList->end()) {
+ 			it = clientList->begin();
+ 		}
+ 
+ 		do {
+ 			cycles++;
+-			if ( it != clientList->end() && it != NULL ) {
++			if ( it == clientList->end() ) {
++				it = clientList->begin();
++			}
++			else {
+ 				it++;
+ 				if ( it == clientList->end() ) {
+ 					it = clientList->begin();
+ 				}
+ 			}
+-			else {
+-				it = clientList->begin();
+-			}
+ 		} while (cycles < clientList->size() && (shouldSkipThisWindow((*it)->getAppWindow()) || (*it)->isIconified() || (*it)->belongsToWhichDesktop() != currentDesktop));
+ 		
+ #ifdef DEBUG
+@@ -1588,7 +1588,7 @@
+ 
+ 		// if we found a suitable "next client", raise and focus
+ 		// it; otherwise, leave focus where it is
+-		if ( cycles < clientList->size() && it != NULL && it != clientList->end() && !shouldSkipThisWindow((*it)->getAppWindow()) && !(*it)->isIconified() && (*it)->belongsToWhichDesktop() == currentDesktop && !shouldSkipThisWindow((*it)->getAppWindow())) {
++		if ( cycles < clientList->size() && !(it == clientList->end()) && !shouldSkipThisWindow((*it)->getAppWindow()) && !(*it)->isIconified() && (*it)->belongsToWhichDesktop() == currentDesktop && !shouldSkipThisWindow((*it)->getAppWindow())) {
+ 			c = *it;
+ 			c->raise();
+ 			setFocusedClient(c);
--- /dev/null	2007-12-06 22:55:00.000000000 +0100
+++ files/patch-goodies-xsession_Makefile	2007-12-06 22:51:38.000000000 +0100
@@ -0,0 +1,16 @@
+--- goodies/xsession//Makefile.orig	2007-12-06 22:50:47.000000000 +0100
++++ goodies/xsession//Makefile	2007-12-06 22:51:06.000000000 +0100
+@@ -1,10 +1,12 @@
+ # Taken from fspanel Makefile by MJR
+ 
+ CC = gcc
+-C_FLAGS = -DNOSTDLIB -DHAVE_XPM -Wall -I$(XROOT)/include -m386 -malign-loops=2 -malign-jumps=2 -malign-functions=2
++C_FLAGS = -DNOSTDLIB -DHAVE_XPM -Wall -I$(XROOT)/include -falign-loops=2 -falign-jumps=2 -falign-functions=2
+ L_FLAGS = -O1 -Xlinker -s -L$(XROOT)/lib -lX11 -lXpm
+ PROGNAME = xsession
+ 
++all: $(PROGNAME)
++
+ $(PROGNAME): Makefile xsession.c
+ 	$(CC) $(C_FLAGS) $(L_FLAGS) xsession.c -o $(PROGNAME)
+ 	@ls -l $(PROGNAME)
--- /dev/null	2007-12-06 22:55:00.000000000 +0100
+++ files/patch-goodies-fspanel_Makefile	2007-12-06 22:50:16.000000000 +0100
@@ -0,0 +1,21 @@
+--- goodies/fspanel/Makefile.orig	2007-12-06 22:49:22.000000000 +0100
++++ goodies/fspanel/Makefile	2007-12-06 22:49:58.000000000 +0100
+@@ -1,8 +1,10 @@
+ CC = gcc
+-C_FLAGS = -DNOSTDLIB -DHAVE_XPM -Wall -I$(XROOT)/include -m386 -malign-loops=2 -malign-jumps=2 -malign-functions=2
++C_FLAGS = -DNOSTDLIB -DHAVE_XPM -Wall -I$(XROOT)/include -falign-loops=2 -falign-jumps=2 -falign-functions=2
+ L_FLAGS = -O1 -Xlinker -s -L$(XROOT)/lib -lX11 -lXpm
+ PROGNAME = fspanel
+ 
++all: $(PROGNAME)
++
+ $(PROGNAME): Makefile fspanel.c fspanel.h icon.xpm
+ 	$(CC) $(C_FLAGS) $(L_FLAGS) fspanel.c -o $(PROGNAME)
+ 	@ls -l $(PROGNAME)
+@@ -14,4 +16,4 @@
+ 	cp -r $(PROGNAME) $(DESTDIR)$(prefix)/bin
+ 
+ uninstall:
+-	rm $(DESTDIR)$(prefix)/bin/$(PROGNAME)
+\ No newline at end of file
++	rm $(DESTDIR)$(prefix)/bin/$(PROGNAME)
--- _jewel.diff ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list