mirror of
https://gitdl.cn/https://github.com/chakralinux/gtk.git
synced 2025-01-24 18:12:13 +08:00
250 lines
9.5 KiB
Bash
250 lines
9.5 KiB
Bash
pkgname=firefox-kde
|
|
pkgver=49.0.1
|
|
pkgrel=6
|
|
pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE"
|
|
_kmozillahelper_commit=0219317ccd59d0fb8dc3d39ca351234c7ca7499e
|
|
arch=('x86_64')
|
|
license=('MPL' 'GPL' 'LGPL')
|
|
url="https://www.mozilla.org/firefox/"
|
|
depends=('gtk2' 'gtk3' 'mozilla-common' 'libxt' 'startup-notification' 'mime-types'
|
|
'dbus-glib' 'alsa-lib' 'ffmpeg' 'libvpx' 'libevent' 'nss' 'hunspell'
|
|
'sqlite3>=3.8.9' 'icu'
|
|
'kio' 'knotifications' 'nspr>=4.10.10' 'libffi>=3.0.9' 'kwindowsystem' 'ki18n')
|
|
makedepends=('unzip' 'zip' 'diffutils' 'python2' 'yasm' 'mesa' 'imake'
|
|
'libpulse' 'inetutils' 'xorg-server-xvfb' 'autoconf2.13' 'rust'
|
|
'cmake' 'extra-cmake-modules')
|
|
optdepends=('networkmanager: Location detection via available WiFi networks'
|
|
'upower: Battery API'
|
|
'firefox-i18n: for multilanguage support')
|
|
screenshot="http://img864.imageshack.us/img864/5116/firefoxm.png"
|
|
provides=("firefox=${pkgver}" "kmozillahelper")
|
|
conflicts=('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=9fc2ebe6d7f1
|
|
_patchurl=http://www.rosenauer.org/hg/mozilla/raw-file/$_patchrev
|
|
source=("https://download-installer.cdn.mozilla.net/pub/firefox/releases/${pkgver}/source/firefox-${pkgver}.source.tar.xz"
|
|
"git://github.com/openSUSE/kmozillahelper#commit=${_kmozillahelper_commit}"
|
|
'mozconfig'
|
|
'firefox.desktop'
|
|
'firefox-install-dir.patch'
|
|
'vendor.js'
|
|
'kde.js'
|
|
'pgo-fix-missing-kdejs.patch'
|
|
'firefox-44.0-pgo.patch'
|
|
|
|
# Firefox patchset
|
|
"$_patchurl/firefox-kde.patch"
|
|
"$_patchurl/firefox-branded-icons.patch"
|
|
"$_patchurl/firefox-no-default-ualocale.patch"
|
|
|
|
# Gecko/toolkit patchset
|
|
"$_patchurl/mozilla-nongnome-proxies.patch"
|
|
"$_patchurl/mozilla-kde.patch"
|
|
'ddg-branding.patch'
|
|
"$_patchurl/mozilla-flex_buffer_overrun.patch"
|
|
"$_patchurl/mozilla-openaes-decl.patch"
|
|
"$_patchurl/mozilla-preferences.patch"
|
|
"$_patchurl/mozilla-shared-nss-db.patch"
|
|
"$_patchurl/mozilla-skia-overflow.patch"
|
|
|
|
# mozilla-central theme fix
|
|
tip.tar.gz::'http://hg.mozilla.org/mozilla-central/archive/tip.tar.gz/toolkit/themes/'
|
|
|
|
# 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"
|
|
#"$_patchurl/mozilla-bmo1088588.patch" # Specify for ARM and PPC
|
|
#"$_patchurl/toolkit-download-folder.patch"
|
|
#"$_patchurl/mozilla-language.patch"
|
|
#"$_patchurl/mozilla-preferences.patch"
|
|
#"$_patchurl/firefox-no-default-ualocale.patch"
|
|
#"$_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
|
|
)
|
|
sha1sums=('1e267ca9b6b0d19a7b6e0acfbf11e545d55eb830'
|
|
'SKIP'
|
|
'2fc7e894d7399a9bec19367d963bad47a1a250b8'
|
|
'86d6c2fe4ec2b3072a132e2afbc0ac798fd51e8f'
|
|
'693b54b9206ad854e4d75cbbf393029b77e82153'
|
|
'b871102748f98865c4cf6a757e267419ab0e44b1'
|
|
'ce48f8e5065319e191a7389539ec663dc8a919d7'
|
|
'e480985ad1c4277e48a7d69c07258f0d7e97a977'
|
|
'3b7673f241f3ae1af48be4457a936ae6458266b7'
|
|
'5ea4bc9e5b7608c24daa2f2a5093d9032b26d63f'
|
|
'255d7465aa5ace5efb4f4cde14fa631872447aa3'
|
|
'dbfd269cbf88a4e1faea99bffc57ba26b8a0a7d9'
|
|
'5a38d441d73647b12e1e13416de3fde822dfed18'
|
|
'53c4584cdf44c85a7bd996b7b0b32546bef4d602'
|
|
'f3b41a0a771d2a94997b953cb3204c688d89afc4'
|
|
'b4b5a4c120d65b7743f732519b70fbc35a63b352'
|
|
'9bb77ff9821061d8c2dd6e18ce1998d9681c2297'
|
|
'bcf0f111eadcf4e7d3316659af2f210c583ad9ff'
|
|
'dd5c8303937b5430149c3fd3d7d520e92d9e7969'
|
|
'b6ee769618637eae4c202daf2762c14ba4ca05c7'
|
|
'a057acaf88b7754470a7d5363f635b28b86fa06e')
|
|
|
|
|
|
# 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
|
|
|
|
# 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
|
|
|
|
prepare() {
|
|
cd ${srcdir}/firefox-${pkgver}/
|
|
|
|
cp ../mozconfig .mozconfig
|
|
patch -Np1 -i ../firefox-install-dir.patch
|
|
|
|
# https://bugs.archlinux.org/task/41689
|
|
#patch -Np1 -i ../rhbz-966424.patch
|
|
|
|
echo -n "$_google_api_key" > google-api-key
|
|
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
|
|
|
|
patch -Np0 -i ../firefox-44.0-pgo.patch
|
|
|
|
# make makepkg -R easier
|
|
msg "Patching for KDE"
|
|
rm -f content/media/gstreamer/nsGStreamerFormatHelper.{h,cpp}
|
|
rm -f browser/components/shell/{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/mozilla-nongnome-proxies.patch"
|
|
patch -Np1 -i "$srcdir/mozilla-kde.patch"
|
|
patch -Np1 -i "$srcdir/mozilla-shared-nss-db.patch"
|
|
patch -Np1 -i "$srcdir/mozilla-preferences.patch"
|
|
patch -Np1 -i "$srcdir/mozilla-flex_buffer_overrun.patch"
|
|
patch -Np1 -i "$srcdir/mozilla-skia-overflow.patch"
|
|
patch -Np1 -i "$srcdir/mozilla-openaes-decl.patch"
|
|
|
|
msg "Firefox patchset"
|
|
patch -Np1 -i "$srcdir/firefox-kde.patch"
|
|
patch -Np1 -i "$srcdir/firefox-branded-icons.patch"
|
|
patch -Np1 -i "$srcdir/ddg-branding.patch"
|
|
patch -Np1 -i "$srcdir"/pgo-fix-missing-kdejs.patch
|
|
patch -Np1 -i "$srcdir/firefox-no-default-ualocale.patch"
|
|
|
|
mkdir -vp "$srcdir/path"
|
|
|
|
# WebRTC build tries to execute "python" and expects Python 2
|
|
ln -sf /usr/bin/python2 "$srcdir/path/python"
|
|
|
|
# fix GTK3
|
|
sed -i 's|parent->group|gtk_window_get_group(const_cast<GtkWindow*>(parent))|g' toolkit/xre/nsKDEUtils.cpp
|
|
|
|
# Fix tab loading icon (doesn't work with libpng 1.6)
|
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=841734
|
|
rm -rf toolkit/themes
|
|
cp -r ${srcdir}/mozilla-central-c55bcb7c777e/toolkit/themes toolkit/
|
|
}
|
|
|
|
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=/usr -DCMAKE_BUILD_TYPE=Release ../kmozillahelper
|
|
make
|
|
}
|
|
|
|
build_firefox() {
|
|
cd "$srcdir/firefox-${pkgver}"
|
|
|
|
# _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"
|
|
|
|
export PATH="$srcdir/path:$PATH"
|
|
export PYTHON="/usr/bin/python2"
|
|
export SHELL=/bin/bash
|
|
|
|
# Do PGO
|
|
xvfb-run -a -s "-extension GLX -screen 0 1280x1024x24" \
|
|
make -f client.mk build MOZ_PGO=1
|
|
#make -f client.mk build
|
|
}
|
|
|
|
package() {
|
|
msg "package() kmozillahelper"
|
|
cd $srcdir/kmozillahelper-build
|
|
make DESTDIR=$pkgdir install
|
|
|
|
msg "package() Firefox"
|
|
cd "$srcdir/firefox-${pkgver}"
|
|
|
|
export SHELL=/bin/bash
|
|
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"
|
|
|
|
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"
|
|
}
|