Advertisement
Guest User

PKGBUILD chrome arm

a guest
Apr 16th, 2016
1,271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 8.15 KB | None | 0 0
  1. # $Id: PKGBUILD 160354 2012-06-01 12:58:14Z dreisner $
  2. # Maintainer: Evangelos Foutras <[email protected]>
  3. # Contributor: Pierre Schmitz <[email protected]>
  4. # Contributor: Jan "heftig" Steffens <[email protected]>
  5. # Contributor: Daniel J Griffiths <[email protected]>
  6.  
  7. # Building for x86_64 requires lib32-glibc & lib32-zlib from [multilib]. These
  8. # libraries are linked from the NaCl toolchain, and are only needed during
  9. # build time.
  10.  
  11. # ALARM: Kevin Mihelich <[email protected]>
  12. #  - removed NaCl, not for ARM
  13. #  - adjusted gyp flags for v7/aarch64
  14. #  - makeflags to -j4 on v7, RAM constraints
  15. #  - Gentoo patch to remove lingering built-in ffmpeg code
  16. #  - upstream patches to fix AArch64
  17.  
  18. buildarch=12
  19. highmem=1
  20.  
  21. pkgname=chromium
  22. pkgver=49.0.2623.112
  23. pkgrel=2
  24. _launcher_ver=3
  25. pkgdesc="The open-source project behind Google Chrome, an attempt at creating a safer, faster, and more stable browser"
  26. arch=('armv6h' 'armv7h')
  27. url="http://www.chromium.org/"
  28. license=('BSD')
  29. depends=('gtk2' 'nss' 'alsa-lib' 'xdg-utils' 'bzip2' 'libevent' 'libxss' 'icu'
  30.          'libexif' 'libgcrypt' 'ttf-font' 'systemd' 'dbus' 'flac' 'snappy'
  31.          'speech-dispatcher' 'pciutils' 'libpulse' 'harfbuzz' 'libsecret'
  32.          'libvpx' 'perl' 'perl-file-basedir' 'desktop-file-utils'
  33.          'hicolor-icon-theme' 'ffmpeg')
  34. makedepends=('python2' 'gperf' 'yasm' 'mesa' 'ninja')
  35. optdepends=('kdebase-kdialog: needed for file dialogs in KDE'
  36.             'gnome-keyring: for storing passwords in GNOME keyring'
  37.             'kwallet: for storing passwords in KWallet')
  38. provides=('chromium-browser')
  39. conflicts=('chromium-browser')
  40. install=chromium.install
  41. source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz
  42.         chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz
  43.         chromium.desktop
  44.         chromium-widevine.patch
  45.         0001-system-ffmpeg-fixes.patch)
  46. sha256sums=('443b6d5f0d07f336783e700edc4ecae96769e105d0f8553e98fefae747302cf0'
  47.             '8b01fb4efe58146279858a754d90b49e5a38c9a0b36a1f84cbb7d12f92b84c28'
  48.             '028a748a5c275de9b8f776f97909f999a8583a4b77fd1cd600b4fc5c0c3e91e9'
  49.             '4660344789c45c9b9e52cb6d86f7cb6edb297b39320d04f6947e5216d6e5f64c'
  50.             '9f0d843fcda221b97386f8686a00918a5e165e65e9eb34df19ba6bc11ec91eee')
  51.  
  52. # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
  53. # Note: These are for Arch Linux use ONLY. For your own distribution, please
  54. # get your own set of keys. Feel free to contact [email protected] for
  55. # more information.
  56. #  - Arch Linux ARM has obtained permission to use the Arch Linux keys.
  57. _google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM
  58. _google_default_client_id=413772536636.apps.googleusercontent.com
  59. _google_default_client_secret=0ZChLK6AxeA3Isu96MkwqDR4
  60.  
  61. prepare() {
  62.   cd "$srcdir/$pkgname-$pkgver"
  63.  
  64.   # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
  65.   touch chrome/test/data/webui/i18n_process_css_test.html
  66.  
  67.   # https://code.google.com/p/chromium/issues/detail?id=541273
  68.   sed -i "/'target_name': 'libvpx'/s/libvpx/&_new/" build/linux/unbundle/libvpx.gyp
  69.  
  70.   # Enable support for the Widevine CDM plugin
  71.   # libwidevinecdm.so is not included, but can be copied over from Chrome
  72.   # (Version string doesn't seem to matter so let's go with "Pinkie Pie")
  73.   sed "s/@WIDEVINE_VERSION@/Pinkie Pie/" ../chromium-widevine.patch |
  74.     patch -Np1
  75.  
  76.   # Fix building with system ffmpeg
  77.   patch -Np1 -i ../0001-system-ffmpeg-fixes.patch
  78.  
  79.   # Remove bundled ICU; its header files appear to get picked up instead of
  80.   # the system ones, leading to errors during the final link stage.
  81.   # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/BNGvJc08B6Q
  82.   find third_party/icu -type f \! -regex '.*\.\(gyp\|gypi\|isolate\)' -delete
  83.  
  84.   [[ $CARCH == "armv7h" ]] && MAKEFLAGS=-j4
  85.  
  86.   # Use Python 2
  87.   find . -name '*.py' -exec sed -i -r 's|/usr/bin/python$|&2|g' {} +
  88.  
  89.   # There are still a lot of relative calls which need a workaround
  90.   mkdir -p "$srcdir/python2-path"
  91.   ln -sf /usr/bin/python2 "$srcdir/python2-path/python"
  92. }
  93.  
  94. build() {
  95.   cd "$srcdir/chromium-launcher-$_launcher_ver"
  96.  
  97.   make PREFIX=/usr
  98.  
  99.   cd "$srcdir/$pkgname-$pkgver"
  100.  
  101.   export PATH="$srcdir/python2-path:$PATH"
  102.  
  103.   CFLAGS=`echo $CFLAGS | sed -e 's/vfpv3-d16/neon/'` && CXXFLAGS="$CFLAGS"
  104.  
  105.   # CFLAGS are passed through release_extra_cflags below
  106.   export -n CFLAGS CXXFLAGS
  107.  
  108.   local _chromium_conf=(
  109.     -Dgoogle_api_key=$_google_api_key
  110.     -Dgoogle_default_client_id=$_google_default_client_id
  111.     -Dgoogle_default_client_secret=$_google_default_client_secret
  112.     -Dwerror=
  113.     -Dclang=0
  114.     -Dpython_ver=2.7
  115.     -Dlinux_link_gsettings=1
  116.     -Dlinux_link_libpci=1
  117.     -Dlinux_link_libspeechd=1
  118.     -Dlinux_link_pulseaudio=1
  119.     -Dlinux_strip_binary=1
  120.     -Dlinux_use_bundled_binutils=0
  121.     -Dlinux_use_bundled_gold=0
  122.     -Dlinux_use_gold_flags=0
  123.     -Dicu_use_data_file_flag=0
  124.     -Dlogging_like_official_build=1
  125.     -Dtracing_like_official_build=1
  126.     -Dfieldtrial_testing_like_official_build=1
  127.     -Drelease_extra_cflags="$CFLAGS -DUSE_EABI_HARDFLOAT -D_GLIBCXX_USE_CXX11_ABI=1"
  128.     -Dlibspeechd_h_prefix=speech-dispatcher/
  129.     -Dffmpeg_branding=Chrome
  130.     -Dproprietary_codecs=1
  131.     -Duse_gnome_keyring=0
  132.     -Duse_system_bzip2=1
  133.     -Duse_system_flac=1
  134.     -Duse_system_ffmpeg=1
  135.     -Duse_system_harfbuzz=1
  136.     -Duse_system_icu=1
  137.     -Duse_system_libevent=1
  138.     -Duse_system_libjpeg=1
  139.     -Duse_system_libpng=1
  140.     -Duse_system_libvpx=1
  141.     -Duse_system_libxml=0
  142.     -Duse_system_snappy=1
  143.     -Duse_system_ssl=1
  144.     -Duse_system_xdg_utils=1
  145.     -Duse_system_yasm=1
  146.     -Duse_system_zlib=0
  147.     -Dusb_ids_path=/usr/share/hwdata/usb.ids
  148.     -Duse_mojo=0
  149.     -Duse_gconf=0
  150.     -Denable_hangout_services_extension=1
  151.     -Denable_widevine=1
  152.     -Ddisable_fatal_linker_warnings=1
  153.     -Ddisable_glibc=1
  154.     -Ddisable_sse2=1
  155.     -Ddisable_nacl=1
  156.     -Ddisable_pnacl=1
  157.     -Dtarget_arch=arm
  158.     -Darm_neon=1
  159.     -Dv8_use_arm_eabi_hardfloat=true
  160.     -Darm_float_abi=hard
  161.     -Darmv7=1
  162.     -Darm_fpu=neon
  163.     -Dsysroot=)
  164.  
  165.   [[ $CARCH == "armv7h" ]] && _chromium_conf+=(
  166.     -Dtarget_arch=arm
  167.     -Darm_neon=1
  168.     -Dv8_use_arm_eabi_hardfloat=true
  169.     -Darm_float_abi=hard
  170.     -Darmv7=1
  171.     -Darm_fpu=neon)
  172.  
  173.   [[ $CARCH == "aarch64" ]] && _chromium_conf+=(
  174.     -Dtarget_arch=arm64
  175.     -Darm_neon=0
  176.     -Duse_allocator=none)
  177.  
  178.   # Re-configure bundled ffmpeg.
  179.   #pushd third_party/ffmpeg > /dev/null || exit 1
  180.   #python2 chromium/scripts/build_ffmpeg.py linux arm --config-only || exit 1
  181.   #chromium/scripts/copy_config.sh || exit 1
  182.   #popd > /dev/null || exit 1
  183.  
  184.   build/linux/unbundle/replace_gyp_files.py "${_chromium_conf[@]}"
  185.   build/gyp_chromium --depth=. "${_chromium_conf[@]}"
  186.  
  187.   ninja -C out/Release chrome chrome_sandbox
  188. }
  189.  
  190. package() {
  191.   cd "$srcdir/chromium-launcher-$_launcher_ver"
  192.  
  193.   make PREFIX=/usr DESTDIR="$pkgdir" install-strip
  194.   install -Dm644 LICENSE \
  195.     "$pkgdir/usr/share/licenses/chromium/LICENSE.launcher"
  196.  
  197.   cd "$srcdir/$pkgname-$pkgver"
  198.  
  199.   install -D out/Release/chrome "$pkgdir/usr/lib/chromium/chromium"
  200.  
  201.   install -Dm4755 out/Release/chrome_sandbox \
  202.     "$pkgdir/usr/lib/chromium/chrome-sandbox"
  203.  
  204.   cp out/Release/{*.pak,*.bin,libwidevinecdmadapter.so} \
  205.     "$pkgdir/usr/lib/chromium/"
  206.  
  207.   strip $STRIP_SHARED "$pkgdir/usr/lib/chromium/libwidevinecdmadapter.so"
  208.  
  209.   cp -a out/Release/locales "$pkgdir/usr/lib/chromium/"
  210.  
  211.   install -Dm644 out/Release/chrome.1 "$pkgdir/usr/share/man/man1/chromium.1"
  212.  
  213.   install -Dm644 "$srcdir/chromium.desktop" \
  214.     "$pkgdir/usr/share/applications/chromium.desktop"
  215.  
  216.   for size in 22 24 48 64 128 256; do
  217.     install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
  218.       "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
  219.   done
  220.  
  221.   for size in 16 32; do
  222.     install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \
  223.       "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
  224.   done
  225.  
  226.   install -Dm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE"
  227. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement