Changeset - 657c13b399fe
[Not reviewed]
default
0 3 1
Nathan Brink (binki) - 16 years ago 2009-05-02 10:11:43
ohnobinki@ohnopublishing.net
games-arcade/supertux: Fixed installation paths.
4 files changed with 135 insertions and 5 deletions:
0 comments (0 inline, 0 general)
games-arcade/supertux/ChangeLog
Show inline comments
 
# ChangeLog for games-arcade/supertux
 
# Copyright 2000-2009 Gentoo Foundation; Distributed under the GPL v2
 
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
 
# $Header: /var/cvsroot/gentoo-x86/games-arcade/supertux/ChangeLog,v 1.33 2009/02/23 01:02:56 mr_bones_ Exp $
 

	
 
  02 May 2009; Nathan Phillip Brink <ohnobinki@ohnopublishing.net>
 
  supertux-9999.ebuild, +files/supertux-cmake.patch:
 
  Fixed installation paths.
 

	
 

	
 
  21 Apr 2009; Nathan Phillip Brink <ohnobinki@ohnopublishing.net>
 
  supertux-9999.ebuild:
 
  set SLOT=1 because this can coexist with supertux-0.1*
 

	
 
*supertux-9999 (20 Apr 2009)
 

	
 
  20 Apr 2009; Nathan Phillip Brink <ohnobinki@ohnopublishing.net>
 
  -supertux-0.1.3.ebuild, -files/supertux-0.1.3-gcc41.patch, -files/supertux-0.1.3-ndebug.patch, +supertux-9999.ebuild:
 
  Created a live ebuild for Supertux from the existing one
 

	
 
  23 Feb 2009; Michael Sterrett <mr_bones_@gentoo.org>
 
  supertux-0.1.3.ebuild:
games-arcade/supertux/Manifest
Show inline comments
 
EBUILD supertux-9999.ebuild 1199 RMD160 16a551bea77e7ee7f5b035102e57b01792baa212 SHA1 53f889372353908bec574896a0823220046a04f7 SHA256 9408a371c0f013125497d28e9f292483712a7bc8aa879f84592014ba9b9b750d
 
MISC ChangeLog 4658 RMD160 600c83c76805f1b7b9f11e597908f2c7a434fd02 SHA1 36235c52f21761927af54ea07070dc0f5e4d5252 SHA256 9032bc8025e1ed75abbb93b018907018b645366d2c404c3bc4f44c876f82c90e
 
AUX supertux-cmake.patch 4936 RMD160 26caecb7f478fda7bfdc35db5a068f75a81059cd SHA1 c9f9aa2dde304a1d7a55da8b4251d79094f92046 SHA256 ac37a9b997370a71689f5b06e46995fef506b7bc57c26e7607487a7ac4314992
 
EBUILD supertux-9999.ebuild 1393 RMD160 2d6e164b8893b3d9bec09e1cad36dea6babdb470 SHA1 2becb126d0ca9b52e0177b51ead48a414efa3b7d SHA256 2a1c6cdb2301cfc626d1aeea054bfd091ee22efa9ac6f609892d74abe3f40ebc
 
MISC ChangeLog 4808 RMD160 71a3ca002d464d40eb5387def2c042d9dfc908c8 SHA1 a6be5d41d51884fe8b5b0519a9b22334e94e9ed3 SHA256 0eac7a67011bbeac8b20e9a8360e5c875167e9f6610896712510e2462e4185dc
 
MISC metadata.xml 158 RMD160 cbd9984bb6b426c8c9cee5022fe0a26261612fea SHA1 be5251fa1dacef5c41b74761bb1c8c54fb633b9e SHA256 1423a4fdd4a79b1728a2056d9e300f7e1074253095d82726218d9e9b953888a3
games-arcade/supertux/files/supertux-cmake.patch
Show inline comments
 
new file 100644
 
Index: mk/cmake/VariableOption.cmake
 
===================================================================
 
--- mk/cmake/VariableOption.cmake	(revision 0)
 
+++ mk/cmake/VariableOption.cmake	(revision 0)
 
