===> Generating patch
===> Viewing diff with more
diff -ruN /usr/ports/devel/allegro/Makefile ./Makefile
--- /usr/ports/devel/allegro/Makefile	2013-07-26 18:18:54.000000000 +0200
+++ ./Makefile	2013-07-31 12:48:07.000000000 +0200
@@ -2,36 +2,50 @@
 
 PORTNAME=	allegro
 DISTVERSION=	4.4.2
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	devel
 MASTER_SITES=	SF/alleg/allegro/${PORTVERSION}
+DISTFILES=	${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}
+DIST_SUBDIR=	${PORTNAME}
+EXTRACT_ONLY=	${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}
 
 MAINTAINER=	nemysis@gmx.ch
 COMMENT=	Cross-platform library for games and multimedia programming
 
-USE_GMAKE=	yes
+LIB_DEPENDS+=	png15:${PORTSDIR}/graphics/png
+
 USES=		cmake pkgconfig
 USE_XORG=	x11 xpm xext xcursor xxf86vm xxf86dga
-USE_LDCONFIG=	yes
-WANT_GNOME=	yes
 USE_GL=		gl glu
+USE_LDCONFIG=	yes
+MAKE_JOBS_SAFE=	yes
 
-MAKE_JOBS_UNSAFE=	yes
+CFLAGS+=	-L${LOCALBASE}/lib
 
 PORTDOCS=	*
+PORTEXAMPLES=	*
 
-CONFLICTS=	allegro-devel-[0-9]*
-PLIST_SUB=	SHLIB_VER="${SHLIB_VER}"
+PLIST_SUB+= 	SHLIB_VER="${SHLIB_VER}"
 CMAKE_ARGS+=	-DDOCDIR="${DOCSDIR}"
 
-SHLIB_VER=	4.4.2
+SHLIB_VER=	${PORTVERSION}
 
-PORTSCOUT=	limit:^4\.3\.[0-9]*
+# Wrong versioning upstream
+PORTSCOUT=	ignore:1
 
-CFLAGS+=	-L${LOCALBASE}/lib
-LIB_DEPENDS+=	asound.2:${PORTSDIR}/audio/alsa-lib \
-		jack.0:${PORTSDIR}/audio/jack \
-		png15:${PORTSDIR}/graphics/png
+OPTIONS_DEFINE=	DOCS ALSA JACK OGG
+OPTIONS_GROUP=	EXAMPLES_DEMOS
+OPTIONS_GROUP_EXAMPLES_DEMOS=	EXAMPLES DEMOS
+OPTIONS_DEFAULT=	DEMOS ALSA OGG
+DEMOS_DESC=	Install Demos programs, requires EXAMPLES
+
+OPTIONS_SUB=	yes
+
+DOCSRCDIR1=	${WRKSRC}
+DOC_FILES1=	AUTHORS CHANGES THANKS readme.txt
+
+DOCSRCDIR2=	${WRKSRC}/docs
+DOCSDIR2=	${DOCSDIR}/docs
 
 .include <bsd.port.options.mk>
 
@@ -40,9 +54,59 @@
 INFO=		allegro
 .endif
 
+.if ${PORT_OPTIONS:MEXAMPLES}
+CMAKE_ARGS+=-DWANT_EXAMPLES=on
+.else
+CMAKE_ARGS+=-DWANT_EXAMPLES=off
+.endif
+
+.if ${PORT_OPTIONS:MALSA}
+LIB_DEPENDS+=	asound.2:${PORTSDIR}/audio/alsa-lib
+CMAKE_ARGS+=-DWANT_ALSA=on
+.else
+CMAKE_ARGS+=-DWANT_ALSA=off
+.endif
+
+.if ${PORT_OPTIONS:MJACK}
+LIB_DEPENDS+=	jack:${PORTSDIR}/audio/jack
+CMAKE_ARGS+=-DWANT_JACK=on
+.else
+CMAKE_ARGS+=-DWANT_JACK=off
+.endif
+
+.if ${PORT_OPTIONS:MOGG}
+LIB_DEPENDS+=	ogg:${PORTSDIR}/audio/libogg
+CMAKE_ARGS+=-DWANT_LOGG=on
+.else
+CMAKE_ARGS+=-DWANT_LOGG=off
+.endif
+
+.if ${PORT_OPTIONS:MDEMOS} && ${PORT_OPTIONS:MEXAMPLES}
+SUB_FILES+=	shooter skater skater_agl \
+		pkg-message
+MASTER_SITES+=	SF/nemysisfreebsdp/allegro/:icons
+DISTFILES+=	shooter.png:icons \
+		skater.png:icons
+DESKTOP_ENTRIES+="Shooter" "In a distant corner of the galaxy" "shooter" \
+		"shooter" "Game;ArcadeGame;" false
+DESKTOP_ENTRIES+="Skater" "Allegro's next demo game" "skater" \
+		"skater" "Game;ArcadeGame;" false
+DESKTOP_ENTRIES+="Skater AGL" "Allegro's next demo game" "skater" \
+		"skater_agl" "Game;ArcadeGame;" false
+.endif
+
 post-patch:
