gtk/firefox-kde/PKGBUILD
2014-06-13 00:28:45 +00:00

217 lines
7.8 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Contributor: Weng Xuetian <wengxt@gmail.com>
pkgname=firefox-kde
pkgver=30.0
pkgrel=3
pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE"
_kmozillahelper_obsver=b88c72dfdc858f6209feb123227bd7df
_kmozillahelper_pkgname=kmozillahelper
_kmozillahelper_pkgver=0.6.4
url='http://www.mozilla.org/projects/firefox'
arch=('x86_64')
license=('MPL')
depends=('gtk2' 'startup-notification' 'libnotify' 'alsa-lib' 'gstreamer0.10' 'gst-plugins-base' 'libxt' 'dbus-glib' 'libevent' 'sqlite3' 'kdelibs' 'nss')
makedepends=('zip' 'pkg-config' 'diffutils' 'python2' 'wireless_tools' 'unzip' 'autoconf2.13' 'mesa' 'yasm' 'cmake' 'automoc4' 'libpulse' 'xorg-server')
optdepends=('networkmanager: Location detection via available WiFi networks'
'libpulse: PulseAudio audio driver')
screenshot="http://img864.imageshack.us/img864/5116/firefoxm.png"
provides=("firefox=${pkgver}" "kmozillahelper=${_kmozillahelper_pkgver}")
conflicts=('firefox' 'kmozillahelper')
replaces=('kmozillahelper')
install=firefox.install
url="http://www.mozilla.org/projects/firefox"
optdepends=('firefox-i18n: for multilanguage support')
#
# For whom want to update this package
#
# Alternative firefox source url:
# http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${pkgver}/source/firefox-${pkgver}.source.tar.bz2
# This URL uses CDN so it's faster, but maybe out of date when new firefox release comes out.
#
# Find Firefox KDE related patch:
# patch http://www.rosenauer.org/hg/mozilla/
# patch https://build.opensuse.org/package/show?package=MozillaFirefox&project=mozilla%3AFactory
#
# Usually, we also port non-openSUSE specific patch together.
#
_patchrev=8ce6c378e34d
_patchurl=http://www.rosenauer.org/hg/mozilla/raw-file/$_patchrev
source=(ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${pkgver}/source/firefox-${pkgver}.source.tar.bz2
mozconfig
firefox.desktop
vendor.js
kde.js
firefox-20.0.1-fixed-loading-icon.png
duckduckgo.xml
"kmozillahelper-0.6.4.tar.bz2::https://api.opensuse.org/public/source/mozilla:Factory/mozilla-kde4-integration/${_kmozillahelper_pkgname}-${_kmozillahelper_pkgver}.tar.bz2?rev=${_kmozillahelper_obsver}"
firefox-install-dir.patch
# Firefox patchset
$_patchurl/firefox-kde.patch
$_patchurl/firefox-kde-114.patch
$_patchurl/firefox-no-default-ualocale.patch
$_patchurl/firefox-branded-icons.patch
# Gecko/toolkit patchset
# $_patchurl/toolkit-download-folder.patch
$_patchurl/mozilla-nongnome-proxies.patch
$_patchurl/mozilla-prefer_plugin_pref.patch
$_patchurl/mozilla-kde.patch
# $_patchurl/mozilla-preferences.patch
$_patchurl/mozilla-language.patch
install-kde-js.patch
)
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Chakra Linux use ONLY. For your own distribution, please
# get your own set of keys.
_google_api_key=AIzaSyA33sdKPff0x3KBByOhpzc1i7RS2A1mEpY
prepare() {
cd "mozilla-release"
cp "$srcdir/mozconfig" .mozconfig
patch -Np1 -i "$srcdir/firefox-install-dir.patch"
echo -n "$_google_api_key" > google-api-key
# make makepkg -R easier
msg "Patching for KDE"
rm -f content/media/gstreamer/nsGStreamerFormatHelper.{h,cpp}
rm -f browser/components/shell/src/{nsKDEShellService,nsUnixShellService}.{h,cpp}
rm -f browser/base/content/browser-kde.xul
rm -f toolkit/xre/nsKDEUtils.{h,cpp}
rm -f uriloader/exthandler/unix/{nsCommonRegistry,nsKDERegistry}.{h,cpp}
rm -f toolkit/content/widgets/{dialog,preferences}-kde.xml
msg "Gecko/toolkit patchset"
#patch -Np1 -i "$srcdir/toolkit-download-folder.patch"
patch -Np1 -i "$srcdir/mozilla-nongnome-proxies.patch"
patch -Np1 -i "$srcdir/mozilla-prefer_plugin_pref.patch"
patch -Np1 -i "$srcdir/mozilla-kde.patch"
#patch -Np1 -i "$srcdir/mozilla-preferences.patch" #At startup, read and use the OSs locale.
patch -Np1 -i "$srcdir/mozilla-language.patch"
msg "Firefox patchset"
patch -Np1 -i "$srcdir/firefox-kde.patch"
patch -Np1 -i "$srcdir/firefox-kde-114.patch"
patch -Np1 -i "$srcdir/firefox-no-default-ualocale.patch"
patch -Np1 -i "$srcdir/firefox-branded-icons.patch"
patch -Np0 -i "$srcdir/install-kde-js.patch"
cp "$srcdir/kde.js" browser/app/profile/
# configure script misdetects the preprocessor without an optimization level
# https://bugs.archlinux.org/task/34644
sed -i '/ac_cpp=/s/$CPPFLAGS/& -O2/' configure
# WebRTC build tries to execute "python" and expects Python 2
mkdir -p "$srcdir/path"
ln -sf /usr/bin/python2 "$srcdir/path/python"
# Fix tab loading icon (flickers with libpng 1.6)
# https://bugzilla.mozilla.org/show_bug.cgi?id=841734
cp "$srcdir/firefox-20.0.1-fixed-loading-icon.png" \
browser/themes/linux/tabbrowser/loading.png
}
build() {
cd "$srcdir/mozilla-release"
msg "build_kmozillahelper"
build_kmozillahelper
msg "build_firefox"
build_firefox
}
build_kmozillahelper() {
cd $srcdir/
mkdir -p kmozillahelper-build
cd kmozillahelper-build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=Release ../kmozillahelper
make
}
build_firefox() {
cd "$srcdir/mozilla-release"
export PATH="$srcdir/path:$PATH"
export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/lib/firefox"
export PYTHON="/usr/bin/python2"
export MOZ_MAKE_FLAGS="$MAKEFLAGS"
unset MAKEFLAGS
# Enabled PGO: https://developer.mozilla.org/en-US/docs/Building_with_Profile-Guided_Optimization
#make -f client.mk profiledbuild MOZ_MAKE_FLAGS="${MAKEFLAGS}"
# Set up PGO
export DISPLAY=:99
Xvfb -nolisten tcp -extension GLX -screen 0 1280x1024x24 $DISPLAY &
# Build
if ! make -f client.mk build MOZ_PGO=1; then
kill $!
return 1
fi
# Kill leftovers
kill $! || true
}
package() {
msg "package() kmozillahelper"
cd $srcdir/kmozillahelper-build
make DESTDIR=$pkgdir install
msg "package() Firefox"
cd "$srcdir/mozilla-release"
make -f client.mk DESTDIR="$pkgdir" MOZ_PKG_FATAL_WARNINGS=0 install
install -Dm644 ../vendor.js "$pkgdir/usr/lib/firefox/browser/defaults/preferences/vendor.js"
install -Dm644 ../kde.js "$pkgdir/usr/lib/firefox/browser/defaults/preferences/kde.js"
install -Dm644 ../duckduckgo.xml "$pkgdir/usr/lib/firefox/browser/searchplugins/duckduckgo.xml"
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"
}
sha1sums=('21dce1a2d4b8085c5f7f66b5f4f60bc37598285d'
'c343b926a24020e84bac33c1bf4e604719305464'
'86d6c2fe4ec2b3072a132e2afbc0ac798fd51e8f'
'ca77a08b296f8673828898d91b20cc6dd8742c2f'
'ce48f8e5065319e191a7389539ec663dc8a919d7'
'0c3900ffe21bfc3d96b80ade334613bc7e76fe27'
'aa3442d291bd77fefa3758291baa9c609a74e5dc'
'5543ea72a07fb6f3af19cfbb6d1683a5fddaa807'
'a87a6eb5cb86f63e39249c60eb53594ce225dea0'
'438fe443a74d4c8294c44ee23e877c878c98b6a9'
'84e6e4eb614e86baf1ee565da9c2ac505940492a'
'9037e982ea4ca7c1bab84c56ab112445d1ca52c9'
'a424c58cbcecf59510eccf28a083818c7ae63c60'
'5a38d441d73647b12e1e13416de3fde822dfed18'
'05072b88a7707abca65f84cc6d1c4985c6874f6f'
'32f81cc46daa00b645c991bf8aaf51e17c4a937a'
'69170917d207096e532f24a83a55dc9d53fa268e'
'88b724543c5482dc8f94f141e4b87704bf60fff9')