gtk/firefox-kde/PKGBUILD

237 lines
8.7 KiB
Bash
Raw Normal View History

2013-04-28 07:01:01 +08:00
pkgname=firefox-kde
2015-12-16 02:26:55 +08:00
pkgver=43.0
2015-12-17 15:38:50 +08:00
pkgrel=5
2013-04-28 07:01:01 +08:00
pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE"
2015-12-17 03:03:17 +08:00
_kmozillahelper_commit=83cd08e0c917fda16b30d91f929779304c46d273
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/"
2015-12-17 15:38:50 +08:00
depends=('gtk3' 'gtk2' 'mozilla-common' 'libxt' 'startup-notification' 'mime-types'
2014-07-31 06:32:42 +08:00
'dbus-glib' 'alsa-lib' 'desktop-file-utils' 'hicolor-icon-theme'
2015-11-05 11:56:26 +08:00
'libvpx' 'icu' 'libevent' 'nss>=3.19.4' 'hunspell' 'sqlite3>=3.8.9'
'kio' 'knotifications' 'nspr>=4.10.10' 'libffi>=3.0.9')
2014-07-31 06:32:42 +08:00
makedepends=('unzip' 'zip' 'diffutils' 'python2' 'yasm' 'mesa' 'imake'
2015-12-16 11:17:32 +08:00
'xorg-server-xvfb' 'libpulse' 'ffmpeg'
2015-04-01 16:56:53 +08:00
'inetutils' 'libpng>=1.6.16'
'cmake' 'extra-cmake-modules' 'clang')
optdepends=('networkmanager: Location detection via available WiFi networks'
2015-11-05 11:56:26 +08:00
'firefox-i18n: for multilanguage support')
2013-04-28 07:01:01 +08:00
screenshot="http://img864.imageshack.us/img864/5116/firefoxm.png"
2015-12-17 03:03:17 +08:00
provides=("firefox=${pkgver}" "kmozillahelper")
2015-12-17 09:13:46 +08:00
conflicts=('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-12-16 02:26:55 +08:00
_patchrev=de3a92aed259
2014-02-15 01:38:57 +08:00
_patchurl=http://www.rosenauer.org/hg/mozilla/raw-file/$_patchrev
2015-09-24 22:24:10 +08:00
source=("https://download-installer.cdn.mozilla.net/pub/firefox/releases/${pkgver}/source/firefox-${pkgver}.source.tar.xz"
2015-12-17 03:03:17 +08:00
"git://github.com/openSUSE/kmozillahelper#commit=${_kmozillahelper_commit}"
2014-09-21 04:27:58 +08:00
'mozconfig'
'firefox.desktop'
'vendor.js'
'kde.js'
2015-03-17 10:18:43 +08:00
'firefox-20.0.1-fixed-loading-icon.png'
2015-11-08 18:42:22 +08:00
# The KMozillaHelper unofficial Kf5 Port
2014-09-21 04:27:58 +08:00
'firefox-install-dir.patch'
'rhbz-966424.patch'
2015-05-14 00:57:11 +08:00
'pgo-fix-missing-kdejs.patch'
2015-03-21 16:54:06 +08:00
2014-09-21 04:27:58 +08:00
# Firefox patchset
"$_patchurl/firefox-kde.patch"
"$_patchurl/firefox-branded-icons.patch"
2015-03-21 16:54:06 +08:00
2014-09-21 04:27:58 +08:00
# Gecko/toolkit patchset
"$_patchurl/mozilla-nongnome-proxies.patch"
2015-07-05 03:01:01 +08:00
# "$_patchurl/mozilla-prefer_plugin_pref.patch" removed from opensuse. reason: dropped mozilla-prefer_plugin_pref.patch as this feature is likely not worth maintaining further
2014-09-21 04:27:58 +08:00
"$_patchurl/mozilla-kde.patch"
2015-03-06 22:32:56 +08:00
"$_patchurl/mozilla-preferences.patch"
"$_patchurl/mozilla-pkgconfig.patch"
2015-05-13 10:32:45 +08:00
#'install-kde-js.patch'
2014-12-13 00:31:53 +08:00
'ddg-branding.patch'
2015-03-06 22:32:56 +08:00
2015-11-05 11:56:26 +08:00
# GTK3 patchset
# 'firefox-build.patch'
# 'mozilla-1192243.patch'
# 'xulrunner-24.0-jemalloc-ppc.patch'
# 'xulrunner-24.0-s390-inlines.patch'
2015-11-08 18:42:22 +08:00
# FIXME: This is not working! THANKS! FEDORA!
2015-11-05 11:56:26 +08:00
2015-03-06 22:32:56 +08:00
# Useless patchset
#"$_patchurl/gecko-lockdown.patch"
#"$_patchurl/mozilla-idldir.patch"
#$_patchurl/firefox-ui-lockdown.patch
#"$_patchurl/toolkit-ui-lockdown.patch"
#"$_patchurl/mozilla-shared-nss-db.patch"
2015-04-01 16:13:57 +08:00
#"$_patchurl/mozilla-bmo1088588.patch" # Specify for ARM and PPC
#"$_patchurl/toolkit-download-folder.patch"
2015-05-17 21:43:49 +08:00
#"$_patchurl/mozilla-language.patch"
#"$_patchurl/firefox-no-default-ualocale.patch"
2013-04-28 07:01:01 +08:00
)
2015-12-16 02:26:55 +08:00
sha1sums=('65913f9dd61b49b341a66a514c9cac23b602c7c8'
2015-12-17 03:03:17 +08:00
'SKIP'
2015-12-17 15:38:50 +08:00
'2dc77dc4096c69e178ac79ea86f8cf184dc40932'
2015-08-15 01:03:26 +08:00
'86d6c2fe4ec2b3072a132e2afbc0ac798fd51e8f'
'ca77a08b296f8673828898d91b20cc6dd8742c2f'
'ce48f8e5065319e191a7389539ec663dc8a919d7'
'0c3900ffe21bfc3d96b80ade334613bc7e76fe27'
'a87a6eb5cb86f63e39249c60eb53594ce225dea0'
'ad1f05abf477dbc5f7e72c06e37c180459eeffd4'
'6991d61be593b5ad109174ebc7d60763eb48125b'
2015-12-16 02:26:55 +08:00
'6c026263dd9d4dfc2f5bbd0b5fafb176acabeee4'
2015-08-15 01:03:26 +08:00
'b7fa502cf654f9b2d12e89e5a17ae4af90090cc6'
'5a38d441d73647b12e1e13416de3fde822dfed18'
2015-12-16 02:26:55 +08:00
'6e5badf838c7483a2dd3b58eb5dccf043c36b2ec'
2015-09-24 22:24:10 +08:00
'bcf0f111eadcf4e7d3316659af2f210c583ad9ff'
2015-08-15 01:03:26 +08:00
'ebd57f47a4a8a156afc8ad32eeceac78162da548'
2015-11-25 17:33:44 +08:00
'a169730cda326effbf54e59e9adb9d595f36be41')
2015-04-23 04:35:46 +08:00
2015-07-05 03:01:01 +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() {
2015-11-05 00:31:59 +08:00
cd ${srcdir}/firefox-${pkgver}/
2014-07-31 06:32:42 +08:00
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/mozilla-nongnome-proxies.patch"
patch -Np1 -i "$srcdir/mozilla-kde.patch"
msg "Firefox patchset"
patch -Np1 -i "$srcdir/firefox-kde.patch"
2015-11-05 11:56:26 +08:00
patch -Np1 -i "$srcdir/firefox-branded-icons.patch"
patch -Np1 -i "$srcdir/ddg-branding.patch"
patch -Np1 -i "$srcdir"/pgo-fix-missing-kdejs.patch
2015-12-17 15:38:50 +08:00
# fix GTK3
sed -i 's|parent->group|gtk_window_get_group(const_cast<GtkWindow*>(parent))|g' toolkit/xre/nsKDEUtils.cpp
2015-11-05 11:56:26 +08:00
# msg "GTK3 patchset"
# patch -p2 -i ../firefox-build.patch
# patch -p2 -i ../xulrunner-24.0-jemalloc-ppc.patch
# patch -p2 -i ../xulrunner-24.0-s390-inlines.patch
# patch -p1 -i ../mozilla-1192243.patch
2014-02-15 01:38:57 +08:00
2015-03-06 22:32:56 +08:00
mkdir -vp "$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
2015-12-17 15:38:50 +08:00
# Fix tab loading icon (doesn't work with libpng 1.6)
# https://bugzilla.mozilla.org/show_bug.cgi?id=841734
2015-03-17 10:18:43 +08:00
cp "$srcdir/firefox-20.0.1-fixed-loading-icon.png" \
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
2015-12-17 03:03:17 +08:00
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ../kmozillahelper
2014-02-15 01:38:57 +08:00
make
}
build_firefox() {
2015-11-05 00:31:59 +08:00
cd "$srcdir/firefox-${pkgver}"
2013-04-28 22:10:14 +08:00
export PATH="$srcdir/path:$PATH"
2013-04-28 07:01:01 +08:00
export PYTHON="/usr/bin/python2"
2015-05-13 10:32:45 +08:00
export SHELL=/bin/bash
2013-04-28 07:01:01 +08:00
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"
2015-11-05 00:31:59 +08:00
cd "$srcdir/firefox-${pkgver}"
2014-06-13 08:28:45 +08:00
2015-12-17 15:38:50 +08:00
export SHELL=/bin/bash
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}
2015-12-17 15:38:50 +08:00
2014-02-15 01:38:57 +08:00
#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
}