+	@${REINPLACE_CMD} -e 's|/allegro-$${ALLEGRO_VERSION}||' \
+		${WRKSRC}/docs/CMakeLists.txt
+	@${REINPLACE_CMD} -e 's|<X11/extensions/xf86dga.h>|<X11/extensions/Xxf86dga.h>|' \
+		${WRKSRC}/src/x/xdga2.c
+.if ${PORT_OPTIONS:MJACK}
+	@${REINPLACE_CMD} -e 's|jack_client = jack_client_new(jack_client_name);|jack_client = jack_client_open(jack_client_name, (jack_options_t)0, NULL);|' \
+		${WRKSRC}/src/unix/jack.c
+.endif
 .if ! ${PORT_OPTIONS:MDOCS}
-	 @${REINPLACE_CMD} -e 's|add_subdirectory(docs)|#add_subdirectory(docs)|' ${WRKSRC}/CMakeLists.txt
+	@${REINPLACE_CMD} -e 's|add_subdirectory(docs)|#add_subdirectory(docs)|' \
+		${WRKSRC}/CMakeLists.txt
 .endif
 
 post-install:
@@ -51,4 +115,20 @@
 		${FIND} . -type f -and -name "*.3" -exec ${INSTALL_MAN} {} ${PREFIX}/man/man3/{} \;
 .endif
 
+.if ${PORT_OPTIONS:MEXAMPLES}
+	@(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${EXAMPLESDIR})
+.endif
+
+.if ${PORT_OPTIONS:MDEMOS} && ${PORT_OPTIONS:MEXAMPLES}
+	@(cd ${WRKSRC} && ${COPYTREE_SHARE} demos ${EXAMPLESDIR})
+	${INSTALL_SCRIPT} ${WRKDIR}/shooter ${PREFIX}/bin
+	${INSTALL_DATA} ${_DISTDIR}/shooter.png ${PREFIX}/share/pixmaps
+	@(cd ${EXAMPLESDIR}/demos/shooter && ${CHMOD} 755 shooter)
+	${INSTALL_SCRIPT} ${WRKDIR}/skater* ${PREFIX}/bin
+	${INSTALL_DATA} ${_DISTDIR}/skater.png ${PREFIX}/share/pixmaps
+	@(cd ${EXAMPLESDIR}/demos/skater && ${CHMOD} 755 skater*)
+	@${ECHO_CMD}
+	@${CAT} ${PKGMESSAGE}
+	@${ECHO_CMD}
+.endif
 .include <bsd.port.mk>
