# Contributor: Weng Xuetian <wengxt@gmail.com>
# PGO might not build for you. And it takes very long time to compile.
_enable_pgo="y"
# JEMALLOC not works for me, at least. You can just try, but might waste time.
_enable_jemalloc_pgo="y"
pkgname=firefox-kde-opensuse
pkgver=13.0.1
pkgrel=1
pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE"
arch=('i686' 'x86_64')
license=('MPL' 'GPL' 'LGPL')
depends=('gtk2' 'libidl2' 'mozilla-common' 'nss>=3.13.3' 'libxt'
'libxrender' 'hunspell' 'startup-notification' 'mime-types' 'dbus-glib'
'alsa-lib' 'libevent' 'sqlite3>=3.7.4' 'libnotify' 'desktop-file-utils'
'libvpx' 'lcms' 'nspr>=4.8.8' 'libevent' 'libpng' 'cairo' 'kmozillahelper>=0.6' )
makedepends=('unzip' 'zip' 'diffutils' 'python2' 'wireless_tools' 'yasm' 'mesa'
'autoconf2.13' 'libidl2' 'xorg-server-xvfb' 'imake' 'gcc>=4.7.1')
# this is a charka CCR feature, AUR user can ignore it.
screenshot="http://img864.imageshack.us/img864/5116/firefoxm.png"
if [[ $_enable_pgo == "y" ]]; then
if [ ! -f '/etc/chakra-release' ]; then
makedepends+=('xorg-server-xvfb')
fi
fi
provides=("firefox=${pkgver}")
conflicts=('firefox')
install=firefox.install
url="http://www.mozilla.org/projects/firefox"
#source=(ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${pkgver}/source/firefox-${pkgver}.source.tar.bz2
source=(http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${pkgver}/source/firefox-${pkgver}.source.tar.bz2
mozconfig
mozconfig-pgo
firefox.desktop
firefox-install-dir.patch
vendor.js
kde.js
firefox-cross-desktop.patch
firefox-kde.patch
firefox-browser-css.patch
mozilla-nongnome-proxies.patch
mozilla-kde.patch
)
build() {
cd "mozilla-release"
patch -Np1 -i "../firefox-install-dir.patch"
rm -f browser/components/shell/src/nsKDEShellService.cpp \
browser/components/shell/src/nsKDEShellService.h \
browser/components/shell/src/nsUnixShellService.cpp \
browser/components/shell/src/nsUnixShellService.h \
browser/base/content/browser-kde.xul
rm -f toolkit/xre/nsKDEUtils.cpp \
toolkit/xre/nsKDEUtils.h \
uriloader/exthandler/unix/nsCommonRegistry.cpp \
uriloader/exthandler/unix/nsCommonRegistry.h \
uriloader/exthandler/unix/nsKDERegistry.cpp \
uriloader/exthandler/unix/nsKDERegistry.h \
toolkit/content/widgets/dialog-kde.xml \
toolkit/content/widgets/preferences-kde.xml
install -m 644 "../kde.js" browser/app/profile/kde.js
patch -Np1 -i "../mozilla-nongnome-proxies.patch" || return 1
patch -Np1 -i "../mozilla-kde.patch" || return 1
patch -Np1 -i "../firefox-cross-desktop.patch" || return 1
patch -Np1 -i "../firefox-kde.patch" || return 1
patch -Np1 -i "../firefox-browser-css.patch" || return 1
if [[ $_enable_pgo == "y" ]]; then
msg "PGO is enabled"
cp "../mozconfig-pgo" .mozconfig
else
msg "PGO is disabled"
cp "../mozconfig" .mozconfig
fi
# Fix PRE_RELEASE_SUFFIX
sed -i '/^PRE_RELEASE_SUFFIX := ""/s/ ""//' \
browser/base/Makefile.in
export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/lib/firefox"
export PYTHON="/usr/bin/python2"
# PGO
if [[ $_enable_pgo == "y" ]]; then
if [[ $_enable_jemalloc_pgo == "y" ]]; then
sed -i '/^NO_PROFILE_GUIDED_OPTIMIZE = 1$/d' \
memory/jemalloc/Makefile.in
fi
echo 'LDFLAGS += -lX11 -lXrender' \
>> layout/build/Makefile.in
if [ "${CARCH}" = "x86_64" ]; then
make -j1 -f client.mk build MOZ_MAKE_FLAGS="${MAKEFLAGS}"
fi
LD_PRELOAD="" /usr/bin/Xvfb -nolisten tcp -extension GLX -screen 0 1280x1024x24 :99 &
LD_PRELOAD="" DISPLAY=:99 make -j1 -f client.mk profiledbuild MOZ_MAKE_FLAGS="$MAKEFLAGS"
kill $! || true
else
make -j1 -f client.mk build MOZ_MAKE_FLAGS="${MAKEFLAGS}"
fi
}
package() {
cd mozilla-release
make -j1 -f client.mk DESTDIR="$pkgdir" install
install -m644 ../vendor.js "$pkgdir/usr/lib/firefox/defaults/pref"
for i in 16 22 24 32 48 256; do
install -Dm644 browser/branding/official/default$i.png \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/firefox.png"
done
install -Dm644 ../firefox.desktop \
"$pkgdir/usr/share/applications/firefox.desktop"
# Use system-provided dictionaries
rm -rf "$pkgdir"/usr/lib/firefox/{dictionaries,hyphenation}
ln -s /usr/share/hunspell "$pkgdir/usr/lib/firefox/dictionaries"
ln -s /usr/share/hyphen "$pkgdir/usr/lib/firefox/hyphenation"
# We don't want the development stuff
rm -r "$pkgdir"/usr/{include,lib/firefox-devel,share/idl}
#workaround for now
#https://bugzilla.mozilla.org/show_bug.cgi?id=658850
ln -sf firefox "$pkgdir/usr/lib/firefox/firefox-bin"
}
md5sums=('82deadb501c7fc0e9fa6b025f51f05a1'
'ff77c91b4bdeb0204ffa33c0957b11c1'
'84fa853f0a821c46ce0396af7c897c9f'
'1df7fd9afd75d06decb129518a769133'
'1e4bcac59e93d21fffa6a1d1ad235247'
'0d053487907de4376d67d8f499c5502b'
'75df0f88cc7a7fa7d522459e4ff82cc5'
'6e7b4f2554beacb998bbce3f0e184584'
'ea852561bc568922b25548c8d5367aee'
'90cc234d848a2060abc6a007622e1af7'
'8b0ecfdf697485d7b7dd26291c0dc478'
'4ab126609ed4362c298b5c59aa3d25c7')