/[gentoo-x86]/www-client/opera-next/opera-next-12.00.1289.ebuild
Gentoo

Contents of /www-client/opera-next/opera-next-12.00.1289.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Fri Feb 24 06:06:17 2012 UTC (7 years, 2 months ago) by jer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
http://my.opera.com/desktopteam/blog/2012/02/23/finally-some-hardware-acceleration-fixes

(Portage version: 2.2.0_alpha89/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-client/opera-next/opera-next-12.00.1289.ebuild,v 1.2 2012/02/13 12:46:14 jer Exp $
4
5 EAPI="4"
6
7 inherit eutils fdo-mime gnome2-utils multilib pax-utils versionator
8
9 DESCRIPTION="A fast and secure web browser and Internet suite"
10 HOMEPAGE="http://www.opera.com/"
11
12 SLOT="0"
13 LICENSE="OPERA-11 LGPL-2 LGPL-3"
14 KEYWORDS="~x86 ~x86-fbsd"
15 IUSE="elibc_FreeBSD gtk gtk3 kde +gstreamer"
16
17 O_V="$(get_version_component_range 1-2)" # Major version, i.e. 11.00
18 O_B="$(get_version_component_range 3)" # Build version, i.e. 1156
19
20 O_D="vostok_${O_V}-${O_B}"
21 O_P="${PN}-${O_V}-${O_B}"
22 O_U="http://snapshot.opera.com/unix/"
23
24 SRC_URI="
25 x86? ( ${O_U}${O_D}/${O_P}.i386.linux.tar.xz )
26 x86-fbsd? ( ${O_U}${O_D}/${O_P}.i386.freebsd.tar.xz )
27 "
28
29 OPREFIX="/usr/$(get_libdir)"
30
31 QA_DT_HASH="${OPREFIX}/${PN}/.*"
32 QA_PRESTRIPPED="${OPREFIX}/${PN}/.*"
33
34 O_LINGUAS="af az be bg bn cs da de el en-GB es-ES es-LA et fi fr fr-CA fy gd hi
35 hr hu id it ja ka ko lt me mk ms nb nl nn pa pl pt pt-BR ro ru sk sr sv sw ta te
36 th tl tr uk uz vi zh-CN zh-TW zu"
37
38 for O_LINGUA in ${O_LINGUAS}; do
39 IUSE="${IUSE} linguas_${O_LINGUA/-/_}"
40 done
41
42 DEPEND="
43 >=sys-apps/sed-4
44 app-arch/xz-utils
45 "
46 GTKRDEPEND="
47 dev-libs/atk
48 dev-libs/glib:2
49 x11-libs/cairo
50 x11-libs/gdk-pixbuf
51 gtk? ( x11-libs/gtk+:2 )
52 gtk3? ( x11-libs/gtk+:3 )
53 x11-libs/pango
54 x11-libs/pixman
55 "
56 KDERDEPEND="
57 kde-base/kdelibs
58 x11-libs/qt-core
59 x11-libs/qt-gui
60 "
61 GSTRDEPEND="
62 dev-libs/glib:2
63 dev-libs/libxml2
64 media-libs/gst-plugins-base
65 media-libs/gstreamer
66 media-plugins/gst-plugins-meta
67 "
68 RDEPEND="
69 media-libs/fontconfig
70 media-libs/freetype
71 sys-apps/util-linux
72 sys-libs/zlib
73 virtual/opengl
74 x11-libs/libICE
75 x11-libs/libSM
76 x11-libs/libX11
77 x11-libs/libXext
78 x11-libs/libXft
79 x11-libs/libXrender
80 x11-libs/libXt
81 gtk? ( ${GTKRDEPEND} )
82 gtk3? ( ${GTKRDEPEND} )
83 kde? ( ${KDERDEPEND} )
84 gstreamer? ( ${GSTRDEPEND} )
85 "
86 src_unpack() {
87 unpack ${A}
88 mv -v ${PN}* "${S}" || die
89 }
90
91 src_prepare() {
92 local LNGDIR="share/${PN}/locale"
93
94 # Count linguas
95 count() { echo ${#}; }
96 local lingua_count=$(count ${O_LINGUAS} en)
97 local locale_count=$(count ${LNGDIR}/*)
98 [[ ${lingua_count} = ${locale_count} ]] \
99 || die "Number of LINGUAS does not match number of locales"
100 unset count
101
102 # Remove unwanted linguas
103 einfo "Keeping these locales (linguas): ${LINGUAS}."
104 for LINGUA in ${O_LINGUAS}; do
105 if ! use linguas_${LINGUA/-/_}; then
106 LINGUA=$(find "${LNGDIR}" -maxdepth 1 -type d -iname ${LINGUA/_/-})
107 rm -r "${LINGUA}" || die "The list of linguas needs to be fixed"
108 fi
109 done
110
111 # Remove doc directory but keep the LICENSE under another name (bug #315473)
112 mv share/doc/${PN}/LICENSE share/${PN}/defaults/license.txt
113 rm -rf share/doc
114 for locale in share/${PN}/locale/*; do
115 rm -f "${locale}/license.txt"
116 ln -sn /usr/share/${PN}/defaults/license.txt "${locale}/license.txt" \
117 || die
118 done
119
120 # Remove package directory
121 rm -rf share/${PN}/package
122
123 # Optional libraries
124 if ! use gtk; then
125 rm lib/${PN}/liboperagtk2.so || die
126 fi
127 if ! use gtk3; then
128 rm lib/${PN}/liboperagtk3.so || die
129 fi
130 if ! use kde; then
131 rm lib/${PN}/liboperakde4.so || die
132 fi
133 if ! use gstreamer; then
134 rm -r lib/${PN}/gstreamer || die
135 fi
136
137 # Unzip the man pages before sedding
138 gunzip share/man/man1/* || die
139
140 # Replace PREFIX, SUFFIX and PN in various files
141 sed -i \
142 -e "s:@@{PREFIX}:/usr:g" \
143 -e "s:@@{SUFFIX}::g" \
144 -e "s:@@{_SUFFIX}::g" \
145 -e "s:@@{USUFFIX}::g" \
146 -e "s:opera:${PN}:g" \
147 share/man/man1/* \
148 share/applications/${PN}-*.desktop \
149 || die
150
151 # Replace "Opera" with "Opera Next"
152 if [[ ${PN} = opera-next ]]; then
153 sed -i share/applications/${PN}-*.desktop \
154 -e "/^Name=Opera\|^ Next/s:Opera:& Next:" || die
155 fi
156
157 # Create /usr/bin/opera wrapper
158 echo '#!/bin/sh' > ${PN}
159 echo 'export OPERA_DIR="/usr/share/'"${PN}"'"' >> ${PN}
160 echo 'export OPERA_PERSONALDIR=${OPERA_PERSONALDIR:-"${HOME}/.'${PN}'"}' \
161 >> ${PN}
162 echo 'exec '"${OPREFIX}/${PN}/${PN}"' "$@"' >> ${PN}
163
164 # Change libz.so.3 to libz.so.1 for gentoo/freebsd
165 if use elibc_FreeBSD; then
166 scanelf -qR -N libz.so.3 -F "#N" lib/${PN}/ | \
167 while read i; do
168 if [[ $(strings "$i" | fgrep -c libz.so.3) -ne 1 ]];
169 then
170 export SANITY_CHECK_LIBZ_FAILED=1
171 break
172 fi
173 sed -i \
174 "$i" \
175 -e 's/libz\.so\.3/libz.so.1/g'
176 done
177 [[ "$SANITY_CHECK_LIBZ_FAILED" = "1" ]] && die
178 fi
179 }
180
181 src_install() {
182 # We install into usr instead of opt as Opera does not support the latter
183 dodir /usr
184 mv lib/ "${D}/${OPREFIX}" || die
185 mv share/ "${D}/usr/" || die
186
187 # Install startup scripts
188 dobin ${PN}
189
190 # Stop revdep-rebuild from checking opera binaries
191 dodir /etc/revdep-rebuild
192 echo "SEARCH_DIRS_MASK=\"${OPREFIX}/${PN}\"" \
193 > "${D}"/etc/revdep-rebuild/90${PN}
194
195 # Set PaX markings for hardened/PaX (bug #344267)
196 pax-mark m "${D}"/${OPREFIX}/${PN}/opera*
197 }
198
199 pkg_preinst() {
200 gnome2_icon_savelist
201 }
202
203 pkg_postinst() {
204 if use elibc_FreeBSD; then
205 elog
206 elog "To improve shared memory usage please set:"
207 elog "$ sysctl kern.ipc.shm_allow_removed=1"
208 fi
209
210 # Update desktop file database and gtk icon cache (bug #334993)
211 gnome2_icon_cache_update
212 fdo-mime_desktop_database_update
213 }
214
215 pkg_postrm() {
216 # Update desktop file database and gtk icon cache (bug #334993)
217 gnome2_icon_cache_update
218 fdo-mime_desktop_database_update
219 }

  ViewVC Help
Powered by ViewVC 1.1.20