@@ -0,0 +1,58 @@
 
+# Copyright Nathan Phillip Brink <ohnobinki@ohnopublishing.net>
 
+# 
 
+#  This file is part of SuperTux.
 
+#
 
+#  SuperTux is free software: you can redistribute it and/or modify
 
+#  it under the terms of the GNU General Public License as published by
 
+#  the Free Software Foundation, either version 3 of the License, or
 
+#  (at your option) any later version.
 
+#
 
+#  SuperTux is distributed in the hope that it will be useful,
 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
+#  GNU General Public License for more details.
 
+#
 
+#  You should have received a copy of the GNU General Public License
 
+#  along with SuperTux.  If not, see <http://www.gnu.org/licenses/>.
 
+#
 
+#  - - -
 
+#
 
+#  SETIFNOTDEFINED will set the variable named by VARNAME to VALUE unless
 
+#  if it's already defined. If it is not set, it is set it to 
 
+#  VALUE
 
+#  When setting (or re-setting) the variable, the macro will insert it into
 
+#  the cmake cache with a docstring of ${VARNAME}_DOCSTRING and a variable type 
 
+#  of TYPE (e.g., PATH).
 
+#
 
+#  Usage example:
 
+#  SET(MYVAR_DOCSTRING "this variable exists")
 
+#
 
+#  IF(A)
 
+#    SETIFNOTDEFINED(MYVAR "default value" STRING)
 
+#  ELSE(A)
 
+#    SETIFNOTDEFINED(MYVAR "default value for when A is false" STRING)
 
+#  ENDIF(A)
 
+#
 
+#  Necessity:
 
+#
 
+#    Even though the command-line -D option for cmake overrides CMakeLists.txt's 
 
+#  attempt to set values in the cache, the SET() command will set variables locally
 
+#  while the script is executing. Thus, to recognize a user's option, the script must
 
+#  check if the variable is defined or not first. 
 
+#
 
+#    Because there are three variables pertaining to file installation and three 
 
+#  different defaults for different platforms, placing an IF() statement around each SET
 
+#  statement is impractical
 
+
 
+MACRO(SETIFNOTDEFINED VARNAME VALUE TYPE)
 
+  IF(NOT DEFINED ${VARNAME})
 
+    #set the default value and store in cache
 
+    SET(${VARNAME} ${VALUE} CACHE ${TYPE} ${${VARNAME}_DOCSTRING})
 
+    #I cannot use the PARENT_SCOPE and CACHE option at the same time...
 
+    SET(${VARNAME} ${VALUE} PARENT_SCOPE)
 
+  ELSE(NOT DEFINED ${VARNAME})
 
+    # set the variable into the cache; we use force because we want to add the 
 
+    # docstring even if the user specifies the variable
 
+    SET(${VARNAME} ${${VARNAME}} CACHE ${TYPE} ${${VARNAME}_DOCSTRING} FORCE)
 
+  ENDIF(NOT DEFINED ${VARNAME})
 
+ENDMACRO(SETIFNOTDEFINED)
 
\ No newline at end of file
 
Index: CMakeLists.txt
 
===================================================================
 
--- CMakeLists.txt	(revision 5883)
 
+++ CMakeLists.txt	(working copy)
 
@@ -349,11 +349,17 @@
 
 
 
 ## Install stuff
 
 
 
+SET(INSTALL_SUBDIR_BIN_DOCSTRING "Directory to install binary files to")
 
+SET(INSTALL_SUBDIR_SHARE_DOCSTRING "Directory to install data files to")
 
+SET(INSTALL_SUBDIR_DOC_DOCSTRING "Directory to install doc files to")
 
+
 
+INCLUDE(VariableOption)
 
+
 
 IF(WIN32 AND NOT UNIX)
 
 
 
-  SET(INSTALL_SUBDIR_BIN ".")
 
-  SET(INSTALL_SUBDIR_SHARE "data/")
 
-  SET(INSTALL_SUBDIR_DOC ".")
 
