Bug 178600 - Fixing x11/fireflies [patch]
Summary: Fixing x11/fireflies [patch]
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Stefan Walter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-13 19:50 UTC by Mikhail T.
Modified: 2013-05-15 06:30 UTC (History)
0 users

See Also:


Attachments
file.diff (5.07 KB, patch)
2013-05-13 19:50 UTC, Mikhail T.
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail T. 2013-05-13 19:47:54 UTC
>Number:         178600
>Category:       ports
>Synopsis:       Fixing x11/fireflies [patch]
>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:   Mon May 13 18:50:01 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Mikhail T.
>Release:        FreeBSD 9.1-PRERELEASE amd64
>Organization:
Virtual Estates, Inc.	http://sybpipe.com/
>Environment:
System: FreeBSD narawntapu 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #6 r244476: Wed Dec 19 23:40:59 EST 2012 root@narawntapu:/usr/obj/cache/src/sys/POWEREDGE2900 amd64

>Description:
	x11/fireflies, which is (or recently was) required by xscreensaver,
	is currently marked as conflicting with PNG. This, effectively,
	makes it broken for all systems with any meaningful GUI -- where
	a screensaver can be used in the first place.

	The problem is not with the fireflies itself, but with the (old)
	version of libgfx, which is, rather unfortunately, bundled with
	the fireflies distribution.

>How-To-Repeat:
>Fix:

	The attached patch fixes fireflies to use th libgfx installed
	by graphics/libgfx instead of its own. graphics/libgfx
	installs a newer version of the software AND patches that
	same PNG incompatibility, that broke fireflies itself.

	Additional fixes include make fireflies compilable with newer
	compilers (gcc47, gcc48), remove gmake-requirement, and otherwise
	make the world a better place.

Index: Makefile
===================================================================
--- Makefile	(revision 318121)
+++ Makefile	(working copy)
@@ -3,18 +3,19 @@
 
 PORTNAME=	fireflies
 PORTVERSION=	2.07
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	x11
 MASTER_SITES=	http://somewhere.fscked.org/proj/fireflies/files/
 
 MAINTAINER=	umeno@rr.iij4u.or.jp
 COMMENT=	Extension of xscreensaver
 
-CONFLICTS=	png-[0-9]*
+LIB_DEPENDS=	gfx:${PORTSDIR}/graphics/libgfx
 
 GNU_CONFIGURE=	yes
-USE_GMAKE=	yes
 USE_GL=		yes
+EXTRACT_AFTER_ARGS=--exclude '${DISTNAME}/libgfx*'
+MAKE_JOBS_SAFE=	yes
 
 CPPFLAGS+=	-I${LOCALBASE}/include -I${LOCALBASE}/include/GL
 LDFLAGS+=	-L${LOCALBASE}/lib
@@ -26,10 +27,4 @@
 		CONFIGURE_SCRIPT=${CONFIGURE_SCRIPT:Q} \
 		CONFIGURE_ARGS=${CONFIGURE_ARGS:Q}
 
-post-extract:
-	@(cd ${WRKSRC};  ${TAR} zxpf libgfx-1.0.1.tar.gz)
-
-post-patch:
-	@${REINPLACE_CMD} -e 's|fltk|ignored-&|' ${WRKSRC}/libgfx/configure
-
 .include <bsd.port.mk>
Index: files/patch-Make.include.in
===================================================================
--- files/patch-Make.include.in	(revision 318121)
+++ files/patch-Make.include.in	(working copy)
@@ -6,8 +6,8 @@
  
 -CFLAGS = -Wall -I../libgfx/include/ $(SDL_CFLAGS) @CFLAGS@
 -LIBS = ../libgfx/src/libgfx.a $(GL_LIBS) $(SDL_LIBS) $(OPT_LIBS) @LIBS@
