games-strategy/0ad: cleanup

This commit is contained in:
Julian Ospald 2016-03-16 15:53:05 +01:00
parent c10cdb4ad5
commit 84d89c15f1
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
2 changed files with 0 additions and 288 deletions

View File

@ -1,222 +0,0 @@
# Copyright 2014 Bernd Steinhauser <berniyh@exherbo.org>
# Copyright 2014 Julian Ospald <hasufell@posteo.de>
# Distributed under the terms of the GNU General Public License v2
require gtk-icon-cache python
SUMMARY="A free, real-time strategy game"
HOMEPAGE="http://play0ad.com"
DOWNLOADS="
mirror://sourceforge/zero-ad/${PNV}-unix-build.tar.xz
mirror://sourceforge/zero-ad/${PNV}-unix-data.tar.xz
"
LICENCES="
Arev [[ note = [ Included DejaVu Fonts ] ]]
bitstream-font [[ note = [ Included DejaVu Fonts ] ]]
BSD-3 [[ note = [ build/premake/premake4 ] ]]
CCPL-Attribution-ShareAlike-3.0 [[ note = [ binaries/data/mods/{art,audio} ] ]]
GPL-2 [[ note = [
source/tools/atlas
Rest of binaries/data
] ]]
GUST [[ note = [ Included TeXGyrePagella Fonts ] ]]
ISC [[ note = [ source/lobby/pkcs5_pbkdf2.cpp ] ]]
MIT [[ note = [
build/premake/*.lua
libraries/source/{fcollada,nvtt}
source/lib
source/third_party/mongoose
] ]]
ZLIB [[ note = [ source/third_party/mikktspace ] ]]
"
SLOT="0"
PLATFORMS="~amd64 ~x86"
MYOPTIONS="
editor [[ description = [ Include Atlas scenario editor projects ] ]]
lobby [[ description = [ Enable the multiplayer lobby ] ]]
sound
( providers: ijg-jpeg jpeg-turbo ) [[ number-selected = exactly-one ]]
platform: amd64 x86
"
DEPENDENCIES="
build:
dev-lang/python:*[>=2.7]
virtual/pkg-config
build+run:
dev-libs/boost
dev-libs/icu:=
dev-libs/libxml2:2.0
dev-libs/nspr
media-libs/libpng:=
media-libs/SDL:2[X]
net-libs/enet
net-libs/miniupnpc
net-misc/curl
x11-dri/mesa
x11-libs/libX11
x11-libs/libXcursor
editor? ( x11-libs/wxGTK:3.0 )
lobby? ( net-libs/gloox )
providers:ijg-jpeg? ( media-libs/jpeg:= )
providers:jpeg-turbo? ( media-libs/libjpeg-turbo )
sound? (
media-libs/libvorbis
media-libs/openal
)
"
DEFAULT_SRC_PREPARE_PATCHES=(
-p0 "${FILES}"/${PNV}-flags.patch
)
src_unpack() {
default
###### spidermonkey #####
edo pushd "${WORK}"/libraries/source/spidermonkey
edo tar xjf mozjs-31.2.0.rc0.tar.bz2
edo mv mozjs-31.2.0 mozjs31
edo popd
#########################
}
src_prepare() {
default
###### fix premake #####
edo pushd "${WORK}"/build/premake/premake4
# The project uses an included version of premake (version 4.3.1),
# which doesn't seem available on premakes website.
# 4.3 does not work, 4.4 (b5) should be tested. So here we build
# premakes included version for now.
emake -C build/gmake.unix
# regenerate scripts.c so our patch applies
edo ./bin/release/premake4 embed
edo popd
# rebuild premake again...
emake -C "${WORK}"/build/premake/premake4/build/gmake.unix clean
emake -C "${WORK}"/build/premake/premake4/build/gmake.unix
########################
###### spidermonkey #####
edo pushd "${WORK}"/libraries/source/spidermonkey/mozjs31
edo . ../patch.sh
edo cd js/src
edo perl -i.bak -pe 's/(LIBRARY_NAME\s+=).*/$1 '\''mozjs31-ps-release'\''/' \
moz.build
edo mkdir -p build-release
edo popd
#########################
}
src_configure() {
local myconf=(
--with-system-miniupnpc
--minimal-flags
--without-nvtt
--without-pch
--without-tests
$(option sound "" "--without-audio")
$(option editor "--atlas" "")
$(option lobby "" "--without-lobby")
--collada
--bindir="/usr/$(exhost --target)/bin"
--libdir="/usr/$(exhost --target)/lib/${PN}"
--datadir="/usr/share/${PN}"
)
# run premake to create build scripts
edo pushd "${WORK}"/build/premake
edo ./premake4/bin/release/premake4 \
--file="premake4.lua" \
--outpath="../workspaces/gcc/" \
--platform=$(option platform:amd64 "x64" "x32") \
--os=linux \
"${myconf[@]}" \
gmake
edo popd
edo sed -i -e "s:pkg-config:${PKG_CONFIG}:" \
libraries/source/fcollada/src/Makefile \
build/workspaces/gcc/* \
libraries/source/spidermonkey/build.sh
edo sed -i -e "s:@ar:@${AR}:" \
-e "s:ranlib:${RANLIB}:" \
libraries/source/fcollada/src/Makefile
###### spidermonkey #####
# build bundled and patched spidermonkey-31
#
# spidermonkey build system requires that SHELL is always set.
# It's missing sometimes in chroot environments, so force it here.
export SHELL=/bin/sh
edo pushd "${WORK}"/libraries/source/spidermonkey/mozjs31/js/src/build-release/
ECONF_SOURCE="${WORK}/libraries/source/spidermonkey/mozjs31/js/src/" \
econf \
--hates=docdir \
--hates=datarootdir \
--enable-shared-js \
--enable-gcgenerational \
--disable-tests \
--without-intl-api \
--enable-optimize
edo popd
#########################
}
src_compile() {
###### spidermonkey #####
edo pushd "${WORK}"/libraries/source/spidermonkey
# TARGETS= from paludis environment breaks the build
env -u TARGETS emake TOOLCHAIN_PREFIX="$(exhost --tool-prefix)" \
-C mozjs31/js/src/build-release
# copy headers for building
edo mkdir -p include-unix-release
edo cp -R -L mozjs31/js/src/build-release/dist/include/* \
include-unix-release/
edo mkdir -p lib/
edo cp -L mozjs31/js/src/build-release/dist/lib/libmozjs31-ps-release.so \
lib/libmozjs31-ps-release.so
edo cp -L mozjs31/js/src/build-release/dist/lib/libmozjs31-ps-release.so \
../../../binaries/system/libmozjs31-ps-release.so
edo popd
#########################
# build 3rd party fcollada
emake -C libraries/source/fcollada/src
# build 0ad
emake -C build/workspaces/gcc verbose=1
}
src_install() {
if optionq editor ; then
newbin binaries/system/ActorEditor 0ad-ActorEditor
exeinto /usr/$(exhost --target)/lib/${PN}
doexe binaries/system/libAtlasUI.so
fi
# TODO: Use system fonts
newbin binaries/system/pyrogenesis 0ad
exeinto /usr/$(exhost --target)/lib/${PN}
doexe binaries/system/libCollada.so
doexe libraries/source/spidermonkey/mozjs31/js/src/build-release/dist/lib/*.so
insinto /usr/share/${PN}
doins -r binaries/data/*
insinto /usr/share/icons/hicolor/128x128/apps/
doins build/resources/${PN}.png
insinto /usr/share/applications
doins build/resources/0ad.desktop
dodoc README.txt binaries/system/readme.txt
}

View File

@ -1,66 +0,0 @@
From: Julian Ospald <hasufell@gentoo.org>
Date: Sun Jun 24 18:32:38 UTC 2012
Subject: build system
Upstream: no
* respect flags
--- libraries/source/fcollada/src/Makefile
+++ libraries/source/fcollada/src/Makefile
@@ -9,9 +9,9 @@
CXX ?= g++
CXXFLAGS += -fvisibility=hidden -W -Wall -Wno-unused-parameter -Wno-unused-function $(OS_DEFINE) $(PIC_FLAGS) $(CPPFLAGS)
-CXXFLAGS_DEBUG := -O0 -g -D_DEBUG -DRETAIL
-CXXFLAGS_RELEASE := -O2 -DNDEBUG -DRETAIL
-CXXFLAGS_TEST := -O0 -g -D_DEBUG
+CXXFLAGS_DEBUG := -D_DEBUG -DRETAIL
+CXXFLAGS_RELEASE := -DNDEBUG -DRETAIL
+CXXFLAGS_TEST := -D_DEBUG
LIBS += `pkg-config libxml-2.0 --libs`
INCLUDES += -IFCollada `pkg-config libxml-2.0 --cflags`
INCLUDES_TEST := -IFCollada/FColladaTest $(INCLUDES)
--- build/premake/premake4/src/tools/gcc.lua
+++ build/premake/premake4/src/tools/gcc.lua
@@ -136,8 +136,6 @@
if not cfg.flags.Symbols then
if cfg.system == "macosx" then
table.insert(result, "-Wl,-x")
- else
- table.insert(result, "-s")
end
end
--- build/premake/premake4/build/gmake.unix/Premake4.make
+++ build/premake/premake4/build/gmake.unix/Premake4.make
@@ -26,9 +26,9 @@
DEFINES += -DNDEBUG -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I../../src/host/lua-5.1.4/src
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
- CFLAGS += $(CPPFLAGS) -Wall -Os
- CXXFLAGS += $(CPPFLAGS) -Wall -Os
- LDFLAGS += -s -rdynamic
+ CFLAGS += $(CPPFLAGS) -Wall
+ CXXFLAGS += $(CPPFLAGS) -Wall
+ LDFLAGS += -rdynamic
LIBS += -lm -ldl
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
@@ -48,8 +48,8 @@
DEFINES += -D_DEBUG -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I../../src/host/lua-5.1.4/src
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
- CFLAGS += $(CPPFLAGS) -Wall -g
- CXXFLAGS += $(CPPFLAGS) -Wall -g
+ CFLAGS += $(CPPFLAGS) -Wall
+ CXXFLAGS += $(CPPFLAGS) -Wall
LDFLAGS += -rdynamic
LIBS += -lm -ldl
RESFLAGS += $(DEFINES) $(INCLUDES)
@@ -302,4 +302,4 @@
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lauxlib.d -MT "$@" -o "$@" -c "$<"
-include $(OBJECTS:%.o=%.d)
--include $(GCH:%.h.gch=%.h.d)
\ No newline at end of file
+-include $(GCH:%.h.gch=%.h.d)