diff options
author | Côme Bernigaud | 2015-06-08 20:47:56 +0200 |
---|---|---|
committer | Côme Bernigaud | 2015-06-08 20:47:56 +0200 |
commit | 1932965fb43a21ca2e48712f8437a3870de0fc48 (patch) | |
tree | fc1975cf75e42afd5b747bc3ca9f36a677c3f4b5 | |
download | aur-1932965fb43a21ca2e48712f8437a3870de0fc48.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | FindSFML.cmake | 211 | ||||
-rw-r--r-- | PKGBUILD | 40 |
3 files changed, 272 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..26989e8d8693 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = geneticinvasion + pkgdesc = A Tower Defence game that uses evolutionary algorithm + pkgver = 0.5.2 + pkgrel = 1 + url = http://projects.haxx.es/p/genetic-invasion + arch = i686 + arch = x86_64 + license = GPL + makedepends = make + makedepends = cmake + depends = libeo + depends = mesa + source = http://projects.haxx.es/media/upload/genetic-invasion/files/genetic-invasion-v0.5.2.zip + source = http://downloads.sourceforge.net/sfml/SFML-1.6-sdk-linux-64.tar.gz + source = FindSFML.cmake + md5sums = a9b3b6e128170afb167a45616d6ea022 + md5sums = 7a9b3a1ef6d14cd25090e440ccdbb3a8 + md5sums = f6358382450150804d773a1d0b0777db + +pkgname = geneticinvasion + diff --git a/FindSFML.cmake b/FindSFML.cmake new file mode 100644 index 000000000000..e8ce5a022dd0 --- /dev/null +++ b/FindSFML.cmake @@ -0,0 +1,211 @@ +# Locate SFML library +# This module defines +# SFML_FOUND, if false, do not try to link to SFML +# SFML_LIBRARY, the name of the librarys to link against +# SFML_INCLUDE_DIR, where to find SFML headers +# +# By default this script will link to the shared-nondebug version of SFML +# You can change this by define this variables befor calling FIND_PACKAGE +# +# SFML_DEBUG - If defined it will link to the debug version of SFML +# SFML_STATIC - If defined it will link to the static version of SFML +# +# For example: +# SET(SFML_STATIC true) +# FIND_PACKAGE(SFML REQUIRED COMPONENTS System Window) +# +# Created by Nils Hasenbanck. Based on the FindSDL_*.cmake modules, +# created by Eric Wing, which were influenced by the FindSDL.cmake +# module, but with modifications to recognize OS X frameworks and +# additional Unix paths (FreeBSD, etc). +# +# Changelog: +# 2010-04-04 - Add support for visual studio 2008 (9.0) +# 2010-04-09 - Add support for visual studio 2005 (8.0) +# - Now the test for the requested components is also implemented. +# - It also will only link to the requested components +# - You can chose wich debug/nondebug static/shared versions of the librarys you want to link to + +SET(SFML_LIBRARY "") +SET(SFML_INCLUDE_DIR "") + +SET( SFMLDIR $ENV{SFMLDIR} ) +IF(WIN32 AND NOT(CYGWIN)) + # Convert backslashes to slashes + STRING(REGEX REPLACE "\\\\" "/" SFMLDIR "${SFMLDIR}") +ENDIF(WIN32 AND NOT(CYGWIN)) + +SET(SFML_COMPONENTS + System + Audio + Graphics + Network + Window +) + +SET(SFML_MODE + _SHARED_NONDEBUG + _SHARED_DEBUG + _STATIC_NONDEBUG + _STATIC_DEBUG +) + +SET(SFML_INCLUDE_SEARCH_DIR + ${SFMLDIR} + ${SFMLDIR}/include + ${SFMLDIR}/include/SFML + ~/Library/Frameworks + /Library/Frameworks + /usr/local/include/SFML + /usr/include/SFML + /usr/local/include + /usr/include + /sw/include/SFML # Fink + /sw/include + /opt/local/include/SFML # DarwinPorts + /opt/local/include + /opt/csw/include/SFML # Blastwave + /opt/csw/include + /opt/include/SFML + /opt/include +) + +SET(SFML_LIBRARY_SEARCH_DIR + ${SFMLDIR} + ${SFMLDIR}/lib + ${SFMLDIR}/lib/vc2008 + ${SFMLDIR}/lib/vc2005 + ~/Library/Frameworks + /Library/Frameworks + /usr/local + /usr + /sw + /opt/local + /opt/csw + /opt +) + +#looking for the include files +FOREACH(COMPONENT ${SFML_COMPONENTS}) + STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) + STRING(TOLOWER ${COMPONENT} LOWERCOMPONENT) + + FIND_PATH(SFML_${UPPERCOMPONENT}_INCLUDE_DIR + ${COMPONENT}.hpp + PATH_SUFFIXES include SFML + PATHS ${SFML_INCLUDE_SEARCH_DIR} + NO_DEFAULT_PATH + ) + + IF(SFML_${UPPERCOMPONENT}_INCLUDE_DIR) + IF(WIN32) + # In wxWIN we need the root include directory without the "/SFML" at the end... so we have to remove it. + # This is a oversized "remove 5 chars at the right end of the string" function: + string(LENGTH ${SFML_${UPPERCOMPONENT}_INCLUDE_DIR} STRING_SIZE) + math(EXPR STRING_SIZE ${STRING_SIZE}-5) + string(SUBSTRING "${SFML_${UPPERCOMPONENT}_INCLUDE_DIR}" 0 ${STRING_SIZE} SFML_${UPPERCOMPONENT}_INCLUDE_DIR) + ENDIF(WIN32) + + LIST(APPEND SFML_INCLUDE_DIR ${SFML_${UPPERCOMPONENT}_INCLUDE_DIR}) + LIST(REMOVE_DUPLICATES SFML_INCLUDE_DIR) + ENDIF(SFML_${UPPERCOMPONENT}_INCLUDE_DIR) +ENDFOREACH(COMPONENT) + +#looking for the librarys +FOREACH(MODE ${SFML_MODE}) + string(COMPARE EQUAL ${MODE} "_SHARED_NONDEBUG" string_equal_result) + IF(string_equal_result) + SET(_STA "") + SET(_DBG "") + ENDIF(string_equal_result) + + string(COMPARE EQUAL ${MODE} "_SHARED_DEBUG" string_equal_result) + IF(string_equal_result) + SET(_STA "") + SET(_DBG "-d") + ENDIF(string_equal_result) + + string(COMPARE EQUAL ${MODE} "_STATIC_NONDEBUG" string_equal_result) + IF(string_equal_result) + SET(_STA "-s") + SET(_DBG "") + ENDIF(string_equal_result) + + string(COMPARE EQUAL ${MODE} "_STATIC_DEBUG" string_equal_result) + IF(string_equal_result) + SET(_STA "-s") + SET(_DBG "-d") + ENDIF(string_equal_result) + + FOREACH(COMPONENT ${SFML_COMPONENTS}) + STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) + STRING(TOLOWER ${COMPONENT} LOWERCOMPONENT) + FIND_LIBRARY(SFML_${UPPERCOMPONENT}_LIBRARY${MODE} + NAMES sfml-${LOWERCOMPONENT}${_STA}${_DBG} + PATH_SUFFIXES lib64 lib + PATHS ${SFML_LIBRARY_SEARCH_DIR} + ) + ENDFOREACH(COMPONENT) + + IF(WIN32) + #Now we are looking for "sfml-main.lib". + #Because we need it if we give ADD_EXECUTABLE the WIN32 switch to creat a GUI application (that one without a cmd promt) + FIND_LIBRARY( SFML_MAIN_LIBRARY${MODE} + NAMES sfml-main${_DBG} + PATH_SUFFIXES lib64 lib + PATHS ${SFML_LIBRARY_SEARCH_DIR} + ) + ENDIF(WIN32) +ENDFOREACH(MODE) + + +#Test if we have the include directory, the system lib and other needed components +#We also fill SFML_LIBRARY here with all the files we like to link to + +IF(NOT(SFML_DEBUG) AND NOT(SFML_STATIC)) + SET(MODE_LABEL "_SHARED_NONDEBUG") +ENDIF(NOT(SFML_DEBUG) AND NOT(SFML_STATIC)) + +IF(SFML_DEBUG AND NOT(SFML_STATIC)) + SET(MODE_LABEL "_SHARED_DEBUG") +ENDIF(SFML_DEBUG AND NOT(SFML_STATIC)) + +IF(NOT(SFML_DEBUG) AND SFML_STATIC) + SET(MODE_LABEL "_STATIC_NONDEBUG") +ENDIF(NOT(SFML_DEBUG) AND SFML_STATIC) + +IF(SFML_DEBUG AND SFML_STATIC) + SET(MODE_LABEL "_STATIC_DEBUG") +ENDIF(SFML_DEBUG AND SFML_STATIC) + +LIST(APPEND SFML_LIBRARY ${SFML_MAIN_LIBRARY${MODE_LABEL}}) + +LIST(APPEND SFML_FIND_COMPONENTS "System") #We allways need at last the System component +LIST(REMOVE_DUPLICATES SFML_FIND_COMPONENTS) + +SET(SFML_FOUND "YES") +FOREACH(COMPONENT ${SFML_FIND_COMPONENTS}) + SET( MODUL_NAME SFML_${COMPONENT}_LIBRARY${MODE_LABEL} ) + STRING(TOUPPER ${MODUL_NAME} MODUL_NAME) + + IF(NOT ${MODUL_NAME}) + SET(SFML_FOUND "NO") + MESSAGE("-- SFML: Could not locate : ${MODUL_NAME}") + ELSE(NOT ${MODUL_NAME}) + LIST(APPEND SFML_LIBRARY ${${MODUL_NAME}}) + ENDIF(NOT ${MODUL_NAME}) +ENDFOREACH(COMPONENT) + +LIST(REMOVE_DUPLICATES SFML_LIBRARY) + +IF(NOT SFML_INCLUDE_DIR) + SET(SFML_FOUND "NO") + MESSAGE("-- SFML: Could not locate include directory") +ENDIF(NOT SFML_INCLUDE_DIR) + +IF(NOT SFML_FOUND) + MESSAGE(FATAL_ERROR "Components of SFML are missing!") +ENDIF(NOT SFML_FOUND) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SFML DEFAULT_MSG SFML_LIBRARY SFML_INCLUDE_DIR) diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..4a400e6d91b3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,40 @@ +# Contributor: MCMic <come.bernigaud@laposte.net> + +pkgname=geneticinvasion +pkgver=0.5.2 +pkgrel=1 +pkgdesc="A Tower Defence game that uses evolutionary algorithm" +arch=('i686' 'x86_64') +url="http://projects.haxx.es/p/genetic-invasion" +license=('GPL') +depends=('libeo' 'mesa') +makedepends=('make' 'cmake') +conflicts=() +if test "$CARCH" == 'i686'; then + sfml_arch=32 +else + sfml_arch=64 +fi +source=("http://projects.haxx.es/media/upload/genetic-invasion/files/genetic-invasion-v$pkgver.zip" "http://downloads.sourceforge.net/sfml/SFML-1.6-sdk-linux-$sfml_arch.tar.gz" 'FindSFML.cmake') +if test "$sfml_arch" == "32"; then + md5sums=('a9b3b6e128170afb167a45616d6ea022' + 'acc678933c19558587aad8332ea6f459' + 'f6358382450150804d773a1d0b0777db') +else + md5sums=('a9b3b6e128170afb167a45616d6ea022' + '7a9b3a1ef6d14cd25090e440ccdbb3a8' + 'f6358382450150804d773a1d0b0777db') +fi + +build() { + cd $srcdir/SFML-1.6/ + sed -i "24i#define NULL 0" include/SFML/System/ResourcePtr.inl + make STATIC=yes + sed -i "24d" include/SFML/System/ResourcePtr.inl + + cd $srcdir/genetic-invasion-v$pkgver + cp $srcdir/FindSFML.cmake $srcdir/genetic-invasion-v$pkgver/cmake/modules + cmake -DCMAKE_BUILD_TYPE=Release -DSFML_STATIC=true -DSFMLDIR=../SFML-1.6 -DCMAKE_INSTALL_PREFIX=/usr . + make + make install DESTDIR=$pkgdir +} |