hasufell-repository/packages/games-strategy/0ad/0ad-0.0.19-alpha.exheres-0

171 lines
4.6 KiB
Bash
Raw Normal View History

2014-11-24 21:30:17 +00:00
# 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
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-Vera [[ 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
2014-11-24 21:30:17 +00:00
"
# nvtt (optional, mostly for 3rd party mods)
# regarding spidermonkeys weird dep http://trac.wildfiregames.com/ticket/2943
2014-11-24 21:30:17 +00:00
DEPENDENCIES="
editor? (
build+run:
x11-libs/wxGTK:3.0
)
lobby? (
build+run:
net-libs/gloox
)
sound? (
build+run:
media-libs/libvorbis
media-libs/openal
)
build:
virtual/pkg-config
build+run:
dev-libs/boost
dev-libs/icu:=
2014-11-24 21:30:17 +00:00
dev-libs/libxml2:2.0
dev-libs/nspr
providers:ijg-jpeg? ( media-libs/jpeg )
providers:jpeg-turbo? ( media-libs/libjpeg-turbo )
2014-11-24 21:30:17 +00:00
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
"
DEFAULT_SRC_PREPARE_PATCHES=(
-p0 "${FILES}"/${PNV}-exherbo.patch
2014-11-24 21:30:17 +00:00
)
src_prepare() {
default
edo sed -i -e "s:pkg-config:${PKG_CONFIG}:" \
libraries/source/spidermonkey/build.sh
}
2014-11-24 21:30:17 +00:00
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}"
)
2014-11-24 21:30:17 +00:00
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
2014-11-24 21:30:17 +00:00
edo popd
# rebuild premake again...
emake -C "${WORK}"/build/premake/premake4/build/gmake.unix clean
emake -C "${WORK}"/build/premake/premake4/build/gmake.unix
2014-11-24 21:30:17 +00:00
# run premake to create build scripts
2014-11-24 21:30:17 +00:00
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
2014-11-24 21:30:17 +00:00
edo popd
}
src_compile() {
export AR=$(exhost --tool-prefix)ar
2014-11-24 21:30:17 +00:00
edo pushd "${WORK}"/libraries/source/spidermonkey
edo ./build.sh
edo popd
# build 3rd party fcollada
emake -C libraries/source/fcollada/src
# build 0ad
emake -C build/workspaces/gcc verbose=1
2014-11-24 21:30:17 +00:00
}
src_install() {
if optionq editor ; then
newbin binaries/system/ActorEditor 0ad-ActorEditor
exeinto /usr/$(exhost --target)/lib/${PN}
doexe binaries/system/libAtlasUI.so
2014-11-24 21:30:17 +00:00
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/lib/*.so
2014-11-24 21:30:17 +00:00
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
}