diff -ruN /usr/ports/devel/allegro/distinfo ./distinfo
--- /usr/ports/devel/allegro/distinfo	2013-07-26 18:18:54.000000000 +0200
+++ ./distinfo	2013-07-28 12:56:29.000000000 +0200
@@ -1,2 +1,6 @@
-SHA256 (allegro-4.4.2.tar.gz) = 1b21e7577dbfada02d85ca4510bd22fedaa6ce76fde7f4838c7c1276eb840fdc
-SIZE (allegro-4.4.2.tar.gz) = 4674902
+SHA256 (allegro/allegro-4.4.2.tar.gz) = 1b21e7577dbfada02d85ca4510bd22fedaa6ce76fde7f4838c7c1276eb840fdc
+SIZE (allegro/allegro-4.4.2.tar.gz) = 4674902
+SHA256 (allegro/shooter.png) = cf73f63f0224a9ee77c287b6211beb4a072ba4aa969a57993e60a2e97996e468
+SIZE (allegro/shooter.png) = 1741
+SHA256 (allegro/skater.png) = f0274627c6eae2ecad880c3e2f25bf5f8944f08829ac32ab0a00f77001e8b2f3
+SIZE (allegro/skater.png) = 3395
diff -ruN /usr/ports/devel/allegro/files/patch-docs_CMakeLists.txt ./files/patch-docs_CMakeLists.txt
--- /usr/ports/devel/allegro/files/patch-docs_CMakeLists.txt	2013-07-26 18:18:53.000000000 +0200
+++ ./files/patch-docs_CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
---- docs/CMakeLists.txt.orig	2010-12-15 13:29:42.000000000 +0600
-+++ docs/CMakeLists.txt	2010-12-15 13:29:49.000000000 +0600
-@@ -9,7 +9,7 @@
- endif()
- 
- set(DOCDIR "doc" CACHE STRING "Install docs into $DOCDIR/allegro-$VERSION")
--set(ACTUAL_DOC_DIR "${DOCDIR}/allegro-${ALLEGRO_VERSION}")
-+set(ACTUAL_DOC_DIR "${DOCDIR}")
- 
- add_executable(makedoc
-     src/makedoc/makedoc.c
diff -ruN /usr/ports/devel/allegro/files/patch-src-x-xkeyboard.c ./files/patch-src-x-xkeyboard.c
--- /usr/ports/devel/allegro/files/patch-src-x-xkeyboard.c	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-src-x-xkeyboard.c	2013-07-28 00:18:01.000000000 +0200
@@ -0,0 +1,19 @@
+--- src/x/xkeyboard.c.orig	2010-12-08 09:13:50.000000000 +0100
++++ src/x/xkeyboard.c	2013-07-28 00:17:52.000000000 +0200
+@@ -23,6 +23,7 @@
+ #include <X11/Xos.h>
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
++#include <X11/XKBlib.h>
+ #include <X11/Xproto.h>
+ 
+ #include "allegro.h"
+@@ -617,7 +618,7 @@
+ 
+       TRACE (PREFIX_I "Modifier %d:", i + 1);
+       for (j = 0; j < xmodmap->max_keypermod; j++) {
+-	 KeySym sym = XKeycodeToKeysym(_xwin.display,
++	 KeySym sym = XkbKeycodeToKeysym(_xwin.display, 0,
+ 	    xmodmap->modifiermap[i * xmodmap->max_keypermod + j], 0);
+          char *sym_str = XKeysymToString(sym);
+          TRACE(" %s", sym_str ? sym_str : "NULL");
diff -ruN /usr/ports/devel/allegro/files/pkg-message.in ./files/pkg-message.in
--- /usr/ports/devel/allegro/files/pkg-message.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/pkg-message.in	2013-07-27 22:53:06.000000000 +0200
@@ -0,0 +1,25 @@
+===============================================================================
+
+Allegro has been installed.
+
+Allegro have two Demos (Games)
+
+Shooter and Skater
+
+
+You can use executable
+
+    %%LOCALBASE%%/bin/shooter
+
+    %%LOCALBASE%%/bin/skater
+
+
+Or can use desktop files
+
+    %%LOCALBASE%%/share/applications/shooter.desktop
+
+    %%LOCALBASE%%/share/applications/skater.desktop
+
+Have fun!
+
+===============================================================================
diff -ruN /usr/ports/devel/allegro/files/shooter.in ./files/shooter.in
--- /usr/ports/devel/allegro/files/shooter.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/shooter.in	2013-07-27 22:54:44.000000000 +0200
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# # $FreeBSD$
+#
+
+cd "%%EXAMPLESDIR%%/demos/shooter"
+exec ./shooter "${@}"
diff -ruN /usr/ports/devel/allegro/files/skater.in ./files/skater.in
--- /usr/ports/devel/allegro/files/skater.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/skater.in	2013-07-27 22:53:54.000000000 +0200
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# # $FreeBSD$
+#
+
+cd "%%EXAMPLESDIR%%/demos/skater"
+exec ./skater "${@}"
diff -ruN /usr/ports/devel/allegro/files/skater_agl.in ./files/skater_agl.in
--- /usr/ports/devel/allegro/files/skater_agl.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/skater_agl.in	2013-07-28 03:51:57.000000000 +0200
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# # $FreeBSD$
+#
+
+cd "%%EXAMPLESDIR%%/demos/skater"
+exec ./skater_agl "${@}"
diff -ruN /usr/ports/devel/allegro/pkg-plist ./pkg-plist
--- /usr/ports/devel/allegro/pkg-plist	2013-07-26 18:18:54.000000000 +0200
+++ ./pkg-plist	2013-07-31 11:12:04.000000000 +0200
@@ -8,6 +8,9 @@
 bin/pack
 bin/pat2dat
 bin/rgbmap
+%%DEMOS%%bin/shooter
+%%DEMOS%%bin/skater
+%%DEMOS%%bin/skater_agl
 bin/textconv
 include/alleggl.h
 include/allegro.h
@@ -113,12 +116,12 @@
 include/allegrogl/gl_header_detect.h
 include/jpgalleg.h
 include/loadpng.h
-include/logg.h
+%%OGG%%include/logg.h
 include/xalleg.h
-lib/allegro/%%SHLIB_VER%%/alleg-alsadigi.so
-lib/allegro/%%SHLIB_VER%%/alleg-alsamidi.so
+%%ALSA%%lib/allegro/%%SHLIB_VER%%/alleg-alsadigi.so
+%%ALSA%%lib/allegro/%%SHLIB_VER%%/alleg-alsamidi.so
 lib/allegro/%%SHLIB_VER%%/alleg-dga2.so
-lib/allegro/%%SHLIB_VER%%/alleg-jack.so
+%%JACK%%lib/allegro/%%SHLIB_VER%%/alleg-jack.so
 lib/allegro/%%SHLIB_VER%%/modules.lst
 lib/liballeg.so
 lib/liballeg.so.4
@@ -126,12 +129,14 @@
 lib/liballeggl.a
 lib/libjpgalleg.a
 lib/libloadpng.a
-lib/liblogg.a
+%%OGG%%lib/liblogg.a
 libdata/pkgconfig/allegro.pc
 libdata/pkgconfig/allegrogl.pc
 libdata/pkgconfig/jpgalleg.pc
 libdata/pkgconfig/loadpng.pc
 libdata/pkgconfig/logg.pc
+%%DEMOS%%share/pixmaps/shooter.png
+%%DEMOS%%share/pixmaps/skater.png
 @dirrm lib/allegro/%%SHLIB_VER%%
 @dirrm lib/allegro
 @dirrm include/allegrogl/GLext
===> Done