gtk/firefox-kde/PKGBUILD

184 lines
6.6 KiB
Bash
Raw Normal View History

2013-04-28 07:01:01 +08:00
# Contributor: Weng Xuetian <wengxt@gmail.com>
pkgname=firefox-kde
pkgver=23.0.1
2013-05-18 20:50:01 +08:00
pkgrel=2
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
url='http://www.mozilla.org/projects/firefox'
arch=('x86_64')
license=('MPL' 'GPL' 'LGPL')
2013-05-15 20:07:28 +08:00
depends=('gtk2' 'startup-notification' 'libnotify' 'alsa-lib' 'gstreamer0.10' 'gstreamer0.10-base' 'libxt' 'dbus-glib' 'libevent' 'filesystem-extra' 'kdelibs')
makedepends=('zip' 'pkg-config' 'diffutils' 'python2' 'wireless_tools' 'unzip' 'autoconf2.13' 'mesa' 'yasm' 'cmake' 'automoc4' 'libpulse')
optdepends=('networkmanager: Location detection via available WiFi networks'
'libpulse: PulseAudio audio driver')
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
url="http://www.mozilla.org/projects/firefox"
optdepends=('firefox-i18n: for multilanguage support')
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.
#
2013-04-28 07:01:01 +08:00
source=(ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${pkgver}/source/firefox-${pkgver}.source.tar.bz2
mozconfig
firefox.desktop
firefox-install-dir.patch
vendor.js
kde.js
firefox-kde.patch
mozilla-nongnome-proxies.patch
mozilla-kde.patch
firefox-20.0.1-fixed-loading-icon.png
2013-04-28 07:01:01 +08:00
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}"
2013-05-07 05:18:59 +08:00
move-to-extra.patch
2013-04-28 07:01:01 +08:00
)
2013-05-07 05:18:59 +08:00
_prepare() {
pushd .
2013-04-28 07:01:01 +08:00
cd "mozilla-release"
cp "../mozconfig" .mozconfig
# make makepkg -R easier
2013-04-28 07:01:01 +08:00
rm -f browser/components/shell/src/nsKDEShellService.cpp \
browser/components/shell/src/nsKDEShellService.h \
browser/components/shell/src/nsUnixShellService.cpp \
browser/components/shell/src/nsUnixShellService.h \
browser/base/content/browser-kde.xul
rm -f toolkit/xre/nsKDEUtils.cpp \
toolkit/xre/nsKDEUtils.h \
uriloader/exthandler/unix/nsCommonRegistry.cpp \
uriloader/exthandler/unix/nsCommonRegistry.h \
uriloader/exthandler/unix/nsKDERegistry.cpp \
uriloader/exthandler/unix/nsKDERegistry.h \
toolkit/content/widgets/dialog-kde.xml \
toolkit/content/widgets/preferences-kde.xml
patch -Np1 -i "../firefox-install-dir.patch"
# modify the patch to make it under extra
cp ../mozilla-kde.patch ../mozilla-kde-mod.patch
sed -i 's|\(\+\#define KMOZILLAHELPER "\)\(/usr/lib/mozilla/kmozillahelper"\)|\1/extra\2|' ../mozilla-kde-mod.patch
2013-04-28 07:01:01 +08:00
msg "apply mozilla-nongnome-proxies.patch"
patch -Np1 -i "../mozilla-nongnome-proxies.patch" || return 1
msg "apply mozilla-kde-mod.patch"
patch -Np1 -i "../mozilla-kde-mod.patch" || return 1
2013-04-28 07:01:01 +08:00
msg "apply firefox-kde.patch"
patch -Np1 -i "../firefox-kde.patch" || return 1
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
# Fix PRE_RELEASE_SUFFIX
sed -i '/^PRE_RELEASE_SUFFIX := ""/s/ ""//' \
browser/base/Makefile.in
# Fix tab loading icon (flickers with libpng 1.6)
# https://bugzilla.mozilla.org/show_bug.cgi?id=841734
cp "$srcdir/firefox-20.0.1-fixed-loading-icon.png" \
browser/themes/linux/tabbrowser/loading.png
popd
pushd .
cd kmozillahelper
patch -Np1 -i ../move-to-extra.patch || return 1
popd
}
build() {
_prepare
pushd .
build_kmozillahelper
popd
pushd .
build_firefox
popd
}
build_kmozillahelper() {
mkdir -p kmozillahelper-build
cd kmozillahelper-build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=Release ../kmozillahelper
make || return 1
}
build_firefox() {
cd "mozilla-release"
2013-04-28 22:10:14 +08:00
export PATH="$srcdir/path:$PATH"
export LDFLAGS="$LDFLAGS -Wl,-rpath,/extra/usr/lib/firefox"
2013-04-28 07:01:01 +08:00
export PYTHON="/usr/bin/python2"
make -j1 -f client.mk build MOZ_MAKE_FLAGS="${MAKEFLAGS}"
}
package() {
pushd .
cd $srcdir/kmozillahelper-build
make DESTDIR=$pkgdir install
popd
2013-04-28 22:10:14 +08:00
2013-04-28 07:01:01 +08:00
cd mozilla-release
2013-05-15 20:07:28 +08:00
install -Dm644 ../kde.js "obj-ff/dist/bin/defaults/pref/kde.js"
2013-04-28 07:01:01 +08:00
make -j1 -f client.mk MOZ_PKG_FATAL_WARNINGS=0 package
2013-04-28 22:10:14 +08:00
#make -j1 -f client.mk DESTDIR="$pkgdir" install
mkdir -p $pkgdir/extra/usr/lib/
tar -C $pkgdir/extra/usr/lib/ -xf obj-ff/dist/firefox-$pkgver.en-US.linux-${CARCH}.tar.bz2
install -Dm644 ../vendor.js "$pkgdir/extra/usr/lib/firefox/defaults/preferences/vendor.js"
install -Dm644 ../kde.js "$pkgdir/extra/usr/lib/firefox/defaults/preferences/kde.js"
install -Dm644 ../duckduckgo.xml "$pkgdir/extra/usr/lib/firefox/searchplugins/duckduckgo.xml"
for i in 16 22 24 32 48 256; do
install -Dm644 browser/branding/official/default$i.png \
"$pkgdir/extra/usr/share/icons/hicolor/${i}x${i}/apps/firefox.png"
done
2013-04-28 07:01:01 +08:00
2013-04-28 22:10:14 +08:00
install -Dm644 ../firefox.desktop \
"$pkgdir/extra/usr/share/applications/firefox.desktop"
mkdir -p $pkgdir/extra/usr/bin/
ln -sf /extra/usr/lib/firefox/firefox $pkgdir/extra/usr/bin/
2013-04-28 07:01:01 +08:00
# Use system-provided dictionaries
2013-04-28 22:10:14 +08:00
rm -rf "$pkgdir"/extra/usr/lib/firefox/{dictionaries,hyphenation}
ln -s /usr/share/hunspell "$pkgdir/extra/usr/lib/firefox/dictionaries"
ln -s /usr/share/hyphen "$pkgdir/extra/usr/lib/firefox/hyphenation"
2013-04-28 07:01:01 +08:00
}
sha1sums=('937bcd41aa316afff60b04fa4813f59bb9608631'
'1ab24e03f04c8641c7bba1ace285b9db98feed23'
'5c54c004a5f6bcf22d1ff0fdc33765c45517288a'
'28e6c025e1bfa0784648fcf3876c1ffc7a79aeec'
'e0f399de01da908f474c237bc6c5a15678cd8fcd'
'ce48f8e5065319e191a7389539ec663dc8a919d7'
'b5dd0532eea8d4d14f79c44778792d46b7902bd0'
'ec793946d5ae5a3e4e8f2a2f78aacb8f1b50ee04'
'325007ae3355bc516f434732c1633da9eec23d79'
'0c3900ffe21bfc3d96b80ade334613bc7e76fe27'
'aa3442d291bd77fefa3758291baa9c609a74e5dc'
'5543ea72a07fb6f3af19cfbb6d1683a5fddaa807'
'a905b224834c8f2d40a2f4e39a3f47ba6b1d2952')