+  SETIFNOTDEFINED(INSTALL_SUBDIR_BIN "." STRING)
 
+  SETIFNOTDEFINED(INSTALL_SUBDIR_SHARE "data/" STRING)
 
+  SETIFNOTDEFINED(INSTALL_SUBDIR_DOC "." STRING)
 
 
 
   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/SDL.dll DESTINATION ${INSTALL_SUBDIR_BIN})
 
   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/SDL_image.dll DESTINATION ${INSTALL_SUBDIR_BIN})
 
@@ -369,19 +375,19 @@
 
 ELSE(WIN32 AND NOT UNIX)
 
 IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 
 
 
-  SET(INSTALL_SUBDIR_BIN "SuperTux.app/Contents/MacOS/")
 
-  SET(INSTALL_SUBDIR_SHARE "SuperTux.app/Contents/Resources/data/")
 
-  SET(INSTALL_SUBDIR_DOC "SuperTux.app/Contents/Resources/")
 
-
 
+  SETIFNOTDEFINED(INSTALL_SUBDIR_BIN "SuperTux.app/Contents/MacOS/" STRING)
 
+  SETIFNOTDEFINED(INSTALL_SUBDIR_SHARE "SuperTux.app/Contents/Resources/data/" STRING)
 
+  SETIFNOTDEFINED(INSTALL_SUBDIR_DOC "SuperTux.app/Contents/Resources/" STRING)
 
+  
 
   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/tools/darwin/info.plist DESTINATION "SuperTux.app/Contents/")
 
 
 
   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.icns DESTINATION "SuperTux.app/Contents/Resources/")
 
 
 
 ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 
 
 
-  SET(INSTALL_SUBDIR_BIN "games/")
 
-  SET(INSTALL_SUBDIR_SHARE "share/games/supertux2/")
 
-  SET(INSTALL_SUBDIR_DOC "share/doc/supertux2/")
 
+  SETIFNOTDEFINED(INSTALL_SUBDIR_BIN "games" STRING)
 
+  SETIFNOTDEFINED(INSTALL_SUBDIR_SHARE "share/games/supertux2" STRING)
 
+  SETIFNOTDEFINED(INSTALL_SUBDIR_DOC "share/doc/supertux2" STRING)
 
 
 
   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/supertux2.desktop DESTINATION "share/applications")
 
 
games-arcade/supertux/supertux-9999.ebuild
Show inline comments
 
@@ -16,35 +16,43 @@ LICENSE="GPL-2"
 
SLOT="1"
 
KEYWORDS=""
 
IUSE="opengl curl debug"
 

	
 
RDEPEND="media-libs/libsdl[joystick]
 
	media-libs/sdl-image[png,jpeg]
 
	media-libs/libvorbis
 
	dev-games/physfs
 
	media-libs/openal
 
	x11-libs/libXt
 
	opengl? ( virtual/opengl )
 
	curl? ( net-misc/curl )"
 

	
 
#supertux's CMakeLists.txt needs the svnversion command
 
DEPEND="${RDEPEND}
 
	dev-util/cmake
 
	dev-util/subversion"
 

	
 
src_unpack() {
 
	subversion_src_unpack
 
}
 

	
 
src_prepare() {
 
	epatch "${FILESDIR}/supertux-cmake.patch"
 
}
 

	
 
src_configure() {
 
	local mycmakeargs="$(cmake-utils_use_enable opengl OPENGL)
 
			 -DWERROR=OFF
 
	local mycmakeargs="-DWERROR=OFF
 
			 -DINSTALL_SUBDIR_BIN=games/bin
 
			 -DINSTALL_SUBDIR_DOC=share/doc/${P}
 
			 $(cmake-utils_use_enable opengl OPENGL)
 
			 $(cmake-utils_use_enable debug SQDBG)
 
			 $(cmake-utils_use debug DEBUG)"
 

	
 
	cmake-utils_src_configure
 
}
 

	
 
src_compile() {
 
	cmake-utils_src_compile
 
}
 

	
 
src_install() {
 
	cmake-utils_src_install
0 comments (0 inline, 0 general)