| 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 gperf gtk gtk3 libevent libexif libgcrypt ninja nodejs nss pciutils speech-dispatcher xorg-libxscrnsaver xorg-libxt yasm |
| 7 | |
| 8 | name=chromium |
| 9 | version=62.0.3202.75 |
| 10 | release=1 |
| 11 | source=(https://commondatastorage.googleapis.com/$name-browser-official/$name-$version.tar.xz |
| 12 | chromium-build-toolchain.patch |
| 13 | last-commit-position.patch $name.sh $name.desktop |
| 14 | breakpad-use-ucontext_t.patch |
| 15 | chromium-gn-bootstrap-r17.patch |
| 16 | crc32c-string-view-check.patch) |
| 17 | |
| 18 | build() { |
| 19 | cd $name-$version |
| 20 | |
| 21 | export CFLAGS="-O2 -pipe -mfloat-abi=hard" |
| 22 | |
| 23 | export CFLAGS="$CFLAGS $(pkg-config --cflags nspr) -lpthread" |
| 24 | export LDFLAGS="$LDFLAGS $(pkg-config --libs nspr)" |
| 25 | |
| 26 | # determine some flags depending on SOC |
| 27 | USE_ARMV7=0; USE_ARM_THUMB=0; USE_ARM_NEON=0 |
| 28 | case $(uname -m) in |
| 29 | armv7*) USE_ARMV7=1; USE_ARM_THUMB=1;; |
| 30 | esac |
| 31 | for flag in $CFLAGS; do |
| 32 | case $flag in |
| 33 | -mfpu=neon*) USE_ARM_NEON=1;; |
| 34 | esac |
| 35 | done |
| 36 | |
| 37 | |
| 38 | # we don't use git sources |
| 39 | patch -p1 -i $SRC/last-commit-position.patch |
| 40 | |
| 41 | # Fix incorrect inclusion of <string_view> in modes other than >= C++17 |
| 42 | patch -p1 -d third_party/crc32c/src -i $SRC/crc32c-string-view-check.patch |
| 43 | |
| 44 | # Fix build with glibc 2.26 |
| 45 | patch -p1 -i $SRC/breakpad-use-ucontext_t.patch |
| 46 | |
| 47 | # Fixes from Gentoo |
| 48 | patch -p1 -i $SRC/chromium-gn-bootstrap-r17.patch |
| 49 | |
| 50 | mkdir -p third_party/node/linux/node-linux-x64/bin |
| 51 | ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/ |
| 52 | |
| 53 | # Let's fix the toolchain |
| 54 | patch -p0 -i $SRC/$name-build-toolchain.patch |
| 55 | |
| 56 | _gn_args=( |
| 57 | 'blink_gc_plugin=false' |
| 58 | 'clang_use_chrome_plugins=false' |
| 59 | 'enable_hangout_services_extension=true' |
| 60 | 'enable_nacl=false' |
| 61 | 'enable_swiftshader=false' |
| 62 | 'fatal_linker_warnings=false' |
| 63 | 'ffmpeg_branding="Chrome"' |
| 64 | 'is_clang=false' |
| 65 | 'is_debug=false' |
| 66 | 'linux_use_bundled_binutils=false' |
| 67 | 'use_custom_libcxx=false' |
| 68 | 'proprietary_codecs=true' |
| 69 | 'remove_webcore_debug_symbols=true' |
| 70 | 'symbol_level=0' |
| 71 | 'treat_warnings_as_errors=false' |
| 72 | 'use_allocator="none"' |
| 73 | 'use_cups=false' |
| 74 | 'use_gconf=false' |
| 75 | 'use_gnome_keyring=false' |
| 76 | 'use_gold=false' |
| 77 | 'use_kerberos=false' |
| 78 | 'use_pulseaudio=false' |
| 79 | 'use_sysroot=false' |
| 80 | 'use_system_libjpeg=true' |
| 81 | ) |
| 82 | |
| 83 | # export TMPDIR="${PKGMK_WORK_DIR}/temp" |
| 84 | # mkdir -p -m 755 "${TMPDIR}" || die |
| 85 | |
| 86 | python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args="${_gn_args[*]}" |
| 87 | out/Release/gn gen out/Release --args="${_gn_args[*]}" --script-executable=/usr/bin/python2 |
| 88 | |
| 89 | ninja -j ${JOBS-1} -C out/Release chrome chrome_sandbox |
| 90 | |
| 91 | install -m 0755 -D out/Release/chrome $PKG/usr/lib/$name/$name |
| 92 | install -m 4755 -o root -g root -D out/Release/chrome_sandbox $PKG/usr/lib/$name/chrome-sandbox |
| 93 | install -m 0644 -D out/Release/*.pak $PKG/usr/lib/$name |
| 94 | install -d $PKG/usr/lib/$name/locales |
| 95 | install -m 0644 out/Release/locales/en-US.pak $PKG/usr/lib/$name/locales |
| 96 | cp -a out/Release/resources $PKG/usr/lib/$name |
| 97 | install -m 0644 -D out/Release/chrome.1 $PKG/usr/share/man/man1/$name.1 |
| 98 | |
| 99 | # fix v8 natives |
| 100 | cp -a out/Release/{natives,snapshot}_blob.bin $PKG/usr/lib/$name |
| 101 | |
| 102 | for size in 22 24 48 128 256; do |
| 103 | install -m 0644 -D chrome/app/theme/$name/product_logo_${size}.png \ |
| 104 | $PKG/usr/share/icons/hicolor/${size}x${size}/apps/$name.png |
| 105 | done |
| 106 | |
| 107 | # fix icu installation |
| 108 | cp -a out/Release/icudtl.dat $PKG/usr/lib/$name |
| 109 | |
| 110 | install -d $PKG/usr/share/pixmaps |
| 111 | ln -sf /usr/share/icons/hicolor/48x48/apps/$name.png $PKG/usr/share/pixmaps/$name.png |
| 112 | install -m 0644 -D $SRC/$name.desktop $PKG/usr/share/applications/$name.desktop |
| 113 | install -m 0755 -D $SRC/$name.sh $PKG/usr/bin/$name |
| 114 | } |