Commit | Line | Data |
---|---|---|
0826c9bd JB |
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 | |
5cd4e9ca | 6 | # Depends on: dbus-glib gperf gtk gtk3 libevent libexif libgcrypt ninja nodejs nss pciutils speech-dispatcher xorg-libxscrnsaver xorg-libxt yasm |
0826c9bd JB |
7 | |
8 | name=chromium | |
bd70e9dd | 9 | version=64.0.3282.119 |
0826c9bd | 10 | release=1 |
a5b7cd58 VM |
11 | source=(https://commondatastorage.googleapis.com/$name-browser-official/$name-$version.tar.xz |
12 | chromium-build-toolchain.patch | |
bd70e9dd VM |
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) | |
0826c9bd JB |
22 | |
23 | build() { | |
24 | cd $name-$version | |
25 | ||
bd70e9dd VM |
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 | |
29 | fi | |
30 | ||
79d44473 VM |
31 | export CFLAGS="-O2 -pipe -mfloat-abi=hard" |
32 | ||
7b8c3be9 | 33 | export CFLAGS="$CFLAGS $(pkg-config --cflags nspr) -lpthread" |
0826c9bd | 34 | export LDFLAGS="$LDFLAGS $(pkg-config --libs nspr)" |
79d44473 | 35 | |
0826c9bd JB |
36 | # determine some flags depending on SOC |
37 | USE_ARMV7=0; USE_ARM_THUMB=0; USE_ARM_NEON=0 | |
38 | case $(uname -m) in | |
39 | armv7*) USE_ARMV7=1; USE_ARM_THUMB=1;; | |
40 | esac | |
41 | for flag in $CFLAGS; do | |
42 | case $flag in | |
43 | -mfpu=neon*) USE_ARM_NEON=1;; | |
44 | esac | |
45 | done | |
46 | ||
47f61ca0 VM |
47 | # we don't use git sources |
48 | patch -p1 -i $SRC/last-commit-position.patch | |
49 | ||
bd70e9dd VM |
50 | # Corrects error call to non-constexpr function |
51 | patch -p1 -i $SRC/chromium-64.0.3282.119-constexpr-1.patch | |
52 | ||
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." | |
59 | return 1 | |
60 | fi | |
61 | echo "LASTCHANGE=$_chrome_build_hash-" >build/util/LASTCHANGE | |
62 | ||
63 | # https://chromium-review.googlesource.com/c/chromium/src/+/712575 | |
64 | patch -p1 -i $SRC/chromium-exclude_unwind_tables.patch | |
79d44473 | 65 | |
bd70e9dd VM |
66 | # https://crbug.com/772655 |
67 | patch -p1 -i $SRC/chromium-use-fromUTF8-for-UnicodeString-construction.patch | |
68 | ||
69 | # https://crbug.com/789163 | |
70 | patch -p1 -i $SRC/chromium-omnibox-unescape-fragment.patch | |
71 | ||
72 | # https://crbug.com/skia/6663#c10 | |
73 | patch -p4 -i $SRC/chromium-skia-harmony.patch | |
79d44473 VM |
74 | |
75 | # Fixes from Gentoo | |
bd70e9dd VM |
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 | |
79d44473 VM |
79 | |
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/ | |
82 | ||
47f61ca0 VM |
83 | # Let's fix the toolchain |
84 | patch -p0 -i $SRC/$name-build-toolchain.patch | |
85 | ||
86 | _gn_args=( | |
87 | 'blink_gc_plugin=false' | |
88 | 'clang_use_chrome_plugins=false' | |
89 | 'enable_hangout_services_extension=true' | |
90 | 'enable_nacl=false' | |
79d44473 | 91 | 'enable_swiftshader=false' |
47f61ca0 VM |
92 | 'fatal_linker_warnings=false' |
93 | 'ffmpeg_branding="Chrome"' | |
94 | 'is_clang=false' | |
95 | 'is_debug=false' | |
96 | 'linux_use_bundled_binutils=false' | |
a5b7cd58 | 97 | 'use_custom_libcxx=false' |
47f61ca0 VM |
98 | 'proprietary_codecs=true' |
99 | 'remove_webcore_debug_symbols=true' | |
100 | 'symbol_level=0' | |
101 | 'treat_warnings_as_errors=false' | |
102 | 'use_allocator="none"' | |
103 | 'use_cups=false' | |
104 | 'use_gconf=false' | |
105 | 'use_gnome_keyring=false' | |
106 | 'use_gold=false' | |
bd70e9dd | 107 | 'use_gtk3=true' |
47f61ca0 VM |
108 | 'use_kerberos=false' |
109 | 'use_pulseaudio=false' | |
110 | 'use_sysroot=false' | |
47f61ca0 VM |
111 | ) |
112 | ||
bd70e9dd | 113 | /usr/bin/python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args="${_gn_args[*]}" |
47f61ca0 | 114 | out/Release/gn gen out/Release --args="${_gn_args[*]}" --script-executable=/usr/bin/python2 |
0826c9bd | 115 | |
5cd4e9ca | 116 | ninja -j ${JOBS-1} -C out/Release chrome chrome_sandbox |
79d44473 | 117 | |
6a3c14de VM |
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 | |
6a3c14de VM |
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 | |
bd70e9dd VM |
124 | |
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 | |
127 | ||
128 | sed -i \ | |
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 | |
0826c9bd | 134 | |
6a3c14de VM |
135 | # fix v8 natives |
136 | cp -a out/Release/{natives,snapshot}_blob.bin $PKG/usr/lib/$name | |
0826c9bd | 137 | |
bd70e9dd VM |
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 | |
141 | done | |
142 | ||
143 | for size in 22 24 48 64 128 256; do | |
6a3c14de | 144 | install -m 0644 -D chrome/app/theme/$name/product_logo_${size}.png \ |
47f61ca0 | 145 | $PKG/usr/share/icons/hicolor/${size}x${size}/apps/$name.png |
0826c9bd JB |
146 | done |
147 | ||
2fd1611b | 148 | # fix icu installation |
bd70e9dd | 149 | install -m 0644 -D out/Release/icudtl.dat $PKG/usr/lib/$name/icudtl.dat |
2fd1611b | 150 | |
6a3c14de | 151 | install -m 0755 -D $SRC/$name.sh $PKG/usr/bin/$name |
bd70e9dd | 152 | |
0826c9bd | 153 | } |