Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jan 2014 21:20:56 GMT
From:      Max Brazhnikov <makc@FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/185616: games/opensonic: clean up, support stage
Message-ID:  <201401092120.s09LKupv010959@oldred.freebsd.org>
Resent-Message-ID: <201401092130.s09LU036035834@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         185616
>Category:       ports
>Synopsis:       games/opensonic: clean up, support stage
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 09 21:30:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Max Brazhnikov
>Release:        FreeBSD 9.2-STABLE amd64
>Organization:
>Environment:
>Description:
- Install icon and fix desktop entry
- Remove useless dependencies
- Bring stage support
- Fix misused PREFIX/LOCALBASE
- Don't install old wrapper script, patch sources to not copy binary,
  and create a link for binary instead.
- Remove no longer useful patch
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: Makefile
===================================================================
--- Makefile	(revision 339260)
+++ Makefile	(working copy)
@@ -3,6 +3,7 @@
 
 PORTNAME=	opensonic
 PORTVERSION=	0.1.4
+PORTREVISION=	1
 CATEGORIES=	games
 MASTER_SITES=	SF/opensnc/Open%20Sonic/${PORTVERSION}
 DISTNAME=	opensnc-src-${PORTVERSION}
@@ -10,38 +11,31 @@
 MAINTAINER=	devel@stasyan.com
 COMMENT=	Game based on the "Sonic the Hedgehog" universe
 
+BUILD_DEPENDS=	alpng>=1.3:${PORTSDIR}/graphics/alpng
+LIB_DEPENDS=	liballeg.so:${PORTSDIR}/devel/allegro \
+		libogg.so:${PORTSDIR}/audio/libogg \
+		libvorbis.so:${PORTSDIR}/audio/libvorbis
+
 DESKTOP_ENTRIES="${PORTNAME}" \
 		"Sonic the Hedgehog" \
-		"${DATADIR}/images/icon.png" \
-		"${PORTNAME}_launcher" \
-		"Game;KidsGame;" \
+		"${PREFIX}/share/pixmaps/opensonic.png" \
+		"${PORTNAME}" \
+		"Game;ArcadeGame;" \
 		"false"
 
 USES=		cmake
-CMAKE_ENV+=	_ALLEGRO_LIBS="`allegro-config --libs`" _ALLEGRO_VERSION="`allegro-config --version`"
+CMAKE_ENV+=	_ALLEGRO_LIBS="`allegro-config --libs`" \
+		_ALLEGRO_VERSION="`allegro-config --version`"
 
 CFLAGS+=	-I${LOCALBASE}/include
 
-BUILD_DEPENDS+=	${LOCALBASE}/lib/libaldmb.a:${PORTSDIR}/audio/dumb-allegro \
-		alpng>=1.3:${PORTSDIR}/graphics/alpng
-RUN_DEPENDS+=	${LOCALBASE}/lib/libaldmb.a:${PORTSDIR}/audio/dumb-allegro \
-		alpng>=1.3:${PORTSDIR}/graphics/alpng
-LIB_DEPENDS+=	liballeg.so:${PORTSDIR}/devel/allegro \
-		libogg.so:${PORTSDIR}/audio/libogg \
-		libvorbis.so:${PORTSDIR}/audio/libvorbis
-
-NO_STAGE=	yes
-.include <bsd.port.pre.mk>
-
 post-patch:
-	@${REINPLACE_CMD} -e 's,/usr/bin,${LOCALBASE}/bin,g' \
-		${PATCH_WRKSRC}/CMakeLists.txt ${PATCH_WRKSRC}/src/core/global.h
-	@${REINPLACE_CMD} -e 's,/usr/share,${LOCALBASE}/share,g' \
+	@${REINPLACE_CMD} -e 's,/usr/bin,${PREFIX}/bin,g' \
+		-e 's,/usr/share,${PREFIX}/share,g' \
 		${PATCH_WRKSRC}/src/core/global.h
-	@${REINPLACE_CMD} -e 's,%%GAME_DIR%%,${DATADIR},g' -e 's,opensonic_bin,opensonic,g' -e 's,/bin/bash,/bin/sh,g' \
-		${PATCH_WRKSRC}/src/misc/opensonic
 
 post-install:
