| 1 | # Description: Open source version of Google Chrome web browser. |
| 2 | # URL: http://chromium.org/ |
| 3 | # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu |
| 4 | # Maintainer: Jose V Beneyto, sepen at crux dot nu |
| 5 | # Packager: Tadeusz Sosnierz, tadzikes gmail com |
| 6 | # Depends on: dbus-glib gtk libevent nss xorg-libxscrnsaver xorg-libxtst libgcrypt xorg-libxdamage xorg-libxt gperf speech-dispatcher |
| 7 | |
| 8 | name=chromium |
| 9 | version=30.0.1599.114 |
| 10 | release=1 |
| 11 | source=(http://commondatastorage.googleapis.com/chromium-browser-official/$name-$version.tar.xz \ |
| 12 | $name.sh icu-native-arm.patch ffmpeg-native-arm.patch webrtc-arm_neon.patch) |
| 13 | |
| 14 | build() { |
| 15 | cd $name-$version |
| 16 | |
| 17 | # avoid 32-bit flags (g++: error: unrecognized command line option '-m32') |
| 18 | patch -p1 -i $SRC/icu-native-arm.patch |
| 19 | # https://chromium.googlesource.com/chromium/third_party/ffmpeg/+/8a08a6d1dea934cf6507693a7f5285241b5c435b |
| 20 | patch -p1 -i $SRC/ffmpeg-native-arm.patch |
| 21 | # based on: https://code.google.com/p/chromium/issues/detail?id=154107 |
| 22 | patch -p1 -i $SRC/webrtc-arm_neon.patch |
| 23 | |
| 24 | # fix for speech-dispatcher >= 0.8 |
| 25 | sed -e 's|<<(libspeechd_h_prefix)libspeechd.h>|<speech-dispatcher/libspeechd.h>|' \ |
| 26 | -i build/linux/system.gyp |
| 27 | |
| 28 | export CFLAGS="$CFLAGS $(pkg-config --cflags nspr)" |
| 29 | export LDFLAGS="$LDFLAGS $(pkg-config --libs nspr)" |
| 30 | |
| 31 | # determine some flags depending on SOC |
| 32 | USE_ARMV7=0; USE_ARM_THUMB=0; USE_ARM_NEON=0 |
| 33 | case $(uname -m) in |
| 34 | armv7*) USE_ARMV7=1; USE_ARM_THUMB=1;; |
| 35 | esac |
| 36 | for flag in $CFLAGS; do |
| 37 | case $flag in |
| 38 | -mfpu=neon*) USE_ARM_NEON=1;; |
| 39 | esac |
| 40 | done |
| 41 | |
| 42 | build/gyp_chromium -f make build/all.gyp --depth=. \ |
| 43 | -Dtarget_arch=arm \ |
| 44 | -Darm_float_abi=hard \ |
| 45 | -Darmv7=$USE_ARMV7 \ |
| 46 | -Darm_thumb=$USE_ARM_THUMB \ |
| 47 | -Darm_neon=$USE_ARM_NEON \ |
| 48 | -Dv8_target_arch=arm \ |
| 49 | -Dv8_use_arm_eabi_hardfloat=1 \ |
| 50 | -Dsysroot= \ |
| 51 | -Dno_strict_aliasing=1 \ |
| 52 | -Dwerror= \ |
| 53 | -Dlinux_sandbox_path=/usr/lib/chromium/chrome-sandbox \ |
| 54 | -Dlinux_strip_binary=1 \ |
| 55 | -Dlinux_use_gold_binary=0 \ |
| 56 | -Dlinux_use_gold_flags=0 \ |
| 57 | -Dlinux_use_tmalloc=0 \ |
| 58 | -Drelease_extra_cflags="$CFLAGS" \ |
| 59 | -Dproprietary_codecs=1 \ |
| 60 | -Dffmpeg_branding=Chrome \ |
| 61 | -Duse_system_libjpeg=1 \ |
| 62 | -Duse_system_libxslt=1 \ |
| 63 | -Duse_system_libxml=1 \ |
| 64 | -Duse_system_bzip2=1 \ |
| 65 | -Duse_system_zlib=0 \ |
| 66 | -Duse_system_libpng=0 \ |
| 67 | -Duse_system_ffmpeg=0 \ |
| 68 | -Duse_system_yasm=0 \ |
| 69 | -Duse_system_libevent=1 \ |
| 70 | -Duse_system_sqlite=0 \ |
| 71 | -Dremove_webcore_debug_symbols=1 \ |
| 72 | -Duse_gconf=0 \ |
| 73 | -Duse_cups=0 \ |
| 74 | -Duse_gnome_keyring=0 \ |
| 75 | -Duse_kerberos=0 \ |
| 76 | -Duse_pulseaudio=0 \ |
| 77 | -Dlinux_link_gnome_keyring=0 \ |
| 78 | -Dlinux_link_libpci=1 \ |
| 79 | -Dlinux_link_libspeechd=1 \ |
| 80 | -Denable_webrtc=1 \ |
| 81 | -Ddisable_nacl=1 |
| 82 | |
| 83 | # fix issue with nspr libs |
| 84 | sed -e "s|LIBS := |LIBS := $LDFLAGS |" -i chrome/chrome.target.mk |
| 85 | |
| 86 | make V=1 chrome chrome_sandbox BUILDTYPE=Release |
| 87 | |
| 88 | install -m 0755 -D out/Release/chrome $PKG/usr/lib/chromium/chromium |
| 89 | install -m 4755 -o root -g root -D out/Release/chrome_sandbox $PKG/usr/lib/chromium/chrome-sandbox |
| 90 | install -m 0644 -D out/Release/*.pak $PKG/usr/lib/chromium |
| 91 | install -m 0755 -D out/Release/libffmpegsumo.so $PKG/usr/lib/chromium |
| 92 | install -d $PKG/usr/lib/chromium/locales |
| 93 | install -m 0644 out/Release/locales/en-US.pak $PKG/usr/lib/chromium/locales |
| 94 | cp -a out/Release/resources $PKG/usr/lib/chromium |
| 95 | install -m 0644 -D out/Release/chrome.1 $PKG/usr/man/man1/chromium.1 |
| 96 | |
| 97 | for size in 22 24 48 128 256; do |
| 98 | install -m 0644 -D chrome/app/theme/chromium/product_logo_${size}.png \ |
| 99 | $PKG/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png |
| 100 | done |
| 101 | |
| 102 | install -m 0755 -D $SRC/chromium.sh $PKG/usr/bin/chromium |
| 103 | } |