gtk/firefox-kde/PKGBUILD
2014-07-30 22:32:42 +00:00

268 lines
10 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=31.0
pkgrel=2
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
arch=('x86_64')
license=('MPL' 'GPL' 'LGPL')
url="https://www.mozilla.org/firefox/"
depends=('gtk2' 'mozilla-common' 'libxt' 'startup-notification' 'mime-types'
'dbus-glib' 'alsa-lib' 'desktop-file-utils' 'hicolor-icon-theme'
'libvpx' 'icu' 'libevent' 'nss' 'hunspell' 'sqlite3'
'kdelibs')
makedepends=('unzip' 'zip' 'diffutils' 'python2' 'yasm' 'mesa' 'imake'
'xorg-server-xvfb' 'libpulse' 'gst-plugins-base'
'inetutils'
'cmake' 'automoc4')
optdepends=('networkmanager: Location detection via available WiFi networks'
'gst-plugins-good: h.264 video'
'gst-libav: h.264 video'
'firefox-i18n: for multilanguage support'
'kdelibs: for KDE integration')
screenshot="http://img864.imageshack.us/img864/5116/firefoxm.png"
provides=("firefox=${pkgver}" "kmozillahelper=${_kmozillahelper_pkgver}")
conflicts=('firefox' 'kmozillahelper')
replaces=('kmozillahelper')
install=firefox.install
#
# 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=5cbcc68b9429
_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 ../mozconfig .mozconfig
patch -Np1 -i ../firefox-install-dir.patch
echo -n "$_google_api_key" > google-api-key
echo "ac_add_options --with-google-api-keyfile=\"$PWD/google-api-key\"" >>.mozconfig
# 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
# TODO: Remove this; Firefox 32 will use CSS animations for the loading icon
# https://bugzilla.mozilla.org/show_bug.cgi?id=759252
cp "$srcdir/firefox-20.0.1-fixed-loading-icon.png" \
browser/themes/linux/tabbrowser/loading.png
}
build() {
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 browser/branding/official/content/icon64.png \
"$pkgdir/usr/share/icons/hicolor/64x64/apps/firefox.png"
install -Dm644 browser/branding/official/mozicon128.png \
"$pkgdir/usr/share/icons/hicolor/128x128/apps/firefox.png"
install -Dm644 browser/branding/official/content/about-logo.png \
"$pkgdir/usr/share/icons/hicolor/192x192/apps/firefox.png"
install -Dm644 browser/branding/official/content/about-logo@2x.png \
"$pkgdir/usr/share/icons/hicolor/384x384/apps/firefox.png"
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=('a6c3e25ee3aeb7da42db2aaeb50a385d63532beb'
'139e5a18c3fd49cdb7456fb4ea08312105274cd7'
'86d6c2fe4ec2b3072a132e2afbc0ac798fd51e8f'
'ca77a08b296f8673828898d91b20cc6dd8742c2f'
'ce48f8e5065319e191a7389539ec663dc8a919d7'
'0c3900ffe21bfc3d96b80ade334613bc7e76fe27'
'e5c91178bc58f2ddc21bd1e4f35837d670d6a0c2'
'5543ea72a07fb6f3af19cfbb6d1683a5fddaa807'
'a87a6eb5cb86f63e39249c60eb53594ce225dea0'
'2473b53108fe13b6e8242d02e41409e9a9d9e9c8'
'84e6e4eb614e86baf1ee565da9c2ac505940492a'
'9037e982ea4ca7c1bab84c56ab112445d1ca52c9'
'96fe862a28c5e614462df1f6b7ed88feb8c3820f'
'5a38d441d73647b12e1e13416de3fde822dfed18'
'05072b88a7707abca65f84cc6d1c4985c6874f6f'
'5f3a1c2ba4ffc3079b916af09e25a237244784c2'
'69170917d207096e532f24a83a55dc9d53fa268e'
'88b724543c5482dc8f94f141e4b87704bf60fff9')
sha1sums=('a6c3e25ee3aeb7da42db2aaeb50a385d63532beb'
'72665d2fb4c3977766c4f5df22ad90817ef8bf57'
'86d6c2fe4ec2b3072a132e2afbc0ac798fd51e8f'
'ca77a08b296f8673828898d91b20cc6dd8742c2f'
'ce48f8e5065319e191a7389539ec663dc8a919d7'
'0c3900ffe21bfc3d96b80ade334613bc7e76fe27'
'e5c91178bc58f2ddc21bd1e4f35837d670d6a0c2'
'5543ea72a07fb6f3af19cfbb6d1683a5fddaa807'
'a87a6eb5cb86f63e39249c60eb53594ce225dea0'
'2473b53108fe13b6e8242d02e41409e9a9d9e9c8'
'84e6e4eb614e86baf1ee565da9c2ac505940492a'
'9037e982ea4ca7c1bab84c56ab112445d1ca52c9'
'96fe862a28c5e614462df1f6b7ed88feb8c3820f'
'5a38d441d73647b12e1e13416de3fde822dfed18'
'05072b88a7707abca65f84cc6d1c4985c6874f6f'
'5f3a1c2ba4ffc3079b916af09e25a237244784c2'
'69170917d207096e532f24a83a55dc9d53fa268e'
'88b724543c5482dc8f94f141e4b87704bf60fff9')
sha1sums=('a6c3e25ee3aeb7da42db2aaeb50a385d63532beb'
'466e1de3c8419ca3f001f66bf526f2aa7f963900'
'86d6c2fe4ec2b3072a132e2afbc0ac798fd51e8f'
'ca77a08b296f8673828898d91b20cc6dd8742c2f'
'ce48f8e5065319e191a7389539ec663dc8a919d7'
'0c3900ffe21bfc3d96b80ade334613bc7e76fe27'
'e5c91178bc58f2ddc21bd1e4f35837d670d6a0c2'
'5543ea72a07fb6f3af19cfbb6d1683a5fddaa807'
'a87a6eb5cb86f63e39249c60eb53594ce225dea0'
'2473b53108fe13b6e8242d02e41409e9a9d9e9c8'
'84e6e4eb614e86baf1ee565da9c2ac505940492a'
'9037e982ea4ca7c1bab84c56ab112445d1ca52c9'
'96fe862a28c5e614462df1f6b7ed88feb8c3820f'
'5a38d441d73647b12e1e13416de3fde822dfed18'
'05072b88a7707abca65f84cc6d1c4985c6874f6f'
'5f3a1c2ba4ffc3079b916af09e25a237244784c2'
'69170917d207096e532f24a83a55dc9d53fa268e'
'88b724543c5482dc8f94f141e4b87704bf60fff9')