summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Teibes2014-03-31 15:30:52 +0200
committerCarsten Teibes2014-03-31 15:30:52 +0200
commit4f6850d982e09d78793e115dcb51be79e2b0b5d0 (patch)
tree1554933cb25bd4883e7aa493fd036a64532c5f19
downloadaur-4f6850d982e09d78793e115dcb51be79e2b0b5d0.tar.gz
[add] mars-shooter-git
-rw-r--r--.SRCINFO29
-rw-r--r--PKGBUILD60
-rw-r--r--mars-archinstall.patch55
-rw-r--r--mars-fribidi.patch58
-rw-r--r--mars-shader.patch17
-rw-r--r--mars.install12
6 files changed, 231 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..888ce1eed28
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+pkgbase = mars-shooter-git
+ pkgdesc = A ridiculous space shooter with nice graphics (development version)
+ pkgver = 0.7.4.r4.d88244b
+ pkgrel = 1
+ url = http://mars-game.sourceforge.net/
+ install = mars.install
+ arch = i686
+ arch = x86_64
+ license = custom
+ license = GPL
+ makedepends = cmake
+ makedepends = git
+ depends = sfml
+ depends = taglib
+ depends = fribidi
+ depends = hicolor-icon-theme
+ provides = mars-shooter
+ conflicts = mars-shooter
+ source = mars-shooter::git+https://github.com/thelaui/M.A.R.S..git
+ source = mars-fribidi.patch
+ source = mars-shader.patch
+ source = mars-archinstall.patch
+ sha256sums = SKIP
+ sha256sums = 6fb105bd6c7f0b3c35bedc13240e1b1f9ad37bb5b4b1328438532b4f40e19c6e
+ sha256sums = 3f9b15350fb9a3acf05469e6bb2a83ff7fc7113499098d11dc759c343c459afa
+ sha256sums = d33d6cd40bf6b2846c069524ed3344e2f4c3afe373e89c74d3e4888d63e2261a
+
+pkgname = mars-shooter-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..1361f1cd8b3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,60 @@
+# Maintainer: carstene1ns <url/mail: arch carsten-teibes de>
+# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
+
+pkgname=mars-shooter-git
+pkgver=0.7.4.r4.d88244b
+pkgrel=1
+pkgdesc="A ridiculous space shooter with nice graphics (development version)"
+arch=('i686' 'x86_64')
+url="http://mars-game.sourceforge.net/"
+license=('custom' 'GPL')
+install=mars.install
+depends=('sfml' 'taglib' 'fribidi' 'hicolor-icon-theme')
+makedepends=('cmake' 'git')
+provides=('mars-shooter')
+conflicts=('mars-shooter')
+source=(mars-shooter::"git+https://github.com/thelaui/M.A.R.S..git"
+ mars-fribidi.patch
+ mars-shader.patch
+ mars-archinstall.patch)
+sha256sums=('SKIP'
+ '6fb105bd6c7f0b3c35bedc13240e1b1f9ad37bb5b4b1328438532b4f40e19c6e'
+ '3f9b15350fb9a3acf05469e6bb2a83ff7fc7113499098d11dc759c343c459afa'
+ 'd33d6cd40bf6b2846c069524ed3344e2f4c3afe373e89c74d3e4888d63e2261a')
+
+pkgver() {
+ cd mars-shooter
+ # todo: remove hardcoded version number (when proper tags are in repo)
+ printf "0.7.4.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ # reset build dir
+ rm -rf build
+ mkdir build
+
+ cd mars-shooter
+ # add include dir of fribidi
+ patch -Np1 < ../mars-fribidi.patch
+ # fix use of sfml2 shader
+ patch -Np0 < ../mars-shader.patch
+ # fix install target
+ patch -Np0 < ../mars-archinstall.patch
+ # fix executable name in and remove mimetype from launcher, todo: use setconf
+ sed 's/Exec=mars$/&-shooter/;/MimeType=.*/d' -i resources/mars.desktop
+}
+
+build() {
+ cd build
+
+ cmake ../mars-shooter -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package() {
+ cd build
+ make DESTDIR="$pkgdir" install
+
+ # rename executable
+ mv "$pkgdir"/usr/bin/mars "$pkgdir"/usr/bin/mars-shooter
+}
diff --git a/mars-archinstall.patch b/mars-archinstall.patch
new file mode 100644
index 00000000000..4a3e2a36319
--- /dev/null
+++ b/mars-archinstall.patch
@@ -0,0 +1,55 @@
+--- src/CMakeLists.old 2014-03-31 14:45:54.585329000 +0200
++++ src/CMakeLists.txt 2014-03-31 15:04:47.691007930 +0200
+@@ -68,21 +68,27 @@ if(UNIX)
+ TARGETS
+ mars
+ RUNTIME DESTINATION
+- ${CMAKE_INSTALL_PREFIX}/games
++ ${CMAKE_INSTALL_PREFIX}/bin
+ )
+ install(
+ FILES
+ ${MARS_SOURCE_DIR}/credits.txt
++ ${MARS_SOURCE_DIR}/README.md
++ DESTINATION
++ ${CMAKE_INSTALL_PREFIX}/share/doc/mars-shooter
++ )
++ install(
++ FILES
+ ${MARS_SOURCE_DIR}/license.txt
+ DESTINATION
+- ${CMAKE_INSTALL_PREFIX}/share/doc/marsshooter
++ ${CMAKE_INSTALL_PREFIX}/share/licenses/mars-shooter-git
+ )
+ install(
+ FILES
+ ${MARS_SOURCE_DIR}/data/botnames.txt
+ ${MARS_SOURCE_DIR}/data/shipnames.txt
+ DESTINATION
+- ${CMAKE_INSTALL_PREFIX}/share/games/marsshooter
++ ${CMAKE_INSTALL_PREFIX}/share/marsshooter
+ )
+ install(
+ DIRECTORY
+@@ -92,7 +98,7 @@ if(UNIX)
+ ${CMAKE_SOURCE_DIR}/data/shaders
+ ${CMAKE_SOURCE_DIR}/data/tex
+ DESTINATION
+- ${CMAKE_INSTALL_PREFIX}/share/games/marsshooter
++ ${CMAKE_INSTALL_PREFIX}/share/marsshooter
+ PATTERN
+ ".svn" EXCLUDE
+ )
+@@ -122,12 +128,6 @@ if(UNIX)
+ DESTINATION
+ ${CMAKE_INSTALL_PREFIX}/share/applications
+ )
+- install(
+- FILES
+- ${MARS_SOURCE_DIR}/resources/mars
+- DESTINATION
+- ${CMAKE_INSTALL_PREFIX}/share/menu
+- )
+
+ else(UNIX)
+ # executable
diff --git a/mars-fribidi.patch b/mars-fribidi.patch
new file mode 100644
index 00000000000..c1d12566685
--- /dev/null
+++ b/mars-fribidi.patch
@@ -0,0 +1,58 @@
+diff -rupN old/cmake/modules/FindFribidi.cmake new/cmake/modules/FindFribidi.cmake
+--- old/cmake/modules/FindFribidi.cmake 1970-01-01 01:00:00.000000000 +0100
++++ new/cmake/modules/FindFribidi.cmake 2014-03-31 15:18:22.411022000 +0200
+@@ -0,0 +1,42 @@
++# - Find Fribidi
++# Find the Fribidi includes and libraries
++#
++# Following variables are provided:
++# FRIBIDI_FOUND
++# True if Fribidi has been found
++# FRIBIDI_INCLUDE_DIRS
++# The include directories of Fribidi
++# FRIBIDI_LIBRARIES
++# Fribidi library list
++
++if(APPLE)
++ set(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h PATHS /Library/Frameworks/fribidi.framework/Headers)
++ find_library(FRIBIDI_LIBRARY NAMES fribidi PATHS /Library/Frameworks/fribidi.framework)
++ set(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
++ include_directories(/Library/Frameworks/fribidi.framework/Headers)
++ #add_definitions(-framework fribidi)
++ set(FRIBIDI_FOUND 1)
++elseif(UNIX)
++ include(FindPkgConfig)
++ pkg_check_modules(FRIBIDI fribidi)
++else()
++ set(FRIBIDI_FOUND 0)
++endif()
++
++if(NOT FRIBIDI_FOUND)
++ find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h PATHS /Library/Frameworks/fribidi.framework/Headers "${PROJECT_SOURCE_DIR}/dependencies/include")
++ find_library(FRIBIDI_LIBRARY NAMES fribidi PATHS /Library/Frameworks/fribidi.framework "${PROJECT_SOURCE_DIR}/dependencies/lib")
++
++ include(FindPackageHandleStandardArgs)
++ find_package_handle_standard_args(Fribidi DEFAULT_MSG FRIBIDI_INCLUDE_DIR FRIBIDI_LIBRARY)
++
++ if(APPLE)
++ set(FRIBIDI_INCLUDE_DIR "/Library/Frameworks/fribidi.framework/Headers")
++ endif()
++
++ # Publish variables
++ set(FRIBIDI_INCLUDE_DIRS ${FRIBIDI_INCLUDE_DIR})
++ set(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
++endif()
++
++mark_as_advanced(FRIBIDI_INCLUDE_DIR FRIBIDI_LIBRARY)
+diff -rupN old/CMakeLists.txt new/CMakeLists.txt
+--- old/CMakeLists.txt 2014-03-31 15:18:21.474345000 +0200
++++ new/CMakeLists.txt 2014-03-31 15:18:22.411022000 +0200
+@@ -47,6 +47,8 @@ endif(APPLE)
+
+ # Fribidi library needed for bi-directional texts
+ find_library(FRIBIDI_LIBRARY fribidi)
++ find_package( Fribidi )
++ include_directories(${FRIBIDI_INCLUDE_DIRS})
+
+ # set the executable output path
+ if(APPLE)
diff --git a/mars-shader.patch b/mars-shader.patch
new file mode 100644
index 00000000000..de140b8ef1a
--- /dev/null
+++ b/mars-shader.patch
@@ -0,0 +1,17 @@
+--- src/System/window.cpp.orig 2014-03-31 15:18:22.264354000 +0200
++++ src/System/window.cpp 2014-03-31 15:18:22.407689000 +0200
+@@ -308,13 +308,10 @@ namespace window {
+ glEnable(GL_TEXTURE_2D);
+
+ if (shader)
+- shader->bind();
++ shader->bind(NULL);
+
+ window_.draw(toBeDrawn, states);
+
+- if (shader)
+- shader->unbind();
+-
+ window_.popGLStates();
+ glPopMatrix();
+ glPopAttrib();
diff --git a/mars.install b/mars.install
new file mode 100644
index 00000000000..7dd16bb635c
--- /dev/null
+++ b/mars.install
@@ -0,0 +1,12 @@
+
+post_install() {
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+}
+
+post_update() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}