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 | |
79d44473 | 6 | # Depends on: dbus-glib gperf gtk libevent libexif libgcrypt mesa3d ninja nodejs nss pciutils speech-dispatcher xorg-libxscrnsaver xorg-libxt xorg-libxtst yasm |
0826c9bd JB |
7 | |
8 | name=chromium | |
a5b7cd58 | 9 | version=61.0.3163.79 |
0826c9bd | 10 | release=1 |
a5b7cd58 VM |
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-gcc-r1.patch | |
16 | chromium-gn-bootstrap-r14.patch | |
17 | chromium-atk-r1.patch | |
18 | chromium-blink-gcc7.patch) | |
0826c9bd JB |
19 | |
20 | build() { | |
21 | cd $name-$version | |
22 | ||
79d44473 VM |
23 | export CFLAGS="-O2 -pipe -mfloat-abi=hard" |
24 | ||
7b8c3be9 | 25 | export CFLAGS="$CFLAGS $(pkg-config --cflags nspr) -lpthread" |
0826c9bd | 26 | export LDFLAGS="$LDFLAGS $(pkg-config --libs nspr)" |
79d44473 | 27 | |
0826c9bd JB |
28 | # determine some flags depending on SOC |
29 | USE_ARMV7=0; USE_ARM_THUMB=0; USE_ARM_NEON=0 | |
30 | case $(uname -m) in | |
31 | armv7*) USE_ARMV7=1; USE_ARM_THUMB=1;; | |
32 | esac | |
33 | for flag in $CFLAGS; do | |
34 | case $flag in | |
35 | -mfpu=neon*) USE_ARM_NEON=1;; | |
36 | esac | |
37 | done | |
38 | ||
47f61ca0 VM |
39 | |
40 | # we don't use git sources | |
41 | patch -p1 -i $SRC/last-commit-position.patch | |
42 | ||
79d44473 VM |
43 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853347 |
44 | patch -p1 -i $SRC/chromium-blink-gcc7.patch | |
45 | ||
a5b7cd58 VM |
46 | # Fix build with glibc 2.26 |
47 | patch -p1 -i $SRC/breakpad-use-ucontext_t.patch | |
79d44473 VM |
48 | |
49 | # Fixes from Gentoo | |
a5b7cd58 VM |
50 | patch -p1 -i $SRC/chromium-gcc-r1.patch |
51 | patch -p1 -i $SRC/chromium-gn-bootstrap-r14.patch | |
52 | patch -p1 -i $SRC/chromium-atk-r1.patch | |
79d44473 VM |
53 | |
54 | mkdir -p third_party/node/linux/node-linux-x64/bin | |
55 | ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/ | |
56 | ||
47f61ca0 VM |
57 | # Let's fix the toolchain |
58 | patch -p0 -i $SRC/$name-build-toolchain.patch | |
59 | ||
60 | _gn_args=( | |
61 | 'blink_gc_plugin=false' | |
62 | 'clang_use_chrome_plugins=false' | |
63 | 'enable_hangout_services_extension=true' | |
64 | 'enable_nacl=false' | |
79d44473 | 65 | 'enable_swiftshader=false' |
47f61ca0 VM |
66 | 'fatal_linker_warnings=false' |
67 | 'ffmpeg_branding="Chrome"' | |
68 | 'is_clang=false' | |
69 | 'is_debug=false' | |
70 | 'linux_use_bundled_binutils=false' | |
a5b7cd58 | 71 | 'use_custom_libcxx=false' |
47f61ca0 VM |
72 | 'proprietary_codecs=true' |
73 | 'remove_webcore_debug_symbols=true' | |
74 | 'symbol_level=0' | |
75 | 'treat_warnings_as_errors=false' | |
76 | 'use_allocator="none"' | |
77 | 'use_cups=false' | |
78 | 'use_gconf=false' | |
79 | 'use_gnome_keyring=false' | |
80 | 'use_gold=false' | |
81 | 'use_kerberos=false' | |
82 | 'use_pulseaudio=false' | |
83 | 'use_sysroot=false' | |
84 | 'use_system_libjpeg=true' | |
85 | ) | |
86 | ||
79d44473 VM |
87 | export TMPDIR="${PKGMK_WORK_DIR}/temp" |
88 | mkdir -p -m 755 "${TMPDIR}" || die | |
89 | ||
47f61ca0 VM |
90 | python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args="${_gn_args[*]}" |
91 | out/Release/gn gen out/Release --args="${_gn_args[*]}" --script-executable=/usr/bin/python2 | |
0826c9bd | 92 | |
79d44473 VM |
93 | # Ninja, by default, sets the number of jobs to the number of availalble threads |
94 | # local JOBS=$(awk 'BEGIN{RS="-j|--jobs="} NR==2 {print $1}' <<< $MAKEFLAGS) | |
95 | # test -n "$JOBS" && export JOBS="-j $JOBS" | |
96 | JOBS="-j 2" | |
97 | ninja $JOBS -C out/Release chrome chrome_sandbox | |
98 | ||
6a3c14de VM |
99 | install -m 0755 -D out/Release/chrome $PKG/usr/lib/$name/$name |
100 | install -m 4755 -o root -g root -D out/Release/chrome_sandbox $PKG/usr/lib/$name/chrome-sandbox | |
101 | install -m 0644 -D out/Release/*.pak $PKG/usr/lib/$name | |
6a3c14de VM |
102 | install -d $PKG/usr/lib/$name/locales |
103 | install -m 0644 out/Release/locales/en-US.pak $PKG/usr/lib/$name/locales | |
104 | cp -a out/Release/resources $PKG/usr/lib/$name | |
6c6668f9 | 105 | install -m 0644 -D out/Release/chrome.1 $PKG/usr/share/man/man1/$name.1 |
0826c9bd | 106 | |
6a3c14de VM |
107 | # fix v8 natives |
108 | cp -a out/Release/{natives,snapshot}_blob.bin $PKG/usr/lib/$name | |
0826c9bd JB |
109 | |
110 | for size in 22 24 48 128 256; do | |
6a3c14de | 111 | install -m 0644 -D chrome/app/theme/$name/product_logo_${size}.png \ |
47f61ca0 | 112 | $PKG/usr/share/icons/hicolor/${size}x${size}/apps/$name.png |
0826c9bd JB |
113 | done |
114 | ||
2fd1611b VM |
115 | # fix icu installation |
116 | cp -a out/Release/icudtl.dat $PKG/usr/lib/$name | |
117 | ||
6a3c14de VM |
118 | install -d $PKG/usr/share/pixmaps |
119 | ln -sf /usr/share/icons/hicolor/48x48/apps/$name.png $PKG/usr/share/pixmaps/$name.png | |
120 | install -m 0644 -D $SRC/$name.desktop $PKG/usr/share/applications/$name.desktop | |
121 | install -m 0755 -D $SRC/$name.sh $PKG/usr/bin/$name | |
0826c9bd | 122 | } |