gtk/firefox-kde/PKGBUILD

241 lines
10 KiB
Bash
Raw Normal View History

2013-04-28 07:01:01 +08:00
# Contributor: Weng Xuetian <wengxt@gmail.com>
pkgname=firefox-kde
2015-01-28 00:03:24 +08:00
pkgver=35.0.1
pkgrel=1
2013-04-28 07:01:01 +08:00
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
2013-04-28 07:01:01 +08:00
arch=('x86_64')
2014-07-31 06:32:42 +08:00
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'
2014-07-31 06:32:42 +08:00
'cmake' 'automoc4')
optdepends=('networkmanager: Location detection via available WiFi networks'
2014-07-31 06:32:42 +08:00
'gst-plugins-good: h.264 video'
'gst-libav: h.264 video'
'firefox-i18n: for multilanguage support'
'kdelibs: for KDE integration')
2013-04-28 07:01:01 +08:00
screenshot="http://img864.imageshack.us/img864/5116/firefoxm.png"
provides=("firefox=${pkgver}" "kmozillahelper=${_kmozillahelper_pkgver}")
conflicts=('firefox' 'kmozillahelper')
replaces=('kmozillahelper')
2013-04-28 07:01:01 +08:00
install=firefox.install
2013-05-07 05:00:15 +08:00
#
# 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.
#
2015-01-28 00:03:24 +08:00
_patchrev=3caf8b25f146
2014-02-15 01:38:57 +08:00
_patchurl=http://www.rosenauer.org/hg/mozilla/raw-file/$_patchrev
2014-09-21 04:27:58 +08:00
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'
"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'
'rhbz-966424.patch'
# Firefox patchset
"$_patchurl/firefox-kde.patch"
2015-01-28 00:03:24 +08:00
# "$_patchurl/firefox-kde-114.patch"
2014-09-21 04:27:58 +08:00
"$_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'
2014-12-13 00:31:53 +08:00
'ddg-branding.patch'
2013-04-28 07:01:01 +08:00
)
2014-12-02 11:18:37 +08:00
sha256sums=('1680191ff7d4c465c0e6a5d7d6ff7a426f5bfa64f8d6d68a4bdfa9ac4ee459c8'
2014-09-21 04:27:58 +08:00
'a46781b46723376c7dde4648ac7d2a7ab64dedb5eee60d8c0d19af22d3b93efc'
'3e9fa54f334681d9e04907c1a5ae86a753c7b9902075519e31a011103c928ee8'
'1c77d74a93e66f49dae37f5217990d93930d515ea058c1e47ba671bba3564231'
'0850a8a8dea9003c67a8ee1fa5eb19a6599eaad9f2ad09db753b74dc5048fdbc'
'68e3a5b47c6d175cc95b98b069a15205f027cab83af9e075818d38610feb6213'
'121ed258879a8bb1617879866a86884618b8a6336a12ef9a837a440a4fc63ee5'
'ea7d67101abdd0a7fbbee5195d65d96d32c5c3975c5f5cf0d9a2c0b8df2cf891'
'746cb474c5a2c26fc474256e430e035e604b71b27df1003d4af85018fa263f4a'
2014-12-02 11:18:37 +08:00
'ff9e5cff0f755d2b279cea4cf1ca5e09d9bc0ea2e20244793add20744bb27171'
'8a4c5a2dd56a80ddb83ece96192e23c1b078dd1a0672b6fd408ae37d1c6712f5'
2014-10-14 22:32:53 +08:00
'4b4359947813234af46bf1fdc98a85a3f9b78483d5c4dbd840ac783d2fa9182f'
'9e67a4505deaefca2be253cd4f77f6089af76edd9507c1d54a1570cd51415b39'
2014-09-21 04:27:58 +08:00
'e8289ea4c1f8191e1e23661312ceee2128b8e790501b9a589d0d7bfc4384553f'
'5f6b0970284d68d5ed18e6bb7ee1e9fc0025ab3c10aaa14c283adb21a4a20ee8'
2014-12-02 11:18:37 +08:00
'6f93cb83a87c245ec2a8b09ed56a6abbcbe388a9ea961b50e2d84d307b71a344'
'b9feb66a33dc1644d7d277dc3fc166c655735de7100bc4e93f1fe44567f35345'
2014-12-13 00:31:53 +08:00
'd79923725b2454cbf8da63a3f2eb7e48ace0d100f39ec821d59b8eacbbf8155c'
'82c5f83f7e99fd3be6ec9750a3bef8b7826f08b523dab138f8742ea8b60e2749')
2013-05-07 05:18:59 +08:00
2014-02-15 01:38:57 +08:00
# 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() {
2014-07-31 06:32:42 +08:00
cd mozilla-release
cp ../mozconfig .mozconfig
patch -Np1 -i ../firefox-install-dir.patch
2014-09-14 08:08:19 +08:00
# https://bugs.archlinux.org/task/41689
2014-09-09 00:08:21 +08:00
patch -Np1 -i ../rhbz-966424.patch
2013-04-28 07:01:01 +08:00
2014-02-15 01:38:57 +08:00
echo -n "$_google_api_key" > google-api-key
2014-07-31 06:32:42 +08:00
echo "ac_add_options --with-google-api-keyfile=\"$PWD/google-api-key\"" >>.mozconfig
# make makepkg -R easier
2014-02-15 01:38:57 +08:00
msg "Patching for KDE"
rm -f content/media/gstreamer/nsGStreamerFormatHelper.{h,cpp}
2014-12-02 11:18:37 +08:00
rm -f browser/components/shell/{nsKDEShellService,nsUnixShellService}.{h,cpp}
2014-02-15 01:38:57 +08:00
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"
2015-01-28 00:03:24 +08:00
# patch -Np1 -i "$srcdir/firefox-kde-114.patch"
2014-02-15 01:38:57 +08:00
patch -Np1 -i "$srcdir/firefox-no-default-ualocale.patch"
patch -Np1 -i "$srcdir/firefox-branded-icons.patch"
2014-06-11 06:05:32 +08:00
patch -Np0 -i "$srcdir/install-kde-js.patch"
2014-12-13 00:31:53 +08:00
patch -Np1 -i "$srcdir/ddg-branding.patch"
2014-06-11 06:05:32 +08:00
cp "$srcdir/kde.js" browser/app/profile/
2014-02-15 01:38:57 +08:00
2014-09-14 08:08:19 +08:00
mkdir -p "$srcdir/path"
2013-04-28 07:01:01 +08:00
# WebRTC build tries to execute "python" and expects Python 2
ln -sf /usr/bin/python2 "$srcdir/path/python"
2013-04-28 07:01:01 +08:00
2014-09-14 08:08:19 +08:00
# Use gold, as Mozilla can use some of its features, such as safe ICF
#ln -s /usr/bin/ld.gold "$srcdir/path/ld"
# configure script misdetects the preprocessor without an optimization level
# https://bugs.archlinux.org/task/34644
sed -i '/ac_cpp=/s/$CPPFLAGS/& -O2/' configure
# Fix tab loading icon (flickers with libpng 1.6)
# https://bugzilla.mozilla.org/show_bug.cgi?id=841734
2014-09-14 08:08:19 +08:00
# TODO: Remove this; Firefox 34 might use CSS animations for the loading icon
2014-07-31 06:32:42 +08:00
# https://bugzilla.mozilla.org/show_bug.cgi?id=759252
cp "$srcdir/firefox-20.0.1-fixed-loading-icon.png" \
2014-07-31 06:32:42 +08:00
browser/themes/linux/tabbrowser/loading.png
}
build() {
2014-02-15 01:38:57 +08:00
msg "build_kmozillahelper"
build_kmozillahelper
msg "build_firefox"
build_firefox
}
build_kmozillahelper() {
2014-02-15 01:38:57 +08:00
cd $srcdir/
mkdir -p kmozillahelper-build
cd kmozillahelper-build
2014-02-15 01:38:57 +08:00
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=Release ../kmozillahelper
make
}
build_firefox() {
2014-02-15 01:38:57 +08:00
cd "$srcdir/mozilla-release"
2013-04-28 22:10:14 +08:00
export PATH="$srcdir/path:$PATH"
2014-02-15 01:38:57 +08:00
export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/lib/firefox"
2013-04-28 07:01:01 +08:00
export PYTHON="/usr/bin/python2"
2014-09-14 08:08:19 +08:00
# Do PGO
xvfb-run -a -s "-extension GLX -screen 0 1280x1024x24" \
make -f client.mk build MOZ_PGO=1
2013-04-28 07:01:01 +08:00
}
package() {
2014-02-15 01:38:57 +08:00
msg "package() kmozillahelper"
cd $srcdir/kmozillahelper-build
make DESTDIR=$pkgdir install
2013-04-28 22:10:14 +08:00
2014-02-15 01:38:57 +08:00
msg "package() Firefox"
cd "$srcdir/mozilla-release"
2014-06-13 08:28:45 +08:00
make -f client.mk DESTDIR="$pkgdir" MOZ_PKG_FATAL_WARNINGS=0 install
2013-04-28 22:10:14 +08:00
2014-06-11 07:06:10 +08:00
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"
2013-04-28 22:10:14 +08:00
for i in 16 22 24 32 48 256; do
install -Dm644 browser/branding/official/default$i.png \
2014-02-15 01:38:57 +08:00
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/firefox.png"
2013-04-28 22:10:14 +08:00
done
2014-07-31 06:32:42 +08:00
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"
2013-04-28 07:01:01 +08:00
2013-04-28 22:10:14 +08:00
install -Dm644 ../firefox.desktop \
2014-02-15 01:38:57 +08:00
"$pkgdir/usr/share/applications/firefox.desktop"
2014-07-31 06:32:42 +08:00
2013-04-28 07:01:01 +08:00
# Use system-provided dictionaries
2014-02-15 01:38:57 +08:00
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"
2014-07-31 06:32:42 +08:00
2014-02-15 01:38:57 +08:00
# 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"
2013-04-28 07:01:01 +08:00
}
2015-01-28 00:03:24 +08:00
sha256sums=('c92b34e08e39e2d482a61194e79255478331a54bf86bf144dc38f3d4bfbc507a'
'a46781b46723376c7dde4648ac7d2a7ab64dedb5eee60d8c0d19af22d3b93efc'
'3e9fa54f334681d9e04907c1a5ae86a753c7b9902075519e31a011103c928ee8'
'1c77d74a93e66f49dae37f5217990d93930d515ea058c1e47ba671bba3564231'
'0850a8a8dea9003c67a8ee1fa5eb19a6599eaad9f2ad09db753b74dc5048fdbc'
'68e3a5b47c6d175cc95b98b069a15205f027cab83af9e075818d38610feb6213'
'121ed258879a8bb1617879866a86884618b8a6336a12ef9a837a440a4fc63ee5'
'ea7d67101abdd0a7fbbee5195d65d96d32c5c3975c5f5cf0d9a2c0b8df2cf891'
'746cb474c5a2c26fc474256e430e035e604b71b27df1003d4af85018fa263f4a'
'f1f9bd347a7abacd0f11a6871b7510eefdcd4e06f0628cc163e79946de4f8933'
'a5f3a801478e73524a2ac12d376108cb330d5d74652f3466a679d54d3878902e'
'9e67a4505deaefca2be253cd4f77f6089af76edd9507c1d54a1570cd51415b39'
'e8289ea4c1f8191e1e23661312ceee2128b8e790501b9a589d0d7bfc4384553f'
'5f6b0970284d68d5ed18e6bb7ee1e9fc0025ab3c10aaa14c283adb21a4a20ee8'
'f8d475b3ea66d1872ca45b2be721d6a1e7fb714f06475ea5bbb1dc1c21d3655d'
'b9feb66a33dc1644d7d277dc3fc166c655735de7100bc4e93f1fe44567f35345'
'd79923725b2454cbf8da63a3f2eb7e48ace0d100f39ec821d59b8eacbbf8155c'
'82c5f83f7e99fd3be6ec9750a3bef8b7826f08b523dab138f8742ea8b60e2749')