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
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
14 chromium-64.0.3282.119-constexpr-1.patch
15 chromium-exclude_unwind_tables.patch
16 chromium-use-fromUTF8-for-UnicodeString-construction.patch
17 chromium-omnibox-unescape-fragment.patch
18 chromium-skia-harmony.patch
19 chromium-memcpy-r0.patch
20 chromium-clang-r2.patch
21 chromium-cups-r0.patch)
26 if [ -n "$(pkginfo -i | grep '^ccache ')" ]; then
27 # Avoid falling back to preprocessor mode when sources contain time macros
28 export CCACHE_SLOPPINESS=time_macros
31 export CFLAGS="-O2 -pipe -mfloat-abi=hard"
33 export CFLAGS="$CFLAGS $(pkg-config --cflags nspr) -lpthread"
34 export LDFLAGS="$LDFLAGS $(pkg-config --libs nspr)"
36 # determine some flags depending on SOC
37 USE_ARMV7=0; USE_ARM_THUMB=0; USE_ARM_NEON=0
39 armv7*) USE_ARMV7=1; USE_ARM_THUMB=1;;
41 for flag in $CFLAGS; do
43 -mfpu=neon*) USE_ARM_NEON=1;;
47 # we don't use git sources
48 patch -p1 -i $SRC/last-commit-position.patch
50 # Corrects error call to non-constexpr function
51 patch -p1 -i $SRC/chromium-64.0.3282.119-constexpr-1.patch
53 wget https://chromium.googlesource.com/chromium/src.git/+/$version?format=TEXT -O ../chromium-$version.txt
54 # https://crbug.com/710701
55 local _chrome_build_hash=$(base64 -d ../chromium-$version.txt |
56 grep -Po '^parent \K[0-9a-f]{40}$')
57 if [[ -z $_chrome_build_hash ]]; then
58 error "Unable to find Chrome build hash."
61 echo "LASTCHANGE=$_chrome_build_hash-" >build/util/LASTCHANGE
63 # https://chromium-review.googlesource.com/c/chromium/src/+/712575
64 patch -p1 -i $SRC/chromium-exclude_unwind_tables.patch
66 # https://crbug.com/772655
67 patch -p1 -i $SRC/chromium-use-fromUTF8-for-UnicodeString-construction.patch
69 # https://crbug.com/789163
70 patch -p1 -i $SRC/chromium-omnibox-unescape-fragment.patch
72 # https://crbug.com/skia/6663#c10
73 patch -p4 -i $SRC/chromium-skia-harmony.patch
76 patch -p1 -i $SRC/chromium-memcpy-r0.patch
77 patch -p1 -i $SRC/chromium-clang-r2.patch
78 patch -p1 -i $SRC/chromium-cups-r0.patch
80 mkdir -p third_party/node/linux/node-linux-x64/bin
81 ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
83 # Let's fix the toolchain
84 patch -p0 -i $SRC/$name-build-toolchain.patch
87 'blink_gc_plugin=false'
88 'clang_use_chrome_plugins=false'
89 'enable_hangout_services_extension=true'
91 'enable_swiftshader=false'
92 'fatal_linker_warnings=false'
93 'ffmpeg_branding="Chrome"'
96 'linux_use_bundled_binutils=false'
97 'use_custom_libcxx=false'
98 'proprietary_codecs=true'
99 'remove_webcore_debug_symbols=true'
101 'treat_warnings_as_errors=false'
102 'use_allocator="none"'
105 'use_gnome_keyring=false'
109 'use_pulseaudio=false'
113 /usr/bin/python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args="${_gn_args[*]}"
114 out/Release/gn gen out/Release --args="${_gn_args[*]}" --script-executable=/usr/bin/python2
116 ninja -j ${JOBS-1} -C out/Release chrome chrome_sandbox
118 install -m 0755 -D out/Release/chrome $PKG/usr/lib/$name/$name
119 install -m 4755 -o root -g root -D out/Release/chrome_sandbox $PKG/usr/lib/$name/chrome-sandbox
120 install -m 0644 -D out/Release/*.pak $PKG/usr/lib/$name
121 install -d $PKG/usr/lib/$name/locales
122 install -m 0644 out/Release/locales/en-US.pak $PKG/usr/lib/$name/locales
123 cp -a out/Release/resources $PKG/usr/lib/$name
125 install -m 0644 -D chrome/installer/linux/common/desktop.template $PKG/usr/share/applications/$name.desktop
126 install -m 0644 -D chrome/app/resources/manpage.1.in $PKG/usr/share/man/man1/$name.1
129 -e "s/@@MENUNAME@@/Chromium/g" \
130 -e "s/@@PACKAGE@@/chromium/g" \
131 -e "s/@@USR_BIN_SYMLINK_NAME@@/chromium/g" \
132 $PKG/usr/share/applications/$name.desktop \
133 $PKG/usr/share/man/man1/$name.1
136 cp -a out/Release/{natives,snapshot}_blob.bin $PKG/usr/lib/$name
138 for size in 16 32; do
139 install -m 0644 -D chrome/app/theme/default_100_percent/$name/product_logo_${size}.png \
140 $PKG/usr/share/icons/hicolor/${size}x${size}/apps/$name.png
143 for size in 22 24 48 64 128 256; do
144 install -m 0644 -D chrome/app/theme/$name/product_logo_${size}.png \
145 $PKG/usr/share/icons/hicolor/${size}x${size}/apps/$name.png
148 # fix icu installation
149 install -m 0644 -D out/Release/icudtl.dat $PKG/usr/lib/$name/icudtl.dat
151 install -m 0755 -D $SRC/$name.sh $PKG/usr/bin/$name