gtk/firefox-kde/PKGBUILD

172 lines
6.2 KiB
Bash
Raw Normal View History

2013-04-28 07:01:01 +08:00
# Contributor: Weng Xuetian <wengxt@gmail.com>
pkgname=firefox-kde
pkgver=20.0.1
pkgrel=6
2013-04-28 07:01:01 +08:00
pkgdesc="Standalone web browser from mozilla.org with OpenSUSE patch, integrate better with KDE"
_obsver=b88c72dfdc858f6209feb123227bd7df
2013-04-28 07:01:01 +08:00
url='http://www.mozilla.org/projects/firefox'
arch=('x86_64')
license=('MPL' 'GPL' 'LGPL')
depends=('gtk2' 'startup-notification' 'libnotify' 'alsa-lib' 'gstreamer0.10' 'gstreamer0.10-base' 'libxt' 'dbus-glib' 'filesystem-extra' 'kdelibs')
makedepends=('zip' 'pkg-config' 'diffutils' 'python2' 'wireless_tools' 'unzip' 'autoconf2.13' 'mesa' 'yasm' 'cmake' 'automoc4')
2013-04-28 07:01:01 +08:00
screenshot="http://img864.imageshack.us/img864/5116/firefoxm.png"
provides=("firefox=${pkgver}" "kmozillahelper=0.6.4")
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.
#
# Customization in chakra:
# since 20.0.1-6: remove patch for toolkit/components/downloads/nsDownloadManager.cpp in mozilla-kde.patch
# since mozilla's own implementation with libnotify is better
#
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
mozilla-gstreamer-760140.patch
firefox-712763.patch
duckduckgo.xml
"kmozillahelper-0.6.4.tar.bz2::https://api.opensuse.org/public/source/mozilla:Factory/mozilla-kde4-integration/${pkgname}-${pkgver}.tar.bz2?rev=${_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
2013-04-28 07:01:01 +08:00
md5sums=('b822ff4b2348410587dec563235d9320'
2013-04-28 22:10:14 +08:00
'b2a0c175d063e6c4fe0c7ed6c27ac443'
'22c8f014ca98e49c4c107e2671dd0e51'
2013-04-28 07:01:01 +08:00
'150ac0fb3ac7b2114c8e8851a9e0516c'
'b1b1ad060b411a4abee7dcc63927aa02'
'75df0f88cc7a7fa7d522459e4ff82cc5'
'194da028eba1fbc316cf37dd586c4112'
'79f113b56057e17ca2466cd0ac578bb3'
2013-05-07 05:18:59 +08:00
'69a90693ab4fc4d81afd83c1524e73d4'
2013-04-28 07:01:01 +08:00
'9f4e6467284a5c82fbba0c0afe862f31'
'7303a96e92e600a46dd6a2cf9af5ada5'
2013-05-07 05:18:59 +08:00
'f6e2a6759b8711b445dbc9d35cbd275f'
'7db8c8904371204fb4c13e9cd306deb0'
'4baee75ae2e23b2aa2f129385d4dcb82')
2013-04-28 07:01:01 +08:00
build() {
pushd .
build_kmozillahelper
popd
pushd .
build_firefox
popd
}
build_kmozillahelper() {
2013-05-07 05:18:59 +08:00
pushd .
cd kmozillahelper
patch -Np1 -i ../move-to-extra.patch || return 1
popd
mkdir -p kmozillahelper-build
cd kmozillahelper-build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=Release ../kmozillahelper
make || return 1
}
build_firefox() {
2013-04-28 07:01:01 +08:00
cd "mozilla-release"
patch -Np1 -i "../firefox-install-dir.patch"
# remove the new file, to make life easier with call makepkg multiple times
rm -f content/media/gstreamer/nsGStreamerFormatHelper.cpp \
content/media/gstreamer/GStreamerFormatHelper.cpp \
content/media/gstreamer/nsGStreamerFormatHelper.h \
content/media/gstreamer/GStreamerFormatHelper.h
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
msg "apply mozilla-gstreamer-760140.patch"
patch -Np1 -i "../mozilla-gstreamer-760140.patch" || return 1
msg "apply firefox-712763.patch"
patch -Np1 -i "../firefox-712763.patch" || return 1
msg "apply mozilla-nongnome-proxies.patch"
patch -Np1 -i "../mozilla-nongnome-proxies.patch" || return 1
msg "apply mozilla-kde.patch"
patch -Np1 -i "../mozilla-kde.patch" || return 1
2013-04-28 07:01:01 +08:00
msg "apply firefox-kde.patch"
patch -Np1 -i "../firefox-kde.patch" || return 1
cp "../mozconfig" .mozconfig
# Fix PRE_RELEASE_SUFFIX
sed -i '/^PRE_RELEASE_SUFFIX := ""/s/ ""//' \
browser/base/Makefile.in
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
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
}