-+CFLAGS = -Wall -I$(LOCALBASE)/include -I../libgfx/include/ $(SDL_CFLAGS) @CFLAGS@
-+LIBS = ../libgfx/src/libgfx.a $(SDL_LIBS) $(OPT_LIBS) -L$(LOCALBASE)/lib $(GL_LIBS) @LIBS@ 
++CFLAGS = -Wall -I$(LOCALBASE)/include $(SDL_CFLAGS) @CFLAGS@
++LIBS = $(SDL_LIBS) $(OPT_LIBS) -L$(LOCALBASE)/lib -lgfx $(GL_LIBS) @LIBS@ -lX11
  
  OBJECTS = arrow.o bait.o firefly.o scene.o tail.o utils.o modes.o @OPT_OBJS@
  PROGRAM = @PROGRAM@
Index: files/patch-Makefile
===================================================================
--- files/patch-Makefile	(revision 318121)
+++ files/patch-Makefile	(working copy)
@@ -1,4 +1,4 @@
---- Makefile.orig	Tue May  6 15:00:40 2003
+--- Makefile	Tue May  6 15:00:40 2003
 +++ Makefile	Tue Dec  5 16:44:03 2006
 @@ -1,4 +1,4 @@
 -include Make.include
@@ -6,26 +6,12 @@
  
  DISTFILES=\
  add-xscreensaver \
-@@ -21,18 +21,17 @@
+@@ -21,6 +21,6 @@
  win32/
  
- all:	libgfx/src/libgfx.a
+-all:	libgfx/src/libgfx.a
 -	cd src && make
++all:
 +	cd src && ${MAKE}
  
  libgfx/src/libgfx.a:
--	gunzip -c libgfx-1.0.1.tar.gz | tar x
--	cd libgfx && ./configure && cd src && make
-+	cd libgfx && ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} && cd src && ${MAKE}
- 
- install: all
- 	sh ./installit $(DESTDIR)
- 
- clean:
--	make -C src clean
--	make -C win32 clean
-+	${MAKE} -C src clean
-+	${MAKE} -C win32 clean
- 
- dist:
- 	rm -rf fireflies-$(VERSION)
Index: files/patch-src-main.cc
===================================================================
--- files/patch-src-main.cc	(revision 318121)
+++ files/patch-src-main.cc	(working copy)
@@ -1,5 +1,5 @@
---- src/main.cc.orig	Tue Jun 24 05:55:04 2003
-+++ src/main.cc	Wed Feb 15 02:32:39 2006
+--- src/main.cc	2003-06-23 16:55:04.000000000 -0400
++++ src/main.cc	2013-05-13 14:24:28.000000000 -0400
 @@ -15,8 +15,10 @@
  #ifdef WIN32
  #include <windows.h>
@@ -20,3 +20,12 @@
  // mingw doesn't have argp. implement half-assed version
  
  #define OPTION_HIDDEN 1
