summaryrefslogtreecommitdiff
path: root/games-engines/openmw/openmw-9999.ebuild
blob: bda8b0049efb23b2c10d3a1f5334377af645ec3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

inherit eutils flag-o-matic gnome2-utils cmake-utils games git

DESCRIPTION="An open source reimplementation of TES III: Morrowind"
HOMEPAGE="http://openmw.org/"
SRC_URI=""

EGIT_REPO_URI="git://github.com/zinnschlag/openmw.git"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="cdinstall ffmpeg +mpg123"

RDEPEND=">=dev-games/mygui-3.2.0
	>=dev-games/ogre-1.8.0[cg,freeimage,ois,opengl,zip]
	dev-games/ois
	>=dev-libs/boost-1.46.0
	media-gfx/nvidia-cg-toolkit
	media-libs/freetype:2
	media-libs/openal
	>=sci-physics/bullet-2.80
	>=x11-libs/qt-core-4.7.0:4
	>=x11-libs/qt-gui-4.7.0:4
	ffmpeg? ( media-video/ffmpeg )
	mpg123? ( media-libs/libsndfile
		media-sound/mpg123 )"
DEPEND="${RDEPEND}
	virtual/pkgconfig"
PDEPEND="cdinstall? ( games-rpg/morrowind-data )"

REQUIRED_USE="^^ ( mpg123 ffmpeg )"

S=${WORKDIR}/${P}-source

src_prepare() {
	epatch "${FILESDIR}"/${PN}-0.15.0-cmake.patch
	epatch "${FILESDIR}"/${PN}-0.15.0-cfg.patch

	sed \
		-e "s#globalPath(\"/etc/\")#globalPath(\"${GAMES_SYSCONFDIR}\")#" \
		-i components/files/linuxpath.cpp || die "fixing global confdir failed!"

	sed \
		-e '1i#include <stdexcept>' \
		-e '1i#include <memory>' \
		-i apps/${PN}/mwsound/ffmpeg_decoder.cpp || die "fixing includes failed!"

	sed \
		-e '/^Version/d' \
		-i files/${PN}.desktop || die "fixing desktop file failed!"
}

src_configure() {
	# QA
	append-flags -fno-strict-aliasing

	local mycmakeargs=(
		$(cmake-utils_use_use ffmpeg FFMPEG)
		$(cmake-utils_use_use mpg123 MPG123)
		-DBINDIR="${GAMES_BINDIR}"
		-DDATADIR="${GAMES_DATADIR}"/${PN}
		-DSYSCONFDIR="${GAMES_SYSCONFDIR}"/${PN}
		-DICONDIR=/usr/share/icons/hicolor/256x256/apps
		-DMORROWIND_DATA_FILES="${GAMES_DATADIR}"/morrowind-data
		-DMORROWIND_RESOURCE_FILES="${GAMES_DATADIR}"/${PN}/resources
		-DUSE_AUDIERE=OFF
	)

	cmake-utils_src_configure
}

src_compile() {
	cmake-utils_src_compile
}

src_install() {
	cmake-utils_src_install
	dodoc readme.txt
	prepgamesdirs
}

pkg_preinst() {
	games_pkg_preinst
	gnome2_icon_savelist
}

pkg_postinst() {
	games_pkg_postinst
	gnome2_icon_cache_update
}

pkg_postrm() {
	gnome2_icon_cache_update
}