added extra/chromium, fixes #143, fixes #169

This commit is contained in:
Kevin Mihelich 2012-06-11 00:16:02 -04:00
parent de6e27f570
commit f40e7b62af
7 changed files with 379 additions and 0 deletions

155
extra/chromium/PKGBUILD Normal file
View file

@ -0,0 +1,155 @@
# $Id: PKGBUILD 160354 2012-06-01 12:58:14Z dreisner $
# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
# Contributor: Pierre Schmitz <pierre@archlinux.de>
# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Building for x86_64 requires lib32-glibc & lib32-zlib from [multilib]. These
# libraries are linked from the NaCl toolchain, and are only needed during
# build time.
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - removed NaCl, not for ARm
# - adjusted gyp flags for v7h
buildarch=4
pkgname=chromium
pkgver=19.0.1084.52
pkgrel=2
pkgdesc="The open-source project behind Google Chrome, an attempt at creating a safer, faster, and more stable browser"
arch=('i686' 'x86_64')
url="http://www.chromium.org/"
license=('BSD')
depends=('gtk2' 'dbus-glib' 'nss' 'alsa-lib' 'xdg-utils' 'bzip2' 'libevent'
'libxss' 'libgcrypt' 'ttf-dejavu' 'desktop-file-utils'
'hicolor-icon-theme')
makedepends=('python2' 'perl' 'gperf' 'yasm' 'mesa' 'libgnome-keyring'
'elfutils')
optdepends=('kdebase-kdialog: needed for file dialogs in KDE')
# Needed for the NaCl toolchain
[[ $CARCH == x86_64 ]] && makedepends+=('lib32-zlib')
provides=('chromium-browser')
conflicts=('chromium-browser')
backup=('etc/chromium/default')
install=chromium.install
source=(http://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.bz2
chromium.desktop
chromium.default
chromium.sh
chromium-gcc47.patch
sqlite-3.7.6.3-fix-out-of-scope-memory-reference.patch)
sha256sums=('e725d4aa7608c9975b8989188d85d38846956db2f480a1a217bcab06419dab72'
'09bfac44104f4ccda4c228053f689c947b3e97da9a4ab6fa34ce061ee83d0322'
'478340d5760a9bd6c549e19b1b5d1c5b4933ebf5f8cfb2b3e2d70d07443fe232'
'4999fded897af692f4974f0a3e3bbb215193519918a1fa9b31ed51e74a2dccb9'
'f607347ba8477d3c8e60eb3803d26f3c9869f77fd49986c60887c59a6aa7d30d'
'a700aa054800d1b21d84eaba27c38a703dfa023e9226d11a942690c2a0630aff')
build() {
cd "$srcdir/chromium-$pkgver"
# Fix build with gcc 4.7 (patch from openSUSE)
patch -Np2 -i "$srcdir/chromium-gcc47.patch"
# http://code.google.com/p/chromium/issues/detail?id=109527
sed -i 's|glib/gutils.h|glib.h|' ui/base/l10n/l10n_util.cc
# SQLite: Fix a problem in fts3_write.c causing stack memory to be referenced
# after it is out of scope (http://www.sqlite.org/src/info/f9c4a7c8f4)
# (http://code.google.com/p/chromium/issues/detail?id=122525)
patch -i "$srcdir/sqlite-3.7.6.3-fix-out-of-scope-memory-reference.patch" \
third_party/sqlite/amalgamation/sqlite3.c
# Use Python 2
find . -type f -exec sed -i -r \
-e 's|/usr/bin/python$|&2|g' \
-e 's|(/usr/bin/python2)\.4$|\1|g' \
{} +
# There are still a lot of relative calls which need a workaround
mkdir "$srcdir/python2-path"
ln -s /usr/bin/python2 "$srcdir/python2-path/python"
export PATH="$srcdir/python2-path:$PATH"
ln -s "$srcdir/pepper_${pkgver%%.*}/toolchain/linux_x86_newlib" \
native_client/toolchain/linux_x86_newlib
# We need to disable system_ssl until "next protocol negotiation" support is
# available in our nss package.
# (See https://bugzilla.mozilla.org/show_bug.cgi?id=547312)
# CFLAGS are passed through release_extra_cflags below
export -n CFLAGS CXXFLAGS
# Silence "identifier 'nullptr' is a keyword in C++11" warnings
CFLAGS+=' -Wno-c++0x-compat'
build/gyp_chromium --depth=. \
-Dwerror= \
-Dlinux_sandbox_path=/usr/lib/chromium/chromium-sandbox \
-Dlinux_strip_binary=1 \
-Dlinux_use_gold_binary=0 \
-Dlinux_use_gold_flags=0 \
-Drelease_extra_cflags="$CFLAGS -DUSE_EABI_HARDFLOAT" \
-Dffmpeg_branding=Chrome \
-Dproprietary_codecs=1 \
-Duse_system_bzip2=1 \
-Duse_system_ffmpeg=0 \
-Duse_system_libevent=1 \
-Duse_system_libjpeg=1 \
-Duse_system_libpng=1 \
-Duse_system_libxml=0 \
-Duse_system_ssl=0 \
-Duse_system_yasm=1 \
-Duse_system_zlib=1 \
-Duse_gconf=0 \
-Ddisable_sse2=1 \
-Dtarget_arch=arm \
-Darmv7=1 \
-Darm_neon=0 \
-Darm_fpu=vfpv3-d16 \
-Dlinux_use_tcmalloc=0 \
-Ddisable_nacl=1
make chrome chrome_sandbox BUILDTYPE=Release
}
package() {
cd "$srcdir/chromium-$pkgver"
install -D out/Release/chrome "$pkgdir/usr/lib/chromium/chromium"
install -Dm4755 -o root -g root out/Release/chrome_sandbox \
"$pkgdir/usr/lib/chromium/chromium-sandbox"
cp out/Release/{{chrome,resources}.pak,libffmpegsumo.so} \
"$pkgdir/usr/lib/chromium/"
# These links are only needed when building with system ffmpeg
#ln -s /usr/lib/libavcodec.so.53 "$pkgdir/usr/lib/chromium/"
#ln -s /usr/lib/libavformat.so.53 "$pkgdir/usr/lib/chromium/"
#ln -s /usr/lib/libavutil.so.51 "$pkgdir/usr/lib/chromium/"
# Allow users to override command-line options
install -Dm644 "$srcdir/chromium.default" "$pkgdir/etc/chromium/default"
cp -a out/Release/locales out/Release/resources "$pkgdir/usr/lib/chromium/"
find "$pkgdir/usr/lib/chromium/" -name '*.d' -type f -delete
install -Dm644 out/Release/chrome.1 "$pkgdir/usr/share/man/man1/chromium.1"
install -Dm644 "$srcdir/chromium.desktop" \
"$pkgdir/usr/share/applications/chromium.desktop"
for size in 16 22 24 32 48 64 128 256; do
install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
"$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
done
install -D "$srcdir/chromium.sh" "$pkgdir/usr/bin/chromium"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE"
}
# vim:set ts=2 sw=2 et:

