From 3f2255304f6d879a4239f860933195dfc15de2d7 Mon Sep 17 00:00:00 2001 From: Narrat Date: Wed, 13 May 2015 22:47:57 +0200 Subject: [PATCH] oort: Latest files History: https://github.com/Narrat/PKGBuilds --- .SRCINFO | 28 ++++++++++ .gitignore | 15 ++++++ ...uded-iostream-else-it-failed-of-cerr.patch | 24 +++++++++ 0003-Sim-AI-lua_resume-update.patch | 27 ++++++++++ 0004-Sim-Ship-Update-on-box2d-functions.patch | 30 +++++++++++ PKGBUILD | 53 +++++++++++++++++++ 6 files changed, 177 insertions(+) create mode 100644 .SRCINFO create mode 100644 .gitignore create mode 100644 0002-headless-Included-iostream-else-it-failed-of-cerr.patch create mode 100644 0003-Sim-AI-lua_resume-update.patch create mode 100644 0004-Sim-Ship-Update-on-box2d-functions.patch create mode 100644 PKGBUILD diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..983d8ae356b9 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = oort-git + pkgdesc = space fleet programming game + pkgver = r394.7aacb6d + pkgrel = 2 + url = https://github.com/rlane/Oort + arch = i686 + arch = x86_64 + license = GPL + makedepends = automake-1.11 + makedepends = boost + makedepends = sdl + depends = boost-libs + depends = box2d + depends = glib2 + depends = glew + depends = lua + optdepends = sdl: for oort_sdl + source = oort::git://github.com/rlane/Oort + source = 0002-headless-Included-iostream-else-it-failed-of-cerr.patch + source = 0003-Sim-AI-lua_resume-update.patch + source = 0004-Sim-Ship-Update-on-box2d-functions.patch + md5sums = SKIP + md5sums = 7eb888feddcf89eba7f22c1cf88928b6 + md5sums = e6e2a9aaecb1186dd4907a18880f860e + md5sums = 656f4d154950976b937f7c7e7209b0d9 + +pkgname = oort-git + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..cebb290fa797 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*/src +*/pkg +*.gz +*.xz +*.bz2 +*.zip +*.part +*.sig +*.sign +*.txt +*.log +*.scm +*/oort +*/*.pkg +*/*.asc diff --git a/0002-headless-Included-iostream-else-it-failed-of-cerr.patch b/0002-headless-Included-iostream-else-it-failed-of-cerr.patch new file mode 100644 index 000000000000..dce2bb21066c --- /dev/null +++ b/0002-headless-Included-iostream-else-it-failed-of-cerr.patch @@ -0,0 +1,24 @@ +From b1fba8352885a72c42627144fbe76041a08fa39d Mon Sep 17 00:00:00 2001 +From: Narrat +Date: Thu, 29 Jan 2015 12:09:22 +0100 +Subject: [PATCH 2/5] headless: Included iostream, else it failed of cerr + +--- + ui/headless/main.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/ui/headless/main.cc b/ui/headless/main.cc +index 12c9297..5885033 100644 +--- a/ui/headless/main.cc ++++ b/ui/headless/main.cc +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + + #include "glm/glm.hpp" + #include "glm/gtx/string_cast.hpp" +-- +2.2.2 + diff --git a/0003-Sim-AI-lua_resume-update.patch b/0003-Sim-AI-lua_resume-update.patch new file mode 100644 index 000000000000..821160005f1e --- /dev/null +++ b/0003-Sim-AI-lua_resume-update.patch @@ -0,0 +1,27 @@ +From 75a63fddd58d6586568846fd6c53be3615fb6429 Mon Sep 17 00:00:00 2001 +From: Narrat +Date: Thu, 29 Jan 2015 12:10:10 +0100 +Subject: [PATCH 3/5] Sim/AI: lua_resume update + +With lua5.2 this functions needs three arguments. +http://www.lua.org/manual/5.2/manual.html#lua_resume +--- + sim/ai.cc | 2 +- + 1 files changed, 1 insertions(+), 1 deletion(-) + +diff --git a/sim/ai.cc b/sim/ai.cc +index a9cd019..64ef0c6 100644 +--- a/sim/ai.cc ++++ b/sim/ai.cc +@@ -233,7 +233,7 @@ void LuaAI::tick() { + + lua_pushnumber(G, ship.game->time); + lua_setglobal(G, "_time"); +- auto result = lua_resume(L, 0); ++ auto result = lua_resume(L, NULL, 0); + if (result == 0) { + throw std::runtime_error("AI exited"); + } else if (result == LUA_YIELD) { +-- +2.2.2 + diff --git a/0004-Sim-Ship-Update-on-box2d-functions.patch b/0004-Sim-Ship-Update-on-box2d-functions.patch new file mode 100644 index 000000000000..2cddc96a2d1c --- /dev/null +++ b/0004-Sim-Ship-Update-on-box2d-functions.patch @@ -0,0 +1,30 @@ +From 191256d23aa1c8e4e67435da2c1a404aacb57f17 Mon Sep 17 00:00:00 2001 +From: Narrat +Date: Thu, 29 Jan 2015 12:22:00 +0100 +Subject: [PATCH 4/5] Sim/Ship: Update on box2d functions + +Those need now two arguments. +They additionally wake up the body. +See /usr/include/Box2D/Dynamics/b2Body.h:757 and 776 +--- + sim/ship.cc | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sim/ship.cc b/sim/ship.cc +index 9818e53..92c3252 100644 +--- a/sim/ship.cc ++++ b/sim/ship.cc +@@ -173,8 +173,8 @@ void Ship::update_forces() { + auto local_force_vec = vec2(main_thrust, lateral_thrust); + auto world_force_vec = + glm::rotate(local_force_vec, glm::degrees(get_heading())); +- body->ApplyForceToCenter(n2b(world_force_vec)); +- body->ApplyTorque(torque); ++ body->ApplyForceToCenter(n2b(world_force_vec), 1); ++ body->ApplyTorque(torque, 1); + } + + } +-- +2.2.2 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..0d25753af613 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,53 @@ +# Contributor: Lex Black +# Contributor: Rich Lane + +_pkgname=oort +pkgname=oort-git +pkgver=r394.7aacb6d +pkgrel=2 +pkgdesc="space fleet programming game" +arch=('i686' 'x86_64') +url="https://github.com/rlane/Oort" +license=("GPL") +depends=('boost-libs' 'box2d' 'glib2' 'glew' 'lua') +makedepends=('automake-1.11' 'boost' 'sdl') +optdepends=('sdl: for oort_sdl') +source=($_pkgname::git://github.com/rlane/Oort + 0002-headless-Included-iostream-else-it-failed-of-cerr.patch + 0003-Sim-AI-lua_resume-update.patch + 0004-Sim-Ship-Update-on-box2d-functions.patch) +md5sums=('SKIP' + '7eb888feddcf89eba7f22c1cf88928b6' + 'e6e2a9aaecb1186dd4907a18880f860e' + '656f4d154950976b937f7c7e7209b0d9') + + +pkgver() { + cd $_pkgname + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd $_pkgname + + git submodule init + git submodule update + + patch -p1 -i $srcdir/0002-headless-Included-iostream-else-it-failed-of-cerr.patch + patch -p1 -i $srcdir/0003-Sim-AI-lua_resume-update.patch + patch -p1 -i $srcdir/0004-Sim-Ship-Update-on-box2d-functions.patch +} + +build() { + cd "$srcdir/$_pkgname" + + ./autogen.sh + ./configure --prefix=/usr + make +} + +package() { + cd "$srcdir/$_pkgname" + + make DESTDIR="$pkgdir" install +}