gtk/firefox-kde/PKGBUILD

241 lines
8.8 KiB
Bash
Raw Normal View History

2013-04-28 07:01:01 +08:00
pkgname=firefox-kde
2017-05-06 21:25:42 +08:00
pkgver=53.0.2
pkgrel=1
2013-04-28 07:01:01 +08:00
pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE"
arch=('x86_64')
2014-07-31 06:32:42 +08:00
license=('MPL' 'GPL' 'LGPL')
url="https://www.mozilla.org/firefox/"
depends=(gtk3 mozilla-common libxt startup-notification mime-types dbus-glib alsa-lib ffmpeg
2017-03-18 02:50:05 +08:00
libvpx libevent nss hunspell
"sqlite3>=3.17.0" # icu>=58.1
kio knotifications kwindowsystem ki18n)
makedepends=(unzip zip diffutils python2 yasm mesa imake libpulse inetutils xorg-server-xvfb
autoconf2.13 cargo gtk2 gobject-introspection
2017-03-18 02:50:05 +08:00
cmake extra-cmake-modules)
optdepends=('networkmanager: Location detection via available WiFi networks'
2017-03-18 02:50:05 +08:00
'libnotify: Notification integration'
2016-08-04 03:12:57 +08:00
'upower: Battery API'
2015-11-05 11:56:26 +08:00
'firefox-i18n: for multilanguage support')
2017-03-29 00:34:27 +08:00
options=(!emptydirs)
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.
#
2017-04-30 22:55:22 +08:00
_patchrev=188c3f40f0da
_kmozillahelper_commit=21af64b
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'
2016-08-04 03:12:57 +08:00
'firefox-install-dir.patch'
2014-09-21 04:27:58 +08:00
'vendor.js'
'kde.js'
2015-05-14 00:57:11 +08:00
'pgo-fix-missing-kdejs.patch'
'fix-wifi-scanner.diff'
2017-04-30 22:55:22 +08:00
'mp4parse-cargo.patch::https://hg.mozilla.org/mozilla-central/raw-rev/acfa7cfcb32b'
2015-03-21 16:54:06 +08:00
2014-09-21 04:27:58 +08:00
# Firefox patchset
"$_patchurl/firefox-kde.patch"
2017-01-19 02:47:55 +08:00
"$_patchurl/firefox-branded-icons.patch"
"$_patchurl/firefox-no-default-ualocale.patch" # try to refer to chrome://global/locale/intl.properties(which is defined in language pack) for ua locale
2015-03-21 16:54:06 +08:00
2014-09-21 04:27:58 +08:00
# Gecko/toolkit patchset
"$_patchurl/mozilla-nongnome-proxies.patch"
"$_patchurl/mozilla-kde.patch"
2016-09-24 01:28:52 +08:00
'ddg-branding.patch'
"$_patchurl/mozilla-openaes-decl.patch"
2017-01-19 02:47:55 +08:00
"$_patchurl/mozilla-shared-nss-db.patch"
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"
2015-04-01 16:13:57 +08:00
#"$_patchurl/mozilla-bmo1088588.patch" # Specify for ARM and PPC
#"$_patchurl/toolkit-download-folder.patch"
#"$_patchurl/mozilla-language.patch" # making use of LANGUAGE= env var which isn't part of our standard
2016-09-24 01:28:52 +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
2013-04-28 07:01:01 +08:00
)
2017-05-06 21:25:42 +08:00
sha1sums=('5f3e78c6f3a19d1e0004a8a35b0b2e5959c6905b'
2015-12-17 03:03:17 +08:00
'SKIP'
2017-03-29 00:34:27 +08:00
'c87a74fb86990ba0860a6f5bd68c80d2d13a7a21'
'1a8ecc6d2cfd97791d8182882a74929f2a7289e9'
2016-08-04 03:12:57 +08:00
'693b54b9206ad854e4d75cbbf393029b77e82153'
2017-03-18 02:50:05 +08:00
'05b3a893e422ff579663c351f275f71010fa9dca'
2015-08-15 01:03:26 +08:00
'ce48f8e5065319e191a7389539ec663dc8a919d7'
2016-01-27 15:03:24 +08:00
'e480985ad1c4277e48a7d69c07258f0d7e97a977'
'9ed341bb7b147da7ebba420110dcf5a5a8e8d887'
2017-04-30 22:55:22 +08:00
'b28a856289a98d01dc3fb395ac321218151f6fc8'
2017-04-20 19:21:31 +08:00
'da3112c3587ad48e63e22e4772d8077e7eec1a05'
'7ea7b3b8d3bc0e91d73481ca24f8702bbe0fe8f7'
2017-01-24 06:02:04 +08:00
'dbfd269cbf88a4e1faea99bffc57ba26b8a0a7d9'
2015-08-15 01:03:26 +08:00
'5a38d441d73647b12e1e13416de3fde822dfed18'
2017-04-30 22:55:22 +08:00
'33624cd297b4abc98c4c8b930109f8ccd21403ab'
'9cf8c5a03bcc97b66d97d62d72c325ddb14102cb'
2017-01-26 09:21:53 +08:00
'5978fb0131d31b0e91459a90edc918f66eec3155'
'efd2e4fab5ea174f5f84db17265cd1d070e414c8')
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. Feel free to contact totte@chakralinux.org for
# more information.
_google_api_key=AIzaSyDjyg8EmaRUIsewzdjZXFZ0O8N5ARDUDGU
2014-02-15 01:38:57 +08:00
# Mozilla API keys (see https://location.services.mozilla.com/api)
# Note: These are for Chakra Linux use ONLY. For your own distribution, please
# get your own set of keys. Feel free to contact totte@chakralinux.org for
# more information.
_mozilla_api_key=bf05f841-e0bd-4644-81f5-3c132755f2e9
2017-03-18 02:50:05 +08:00
2014-02-15 01:38:57 +08:00
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://bugzilla.mozilla.org/show_bug.cgi?id=1314968
patch -Np1 -i ../fix-wifi-scanner.diff
2017-04-30 22:55:22 +08:00
# https://bugzilla.mozilla.org/show_bug.cgi?id=1338655 fixed in 54
patch -Np1 -i ../mp4parse-cargo.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
echo -n "$_mozilla_api_key" > mozilla-api-key
echo "ac_add_options --with-mozilla-api-keyfile=\"$PWD/mozilla-api-key\"" >>.mozconfig
2016-04-29 16:44:15 +08:00
2014-02-15 01:38:57 +08:00
msg "Gecko/toolkit patchset"
patch -Np1 -i "$srcdir/mozilla-nongnome-proxies.patch"
2016-04-29 16:44:15 +08:00
patch -Np1 -i "$srcdir/mozilla-kde.patch"
2017-01-19 02:47:55 +08:00
patch -Np1 -i "$srcdir/mozilla-shared-nss-db.patch"
2016-09-24 01:28:52 +08:00
patch -Np1 -i "$srcdir/mozilla-openaes-decl.patch"
2014-02-15 01:38:57 +08:00
msg "Firefox patchset"
patch -Np1 -i "$srcdir/firefox-kde.patch"
2017-01-19 02:47:55 +08:00
patch -Np1 -i "$srcdir/firefox-branded-icons.patch"
2015-11-05 11:56:26 +08:00
patch -Np1 -i "$srcdir/ddg-branding.patch"
patch -Np1 -i "$srcdir"/pgo-fix-missing-kdejs.patch
2017-01-19 02:47:55 +08:00
patch -Np1 -i "$srcdir/firefox-no-default-ualocale.patch"
2015-11-05 11:56:26 +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"
}
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}"
2016-08-04 03:12:57 +08:00
# _FORTIFY_SOURCE causes configure failures
CPPFLAGS+=" -O2"
# Hardening
LDFLAGS+=" -Wl,-z,now"
# GCC 6
# CXXFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2"
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
2017-03-18 02:50:05 +08:00
#xvfb-run -a -n 95 -s "-extension GLX -screen 0 1280x1024x24" \
# make -f client.mk build MOZ_PGO=1
make -f client.mk build
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
2017-04-20 19:21:31 +08:00
make -f client.mk DESTDIR="$pkgdir" MOZ_PKG_FATAL_WARNINGS=0 INSTALL_SDK= 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
2017-03-29 00:34:27 +08:00
_distini="$pkgdir/usr/lib/firefox/distribution/distribution.ini"
install -Dm644 /dev/stdin "$_distini" <<END
[Global]
id=chakralinux
version=1.0
about=Mozilla Firefox for Chakra GNU/Linux
[Preferences]
app.distributor=chakralinux
app.distributor.channel=${pkgname%-kde}
app.partner.chakralinux=chakralinux
END
2013-04-28 22:10:14 +08:00
for i in 16 22 24 32 48 256; do
2017-03-18 02:50:05 +08:00
install -Dm644 browser/branding/official/default$i.png \
"$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
2017-03-18 02:50:05 +08:00
# Use system-provided dictionaries
rm -r "$pkgdir"/usr/lib/firefox/dictionaries
ln -Ts /usr/share/hunspell "$pkgdir/usr/lib/firefox/dictionaries"
ln -Ts /usr/share/hyphen "$pkgdir/usr/lib/firefox/hyphenation"
# Install a wrapper to avoid confusion about binary path
install -Dm755 /dev/stdin "$pkgdir/usr/bin/firefox" <<END
#!/bin/sh
exec /usr/lib/firefox/firefox "\$@"
END
# Replace duplicate binary with wrapper
# https://bugzilla.mozilla.org/show_bug.cgi?id=658850
ln -srf "$pkgdir/usr/bin/firefox" \
"$pkgdir/usr/lib/firefox/firefox-bin"
2013-04-28 07:01:01 +08:00
}