View file

@ -0,0 +1,53 @@
--- chromium-17.0.963.46/src/base/message_pump_libevent.cc.gcc47 2012-02-17 14:52:00.527217354 -0500
+++ chromium-17.0.963.46/src/base/message_pump_libevent.cc 2012-02-17 14:52:10.172135400 -0500
@@ -6,6 +6,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <unistd.h>
#include "base/auto_reset.h"
#include "base/compiler_specific.h"
--- chromium-17.0.963.46/src/chrome/browser/policy/policy_path_parser_linux.cc.gcc47 2012-02-17 15:26:32.086746278 -0500
+++ chromium-17.0.963.46/src/chrome/browser/policy/policy_path_parser_linux.cc 2012-02-17 15:26:53.039544290 -0500
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <pwd.h>
+#include <unistd.h>
#include "chrome/browser/policy/policy_path_parser.h"
--- chromium-17.0.963.46/src/ipc/ipc_channel.h.gcc47 2012-01-27 03:02:07.000000000 -0500
+++ chromium-17.0.963.46/src/ipc/ipc_channel.h 2012-02-17 14:46:31.821010460 -0500
@@ -9,6 +9,7 @@
#include "base/process.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_message.h"
+#include <sys/types.h>
namespace IPC {
--- chromium-17.0.963.46/src/ipc/ipc_platform_file.cc.gcc47 2012-01-27 03:02:07.000000000 -0500
+++ chromium-17.0.963.46/src/ipc/ipc_platform_file.cc 2012-02-17 14:46:31.824010435 -0500
@@ -3,10 +3,7 @@
// found in the LICENSE file.
#include "ipc/ipc_platform_file.h"
-
-#if defined(OS_ANDROID)
#include <unistd.h>
-#endif
namespace IPC {
--- chromium-17.0.963.46/src/seccompsandbox/library.h.gcc47 2012-01-27 03:03:35.000000000 -0500
+++ chromium-17.0.963.46/src/seccompsandbox/library.h 2012-02-17 14:46:31.826010418 -0500
@@ -12,6 +12,7 @@
#include <string>
#include <string.h>
#include <sys/mman.h>
+#include <sys/types.h>
#include "maps.h"

View file

@ -0,0 +1,4 @@
# Default settings for chromium. This file is sourced by /usr/bin/chromium
# Options to pass to chromium
CHROMIUM_FLAGS=""

View file

@ -0,0 +1,113 @@
[Desktop Entry]
Version=1.0
Name=Chromium
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Web Browser
GenericName[ar]=متصفح الشبكة
GenericName[bg]=Уеб браузър
GenericName[ca]=Navegador web
GenericName[cs]=WWW prohlížeč
GenericName[da]=Browser
GenericName[de]=Web-Browser
GenericName[el]=Περιηγητής ιστού
GenericName[en_GB]=Web Browser
GenericName[es]=Navegador web
GenericName[et]=Veebibrauser
GenericName[fi]=WWW-selain
GenericName[fr]=Navigateur Web
GenericName[gu]=
GenericName[he]=דפדפן אינטרנט
GenericName[hi]=
GenericName[hu]=Webböngésző
GenericName[it]=Browser Web
GenericName[ja]=
GenericName[kn]=
GenericName[ko]=
GenericName[lt]=Žiniatinklio naršyklė
GenericName[lv]=Tīmekļa pārlūks
GenericName[ml]=
GenericName[mr]=
GenericName[nb]=Nettleser
GenericName[nl]=Webbrowser
GenericName[pl]=Przeglądarka WWW
GenericName[pt]=Navegador Web
GenericName[pt_BR]=Navegador da Internet
GenericName[ro]=Navigator de Internet
GenericName[ru]=Веб-браузер
GenericName[sl]=Spletni brskalnik
GenericName[sv]=Webbläsare
GenericName[ta]= ி
GenericName[th]=
GenericName[tr]=Web Tarayıcı
GenericName[uk]=Навігатор Тенет
GenericName[zh_CN]=
GenericName[zh_HK]=
GenericName[zh_TW]=
# Not translated in KDE, from Epiphany 2.26.1-0ubuntu1.
GenericName[bn]=
GenericName[fil]=Web Browser
GenericName[hr]=Web preglednik
GenericName[id]=Browser Web
GenericName[or]=
GenericName[sk]=WWW prehliadač
GenericName[sr]=Интернет прегледник
GenericName[te]= ి
GenericName[vi]=B duyt Web
# Gnome and KDE 3 uses Comment.
Comment=Access the Internet
Comment[ar]=الدخول إلى الإنترنت
Comment[bg]=Достъп до интернет
Comment[bn]=ি
Comment[ca]=Accedeix a Internet
Comment[cs]=Přístup k internetu
Comment[da]=Få adgang til internettet
Comment[de]=Internetzugriff
Comment[el]=Πρόσβαση στο Διαδίκτυο
Comment[en_GB]=Access the Internet
Comment[es]=Accede a Internet.
Comment[et]=Pääs Internetti
Comment[fi]=Käytä internetiä
Comment[fil]=I-access ang Internet
Comment[fr]=Accéder à Internet
Comment[gu]=
Comment[he]=גישה אל האינטרנט
Comment[hi]= ि
Comment[hr]=Pristup Internetu
Comment[hu]=Internetelérés
Comment[id]=Akses Internet
Comment[it]=Accesso a Internet
Comment[ja]=
Comment[kn]= ಿಿ
Comment[ko]=
Comment[lt]=Interneto prieiga
Comment[lv]=Piekļūt internetam
Comment[ml]=
Comment[mr]=
Comment[nb]=Gå til Internett
Comment[nl]=Verbinding maken met internet
Comment[or]=
Comment[pl]=Skorzystaj z internetu
Comment[pt]=Aceder à Internet
Comment[pt_BR]=Acessar a internet
Comment[ro]=Accesaţi Internetul
Comment[ru]=Доступ в Интернет
Comment[sk]=Prístup do siete Internet
Comment[sl]=Dostop do interneta
Comment[sr]=Приступите Интернету
Comment[sv]=Gå ut på Internet
Comment[ta]=
Comment[te]= ి
Comment[th]=
Comment[tr]=İnternet'e erişin
Comment[uk]=Доступ до Інтернету
Comment[vi]=Truy cp Internet
Comment[zh_CN]=访
Comment[zh_HK]=
Comment[zh_TW]=
Exec=chromium %U
Terminal=false
Icon=chromium
Type=Application
Categories=GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;

View file

@ -0,0 +1,12 @@
post_install() {
xdg-icon-resource forceupdate --theme hicolor &>/dev/null
update-desktop-database -q
}
post_upgrade() {
post_install
}
post_remove() {
post_install
}

16
extra/chromium/chromium.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
# Allow users to override command-line options
# Based on Gentoo's chromium package (and by extension, Debian's)
if [[ -f /etc/chromium/default ]]; then
. /etc/chromium/default
fi
# Prefer user defined CHROMIUM_USER_FLAGS (from env) over system
# default CHROMIUM_FLAGS (from /etc/chromium/default)
CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-$CHROMIUM_FLAGS}
export CHROME_WRAPPER=$(readlink -f "$0")
export CHROME_DESKTOP=chromium.desktop
exec /usr/lib/chromium/chromium $CHROMIUM_FLAGS "$@"

View file

@ -0,0 +1,26 @@
--- ext/fts3/fts3_write.c.orig 2012-05-08 21:05:03.000000000 +0300
+++ ext/fts3/fts3_write.c 2012-05-08 21:07:08.000000000 +0300
@@ -1238,13 +1238,13 @@ int sqlite3Fts3SegReaderPending(
Fts3SegReader **ppReader /* OUT: SegReader for pending-terms */
){
Fts3SegReader *pReader = 0; /* Fts3SegReader object to return */
+ Fts3HashElem *pE; /* Iterator variable */
Fts3HashElem **aElem = 0; /* Array of term hash entries to scan */
int nElem = 0; /* Size of array at aElem */
int rc = SQLITE_OK; /* Return Code */
if( isPrefix ){
int nAlloc = 0; /* Size of allocated array at aElem */
- Fts3HashElem *pE = 0; /* Iterator variable */
for(pE=fts3HashFirst(&p->pendingTerms); pE; pE=fts3HashNext(pE)){
char *zKey = (char *)fts3HashKey(pE);
@@ -1276,7 +1276,7 @@ int sqlite3Fts3SegReaderPending(
}
}else{
- Fts3HashElem *pE = fts3HashFindElem(&p->pendingTerms, zTerm, nTerm);
+ pE = fts3HashFindElem(&p->pendingTerms, zTerm, nTerm);
if( pE ){
aElem = &pE;
nElem = 1;