/[gentoo-x86]/app-office/mozilla-sunbird/mozilla-sunbird-0.9.ebuild
Gentoo

Contents of /app-office/mozilla-sunbird/mozilla-sunbird-0.9.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Sat Oct 2 16:37:40 2010 UTC (3 years, 9 months ago) by polynomial-c
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
Time to get rid of mozilla-sunbird{,-bin}

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-office/mozilla-sunbird/mozilla-sunbird-0.9.ebuild,v 1.9 2010/05/10 13:57:27 ssuominen Exp $
4
5 WANT_AUTOCONF="2.1"
6
7 inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools
8
9 PATCH="${P}-patches-0.2"
10 LANGS="ca cs da de en-US es-AR es-ES eu fr ga-IE hu is it ja ka ko lt nb-NO nl nn-NO pl pt-BR pt-PT ro ru sk sl sv-SE uk zh-CN"
11 NOSHORTLANGS="es-AR pt-BR zh-TW"
12
13 MY_PN="${PN/mozilla-}"
14 MY_P="${MY_PN}-${PV}"
15 DESCRIPTION="The Mozilla Sunbird Calendar"
16 HOMEPAGE="http://www.mozilla.org/projects/calendar/sunbird.html"
17 IUSE="bindist"
18 SRC_URI="http://releases.mozilla.org/pub/mozilla.org/calendar/${MY_PN}/releases/${PV}/source/lightning-${MY_P}-source.tar.bz2
19 mirror://gentoo/${PATCH}.tar.bz2"
20
21 # These are in
22 #
23 # http://releases.mozilla.org/pub/mozilla.org/calendar/sunbird/releases/${PV}/langpacks/
24 #
25 # for i in $LANGS $SHORTLANGS; do wget $i.xpi -O ${P}-$i.xpi; done
26 for X in ${LANGS} ; do
27 if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then
28 SRC_URI="${SRC_URI}
29 linguas_${X/-/_}? ( http://dev.gentooexperimental.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
30 fi
31 IUSE="${IUSE} linguas_${X/-/_}"
32 # english is handled internally
33 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
34 if [ "${X}" != "en-US" ]; then
35 SRC_URI="${SRC_URI}
36 linguas_${X%%-*}? ( http://dev.gentooexperimental.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
37 fi
38 IUSE="${IUSE} linguas_${X%%-*}"
39 fi
40 done
41
42 KEYWORDS="amd64 ~ppc ~ppc64 x86 ~x86-fbsd"
43 SLOT="0"
44 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
45
46 RDEPEND=">=www-client/mozilla-launcher-1.55
47 >=dev-libs/nss-3.11.7"
48
49 S="${WORKDIR}/mozilla"
50
51 # Needed by src_compile() and src_install().
52 # Would do in pkg_setup but that loses the export attribute, they
53 # become pure shell variables.
54 export MOZ_CO_PROJECT=calendar
55 export BUILD_OFFICIAL=1
56 export MOZILLA_OFFICIAL=1
57
58 linguas() {
59 local LANG SLANG
60 for LANG in ${LINGUAS}; do
61 if has ${LANG} en en_US; then
62 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
63 continue
64 elif has ${LANG} ${LANGS//-/_}; then
65 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
66 continue
67 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
68 for X in ${LANGS}; do
69 if [[ "${X}" == "${LANG}-"* ]] && \
70 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
71 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
72 continue 2
73 fi
74 done
75 fi
76 ewarn "Sorry, but ${PN} does not support the ${LANG} LINGUA"
77 done
78 }
79
80 pkg_setup(){
81 if ! built_with_use x11-libs/cairo X; then
82 eerror "Cairo is not built with X useflag."
83 eerror "Please add 'X' to your USE flags, and re-emerge cairo."
84 die "Cairo needs X"
85 fi
86
87 if ! built_with_use --missing true x11-libs/pango X; then
88 eerror "Pango is not built with X useflag."
89 eerror "Please add 'X' to your USE flags, and re-emerge pango."
90 die "Pango needs X"
91 fi
92
93 if ! use bindist; then
94 elog "You are enabling official branding. You may not redistribute this build"
95 elog "to any users on your network or the internet. Doing so puts yourself into"
96 elog "a legal problem with mozilla foundation"
97 fi
98
99 use moznopango && warn_mozilla_launcher_stub
100 }
101
102 src_unpack() {
103 unpack ${A%bz2*}bz2
104
105 linguas
106 for X in ${linguas}; do
107 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
108 done
109 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
110 einfo "Selected language packs (first will be default): ${linguas}"
111 fi
112
113 # Apply our patches
114 cd "${S}" || die "cd failed"
115 EPATCH_SUFFIX="patch" \
116 EPATCH_FORCE="yes" \
117 epatch "${WORKDIR}"/patch
118
119 # todo: move to patchset
120 epatch "${FILESDIR}"/lpng14.patch
121
122 eautoreconf
123 }
124
125 src_compile() {
126 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
127
128 ####################################
129 #
130 # mozconfig, CFLAGS and CXXFLAGS setup
131 #
132 ####################################
133
134 mozconfig_init
135 mozconfig_config
136
137 mozconfig_annotate '' --enable-application=calendar
138 mozconfig_annotate '' --enable-extensions=default
139 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
140 mozconfig_annotate '' --with-system-nss
141 mozconfig_annotate '' --with-system-nspr
142
143 if ! use bindist; then
144 mozconfig_annotate '' --enable-official-branding
145 fi
146
147 # Finalize and report settings
148 mozconfig_final
149
150 if [[ $(gcc-major-version) -lt 4 ]]; then
151 append-cxxflags -fno-stack-protector
152 fi
153
154 ####################################
155 #
156 # Configure and build
157 #
158 ####################################
159
160 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
161 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
162 econf || die
163
164 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
165 # to econf, but the quotes cause configure to fail.
166 sed -i -e \
167 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
168 "${S}"/config/autoconf.mk \
169 "${S}"/nsprpub/config/autoconf.mk \
170 "${S}"/xpfe/global/buildconfig.html
171
172 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
173 # requirements while compiling
174 edit_makefiles
175
176 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
177 emake ${jobs} || die
178 }
179
180 pkg_preinst() {
181 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
182
183 einfo "Removing old installs through some really ugly code. It potentially"
184 einfo "eliminates any problems during the install, however suggestions to"
185 einfo "replace this are highly welcome. Send comments and suggestions to"
186 einfo "mozilla@gentoo.org."
187 rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
188 }
189
190 src_install() {
191 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
192
193 # Most of the installation happens here
194 dodir ${MOZILLA_FIVE_HOME}
195 cp -RL "${S}"/dist/bin/* "${D}"${MOZILLA_FIVE_HOME} || die "Copy of files failed"
196 touch "${D}"${MOZILLA_FIVE_HOME}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.manifest
197 touch "${D}"${MOZILLA_FIVE_HOME}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
198
199 linguas
200 for X in ${linguas}; do
201 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
202 done
203
204 local LANG=${linguas%% *}
205 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
206 einfo "Setting default locale to ${LANG}"
207 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
208 ${MOZILLA_FIVE_HOME}/defaults/pref/sunbird.js \
209 ${MOZILLA_FIVE_HOME}/defaults/pref/sunbird-l10n.js || \
210 die "sed failed to change locale"
211 fi
212
213 # Create /usr/bin/sunbird
214 install_mozilla_launcher_stub sunbird ${MOZILLA_FIVE_HOME}
215
216 # Install icon and .desktop for menu entry
217 if ! use bindist; then
218 doicon "${FILESDIR}"/icon/${PN}-icon.png
219 domenu "${FILESDIR}"/icon/${PN}.desktop
220 else
221 doicon "${FILESDIR}"/icon/${PN}-unbranded-icon.png
222 newmenu "${FILESDIR}"/icon/${PN}-unbranded.desktop \
223 ${PN}.desktop
224
225 fi
226 }
227
228 pkg_postinst() {
229 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
230
231 # This should be called in the postinst and postrm of all the
232 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
233 # thunderbird-bin ebuilds.
234 update_mozilla_launcher_symlinks
235 }
236
237 pkg_postrm() {
238 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
239
240 update_mozilla_launcher_symlinks
241 }

  ViewVC Help
Powered by ViewVC 1.1.20