-	@${INSTALL_SCRIPT} ${PATCH_WRKSRC}/src/misc/opensonic ${LOCALBASE}/bin/opensonic
+	${INSTALL_DATA}	${WRKSRC}/icon.png ${STAGEDIR}${PREFIX}/share/pixmaps/opensonic.png
+	${LN} -s ${DATADIR}/opensonic ${STAGEDIR}${PREFIX}/bin/opensonic
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Index: files/patch-CMakeLists.txt
===================================================================
--- files/patch-CMakeLists.txt	(revision 339260)
+++ files/patch-CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
---- CMakeLists.txt.orig	2010-12-15 10:31:17.000000000 +0600
-+++ CMakeLists.txt	2010-12-15 10:32:02.000000000 +0600
-@@ -410,8 +410,8 @@
+--- ./CMakeLists.txt.orig	2010-09-19 18:31:26.000000000 +0000
++++ ./CMakeLists.txt	2014-01-09 19:17:45.443017601 +0000
+@@ -410,16 +410,11 @@
  
  # Installing on *nix
  IF(UNIX)
@@ -7,7 +7,15 @@
 -  SET(GAME_INSTALL_DIR "/usr/share/${GAME_UNIXNAME}")
 -  SET(GAME_FINAL_DIR "/usr/bin")
 +  SET(GAME_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/${GAME_UNIXNAME}")
-+  SET(GAME_FINAL_DIR "{CMAKE_INSTALL_PREFIX}/bin")
++  SET(GAME_FINAL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
  
    INSTALL(CODE "MESSAGE(\"Installing ${GAME_NAME} ${GAME_VERSION}... Make sure you have root privileges.\")")
    INSTALL(TARGETS ${GAME_UNIXNAME} RUNTIME DESTINATION ${GAME_INSTALL_DIR})
+   INSTALL(FILES license.txt readme.html DESTINATION ${GAME_INSTALL_DIR})
+   INSTALL(DIRECTORY objects sprites config images levels licenses musics quests samples screenshots themes languages DESTINATION ${GAME_INSTALL_DIR} PATTERN ".svn" EXCLUDE)
+-
+-  INSTALL(CODE "MESSAGE(\"Creating files at ${GAME_FINAL_DIR}...\")")
+-  INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"cmake\" \"-E\" \"copy\" \"${GAME_INSTALL_DIR}/${GAME_UNIXNAME}\" \"${GAME_FINAL_DIR}/${GAME_UNIXNAME}\")")
+-
+-  INSTALL(CODE "MESSAGE(\"Done! Please run ${GAME_UNIXNAME} to start ${GAME_NAME}.\")")
+ ENDIF(UNIX)
Index: files/patch-src__misc__opensonic
===================================================================
--- files/patch-src__misc__opensonic	(revision 339260)
+++ files/patch-src__misc__opensonic	(working copy)
@@ -1,14 +0,0 @@
---- src/misc/opensonic.orig	2009-06-01 02:34:38.000000000 +1100
-+++ src/misc/opensonic	2010-02-02 20:03:04.352042228 +1000
-@@ -1,9 +1,9 @@
--#!/bin/bash
-+#!/bin/sh
- # Game
- 
- GAME_BIN="opensonic_bin"
- PWD_DIR=`pwd`
--GAME_DIR=`echo $0 | sed 's,^\(.*\)/\(.*\)$,\1,g'`
-+GAME_DIR=%%GAME_DIR%%
- GAME_PATH="${GAME_DIR}/${GAME_BIN}"
- 
- # Set LD_LIBRARY_PATH
Index: pkg-plist
===================================================================
--- pkg-plist	(revision 339260)
+++ pkg-plist	(working copy)
@@ -209,6 +209,7 @@
 %%DATADIR%%/themes/template.brk
 %%DATADIR%%/themes/template.grp
 %%DATADIR%%/themes/tutorial.bg
+share/pixmaps/opensonic.png
 @dirrm %%DATADIR%%/themes
 @dirrm %%DATADIR%%/sprites
 @dirrm %%DATADIR%%/screenshots


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401092120.s09LKupv010959>