summaryrefslogtreecommitdiff
blob: 23721826958f8449382804df5c6b78e6ec481e4a (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit subversion mozextension multilib

ESVN_REPO_URI="http://google-gears.googlecode.com/svn/trunk/gears"

DESCRIPTION="Google Gears"
HOMEPAGE="http://code.google.com/p/google-gears/"
SRC_URI=""

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug"

DEPEND="www-client/mozilla-firefox
	dev-util/pkgconfig"

S="${WORKDIR}/gears"

MOZILLA_FIVE_HOME="/usr/$(get_libdir)/mozilla-firefox"

src_unpack() {
	subversion_src_unpack

	cd "${S}"

	local myarch="i386"

	if ! use x86 ; then
		myarch="$(uname -m)"
	fi

	sed -i \
		-e "/ARCH = /s:i386:${myarch}:" \
		-e "s:gcc:$(tc-getCC):" \
		-e "s:g++:$(tc-getCXX):" \
		-e "/^GECKO_SDK = /s:=.*:= ${MOZILLA_FIVE_HOME}:" \
		-e "/^FF_CPPFLAGS = /s:$: $(pkg-config firefox-xpcom --cflags) -I${MOZILLA_FIVE_HOME}/include/dom -I${MOZILLA_FIVE_HOME}/include/necko:" \
		-e "/^FF_LIBS = /s:-lxpcomglue_s:$(pkg-config firefox-xpcom --libs):" \
		-e "s:\(\$(GECKO_SDK)\)/\(bin\|lib\):\1:" \
		-e "/^COMPILE_FLAGS_opt = /s:-O2:${CFLAGS}:" \
		-e "/^COMPILE_FLAGS = /s:-Werror::" \
		-e "s:gecko_sdk/bin/xpidl:xpidl:" \
		tools/{config,rules}.mk || die

	sed -i -e "/OnListenerEvent/s:<int>:<long>:" \
		localserver/firefox/async_task_ff.cc || die

	if ! use x86 ; then
		sed -i -e "s/x86/${myarch}/g" base/firefox/install.rdf.m4 || die
	fi

	if ! use debug ; then
		sed -i -e "/^MODE = /s|dbg|opt|" tools/config.mk || die
	fi
}

src_install() {
	xpi_install "${S}"/bin-*/installers/gears-*/

	dohtml -r sdk
}