+@@ -187,7 +189,7 @@
+ #define OPT_FPS 2
+ #define OPT_FASTFORWARD 3
+ 
+-char *mode_help =
++const char *mode_help =
+ "\n"
+ "Per-swarm modes and their default probabilities:\n"
+ "  1: normal                                         p=20\n"
Index: files/patch-warnings
===================================================================
--- files/patch-warnings	(revision 0)
+++ files/patch-warnings	(working copy)
@@ -0,0 +1,43 @@
+--- src/canvas_sdl.h	2003-04-26 14:01:42.000000000 -0400
++++ src/canvas_sdl.h	2013-05-13 14:28:04.000000000 -0400
+@@ -10,11 +10,11 @@
+ protected:
+     SDL_Surface *surface;
+-    char *wm_title;
+-    char *wm_class;
++    const char *wm_title;
++    const char *wm_class;
+ 
+     // create the window (either SDL or GLX)
+     virtual int create_window();
+ public:
+-    CanvasSDL(Scene *s, bool full_screen, int mspf, char *wm_title, char *wm_class);
++    CanvasSDL(Scene *s, bool full_screen, int mspf, const char *wm_title, const char *wm_class);
+     virtual ~CanvasSDL() {}
+ 
+--- src/canvas_sdl.cc	2004-02-05 16:58:24.000000000 -0500
++++ src/canvas_sdl.cc	2013-05-13 14:27:03.000000000 -0400
+@@ -10,5 +10,5 @@
+ using namespace std;
+ 
+-CanvasSDL::CanvasSDL(Scene *s, bool fs, int m, char *t, char *c)
++CanvasSDL::CanvasSDL(Scene *s, bool fs, int m, const char *t, const char *c)
+     : CanvasBase(s, fs, m), wm_title(t), wm_class(c)
+ {
+--- src/vroot.h	2005-12-08 22:07:30.000000000 -0500
++++ src/vroot.h	2013-05-13 14:30:56.000000000 -0400
+@@ -82,4 +82,5 @@
+ #include <X11/Xatom.h>
+ #include <X11/Xlib.h>
++#include <stdio.h>	/* For sscanf */
+ 
+ static Window
+@@ -96,7 +97,6 @@
+ 		Display *dpy = DisplayOfScreen(screen);
+ 		Atom __SWM_VROOT = None;
+-		int i;
+ 		Window rootReturn, parentReturn, *children;
+-		unsigned int numChildren;
++		unsigned int i, numChildren;
+ 
+     /* first check for a hex or decimal window ID in the environment */
>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
freebsd-ports-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports-bugs
To unsubscribe, send any mail to "freebsd-ports-bugs-unsubscribe@freebsd.org"
Comment 1 Mikhail T. 2013-05-13 19:50:01 UTC
	x11/fireflies, which is (or recently was) required by xscreensaver,
	is currently marked as conflicting with PNG. This, effectively,
	makes it broken for all systems with any meaningful GUI -- where
	a screensaver can be used in the first place.

	The problem is not with the fireflies itself, but with the (old)
	version of libgfx, which is, rather unfortunately, bundled with
	the fireflies distribution.

Fix: The attached patch fixes fireflies to use th libgfx installed
	by graphics/libgfx instead of its own. graphics/libgfx
	installs a newer version of the software AND patches that
	same PNG incompatibility, that broke fireflies itself.

	Additional fixes include make fireflies compilable with newer
	compilers (gcc47, gcc48), remove gmake-requirement, and otherwise
	make the world a better place.
Comment 2 Edwin Groothuis freebsd_committer 2013-05-13 19:50:08 UTC
Maintainer of x11/fireflies,

Please note that PR ports/178600 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/178600

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer 2013-05-13 19:50:09 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Stefan Walter freebsd_committer 2013-05-13 22:18:28 UTC
Responsible Changed
From-To: freebsd-ports-bugs->stefan

Take.
Comment 5 sean_bruno 2013-05-14 12:31:22 UTC
This patch resolves build failures for me.  With this patch, I can
confirm that this port works on -head.

sean
Comment 6 dfilter service freebsd_committer 2013-05-14 17:16:54 UTC
Author: stefan
Date: Tue May 14 16:16:40 2013
New Revision: 318168
URL: http://svnweb.freebsd.org/changeset/ports/318168

Log:
  - Fix conflict/build failure with png by using libgfx from the ports tree
    instead of the bundled one.
  - Fix build with new compilers.
  - Remove gmake dependency.
  
  PR:		178600
  Submitted by:	"Mikhail T." <mi@aldan.algebra.com>

Added:
  head/x11/fireflies/files/patch-warnings   (contents, props changed)
Modified:
  head/x11/fireflies/Makefile   (contents, props changed)
  head/x11/fireflies/files/patch-Make.include.in   (contents, props changed)
  head/x11/fireflies/files/patch-Makefile   (contents, props changed)
  head/x11/fireflies/files/patch-src-main.cc   (contents, props changed)

Modified: head/x11/fireflies/Makefile
==============================================================================
--- head/x11/fireflies/Makefile	Tue May 14 16:12:01 2013	(r318167)
+++ head/x11/fireflies/Makefile	Tue May 14 16:16:40 2013	(r318168)
@@ -3,18 +3,19 @@
 
 PORTNAME=	fireflies
 PORTVERSION=	2.07
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	x11
 MASTER_SITES=	http://somewhere.fscked.org/proj/fireflies/files/
 
 MAINTAINER=	umeno@rr.iij4u.or.jp
 COMMENT=	Extension of xscreensaver
 
-CONFLICTS=	png-[0-9]*
+LIB_DEPENDS=	gfx:${PORTSDIR}/graphics/libgfx
 
 GNU_CONFIGURE=	yes
-USE_GMAKE=	yes
 USE_GL=		yes
+EXTRACT_AFTER_ARGS=--exclude '${DISTNAME}/libgfx*'
+MAKE_JOBS_SAFE=	yes
 
 CPPFLAGS+=	-I${LOCALBASE}/include -I${LOCALBASE}/include/GL
 LDFLAGS+=	-L${LOCALBASE}/lib
@@ -26,10 +27,4 @@ MAKE_ARGS=	CONFIGURE_ENV=${CONFIGURE_ENV
 		CONFIGURE_SCRIPT=${CONFIGURE_SCRIPT:Q} \
 		CONFIGURE_ARGS=${CONFIGURE_ARGS:Q}
 
-post-extract:
-	@(cd ${WRKSRC};  ${TAR} zxpf libgfx-1.0.1.tar.gz)
-
-post-patch:
-	@${REINPLACE_CMD} -e 's|fltk|ignored-&|' ${WRKSRC}/libgfx/configure
-
 .include <bsd.port.mk>

Modified: head/x11/fireflies/files/patch-Make.include.in
==============================================================================
--- head/x11/fireflies/files/patch-Make.include.in	Tue May 14 16:12:01 2013	(r318167)
+++ head/x11/fireflies/files/patch-Make.include.in	Tue May 14 16:16:40 2013	(r318168)
@@ -6,8 +6,8 @@
  
 -CFLAGS = -Wall -I../libgfx/include/ $(SDL_CFLAGS) @CFLAGS@
 -LIBS = ../libgfx/src/libgfx.a $(GL_LIBS) $(SDL_LIBS) $(OPT_LIBS) @LIBS@
-+CFLAGS = -Wall -I$(LOCALBASE)/include -I../libgfx/include/ $(SDL_CFLAGS) @CFLAGS@
-+LIBS = ../libgfx/src/libgfx.a $(SDL_LIBS) $(OPT_LIBS) -L$(LOCALBASE)/lib $(GL_LIBS) @LIBS@ 
++CFLAGS = -Wall -I$(LOCALBASE)/include $(SDL_CFLAGS) @CFLAGS@
++LIBS = $(SDL_LIBS) $(OPT_LIBS) -L$(LOCALBASE)/lib -lgfx $(GL_LIBS) @LIBS@ -lX11
  
  OBJECTS = arrow.o bait.o firefly.o scene.o tail.o utils.o modes.o @OPT_OBJS@
  PROGRAM = @PROGRAM@

Modified: head/x11/fireflies/files/patch-Makefile
==============================================================================
--- head/x11/fireflies/files/patch-Makefile	Tue May 14 16:12:01 2013	(r318167)
+++ head/x11/fireflies/files/patch-Makefile	Tue May 14 16:16:40 2013	(r318168)
@@ -1,4 +1,4 @@
---- Makefile.orig	Tue May  6 15:00:40 2003
+--- Makefile	Tue May  6 15:00:40 2003
 +++ Makefile	Tue Dec  5 16:44:03 2006
 @@ -1,4 +1,4 @@
 -include Make.include
@@ -6,26 +6,12 @@
  
  DISTFILES=\
  add-xscreensaver \
-@@ -21,18 +21,17 @@
+@@ -21,6 +21,6 @@
  win32/
  
- all:	libgfx/src/libgfx.a
+-all:	libgfx/src/libgfx.a
 -	cd src && make
++all:
 +	cd src && ${MAKE}
  
  libgfx/src/libgfx.a:
--	gunzip -c libgfx-1.0.1.tar.gz | tar x
--	cd libgfx && ./configure && cd src && make
-+	cd libgfx && ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} && cd src && ${MAKE}
- 
- install: all
- 	sh ./installit $(DESTDIR)
- 
- clean:
--	make -C src clean
--	make -C win32 clean
-+	${MAKE} -C src clean
-+	${MAKE} -C win32 clean
- 
- dist:
- 	rm -rf fireflies-$(VERSION)

Modified: head/x11/fireflies/files/patch-src-main.cc
==============================================================================
--- head/x11/fireflies/files/patch-src-main.cc	Tue May 14 16:12:01 2013	(r318167)
+++ head/x11/fireflies/files/patch-src-main.cc	Tue May 14 16:16:40 2013	(r318168)
@@ -1,5 +1,5 @@
---- src/main.cc.orig	Tue Jun 24 05:55:04 2003
-+++ src/main.cc	Wed Feb 15 02:32:39 2006
+--- src/main.cc	2003-06-23 16:55:04.000000000 -0400
++++ src/main.cc	2013-05-13 14:24:28.000000000 -0400
 @@ -15,8 +15,10 @@
  #ifdef WIN32
  #include <windows.h>
@@ -20,3 +20,12 @@
  // mingw doesn't have argp. implement half-assed version
  
  #define OPTION_HIDDEN 1
+@@ -187,7 +189,7 @@
+ #define OPT_FPS 2
+ #define OPT_FASTFORWARD 3
+ 
+-char *mode_help =
++const char *mode_help =
+ "\n"
+ "Per-swarm modes and their default probabilities:\n"
+ "  1: normal                                         p=20\n"

Added: head/x11/fireflies/files/patch-warnings
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/fireflies/files/patch-warnings	Tue May 14 16:16:40 2013	(r318168)
@@ -0,0 +1,43 @@
+--- src/canvas_sdl.h	2003-04-26 14:01:42.000000000 -0400
++++ src/canvas_sdl.h	2013-05-13 14:28:04.000000000 -0400
+@@ -10,11 +10,11 @@
+ protected:
+     SDL_Surface *surface;
+-    char *wm_title;
+-    char *wm_class;
++    const char *wm_title;
++    const char *wm_class;
+ 
+     // create the window (either SDL or GLX)
+     virtual int create_window();
+ public:
+-    CanvasSDL(Scene *s, bool full_screen, int mspf, char *wm_title, char *wm_class);
++    CanvasSDL(Scene *s, bool full_screen, int mspf, const char *wm_title, const char *wm_class);
+     virtual ~CanvasSDL() {}
+ 
+--- src/canvas_sdl.cc	2004-02-05 16:58:24.000000000 -0500
++++ src/canvas_sdl.cc	2013-05-13 14:27:03.000000000 -0400
+@@ -10,5 +10,5 @@
+ using namespace std;
+ 
+-CanvasSDL::CanvasSDL(Scene *s, bool fs, int m, char *t, char *c)
++CanvasSDL::CanvasSDL(Scene *s, bool fs, int m, const char *t, const char *c)
+     : CanvasBase(s, fs, m), wm_title(t), wm_class(c)
+ {
+--- src/vroot.h	2005-12-08 22:07:30.000000000 -0500
++++ src/vroot.h	2013-05-13 14:30:56.000000000 -0400
+@@ -82,4 +82,5 @@
+ #include <X11/Xatom.h>
+ #include <X11/Xlib.h>
++#include <stdio.h>	/* For sscanf */
+ 
+ static Window
+@@ -96,7 +97,6 @@
+ 		Display *dpy = DisplayOfScreen(screen);
+ 		Atom __SWM_VROOT = None;
+-		int i;
+ 		Window rootReturn, parentReturn, *children;
+-		unsigned int numChildren;
++		unsigned int i, numChildren;
+ 
+     /* first check for a hex or decimal window ID in the environment */
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 7 Stefan Walter freebsd_committer 2013-05-14 17:17:09 UTC
State Changed
From-To: feedback->closed

Committed, thanks!