aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/APKBUILD
blob: db61ca2e24d2640abd2332026906dbdc631dc7f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=chromium
pkgver=53.0.2785.143
pkgrel=0
pkgdesc="chromium web browser"
url="http://www.chromium.org/"
arch="x86_64"
license="BSD"
depends="xdg-utils"
depends_dev=""
makedepends="$depends_dev alsa-lib-dev libevent-dev libpng-dev jpeg-dev
	cairo-dev cups-dev mesa-dev libcap-dev dbus-glib-dev gtk+-dev
	libxml2-dev freetype-dev jpeg-dev libxslt-dev libxtst-dev
	flac-dev speex-dev hunspell-dev libxinerama-dev ffmpeg-dev nss-dev
	libwebp-dev bzip2-dev libvpx-dev sqlite-dev libelf-dev libgcrypt-dev
	zlib-dev gnutls-dev mesa-dev libxcursor-dev libxcomposite-dev krb5-dev
	libxrandr-dev libxscrnsaver-dev pciutils-dev eudev-dev libexif-dev
	hwdata-usb ninja libbsd-dev harfbuzz-dev snappy-dev bsd-compat-headers
	libre2-dev jsoncpp-dev minizip-dev linux-headers gzip
	xdg-utils yasm gperf bison flex perl python bash paxmark findutils"
install=""
options=suid
subpackages="$pkgname-doc $pkgname-chromedriver"
source="https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz
	chromium-launcher.sh
	chromium.conf
	chromium.desktop
	google-api.keys

	musl-fixes.patch
	no-execinfo.patch
	resolver.patch
	no-mallinfo.patch
	no-getcontext.patch
	musl-sandbox.patch
	unset-madv_free.patch
	default-pthread-stacksize.patch

	chromium-system-jinja-r7.patch
	chromium-widevine.patch

	musl-hacks.patch
	"

builddir="$srcdir"/$pkgname-$pkgver

case "${CARCH}" in
	x86_64) target_arch=x64;;
	x86) target_arch=ia32;;
	arm) target_arch=arm;;
esac

prepare() {
	cd "$builddir"

	local i
	cd "$builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done

	# Remove bundled ICU; its header files appear to get picked up instead of
	# the system ones, leading to errors during the final link stage.
	# https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/BNGvJc08B6Q
	#find third_party/icu -type f \! -regex '.*\.\(gyp\|gypi\|isolate\)' -delete

	# https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
	touch chrome/test/data/webui/i18n_process_css_test.html || return 1

}

build() {
	cd "$builddir"
	# currently does not build with system vpx 1.4
	# remoting/codec/video_encoder_vpx.cc:308:10: error:
	# 'vpx_codec_control_VP9E_GET_ACTIVEMAP' was not declared in this scope
	local vpx=0
	# reusable system library settings
	local use_system="
		-Duse_system_bzip2=1
		-Duse_system_flac=1
		-Duse_system_harfbuzz=1
		-Duse_system_icu=0
		-Duse_system_jsoncpp=1
		-Duse_system_libevent=1
		-Duse_system_libjpeg=1
		-Duse_system_libpng=1
		-Duse_system_libvpx=$vpx
		-Duse_system_libwebp=1
		-Duse_system_libxml=1
		-Duse_system_libxslt=1
		-Duse_system_minizip=1
		-Duse_system_nspr=1
		-Duse_system_re2=1
		-Duse_system_snappy=1
		-Duse_system_speex=1
		-Duse_system_xdg_utils=1
		-Duse_system_yasm=1
		-Duse_system_zlib=1
		"
	# Work around bug in v8 in which GCC 6 optimizes away null pointer checks
	# https://bugs.chromium.org/p/v8/issues/detail?id=3782
	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69234
	CFLAGS="$CFLAGS -fno-delete-null-pointer-checks"

	msg "Replacing gyp files"
	build/linux/unbundle/replace_gyp_files.py ${use_system} || return 1

	##############################################################
	# Please dont use these keys outside of Alpine Linux project #
	# You can create your own at:                                #
	# http://www.chromium.org/developers/how-tos/api-keys        #
	##############################################################
	eval "$(base64 -d < $srcdir/google-api.keys)"

	msg "Running gyp_chromium"
	build/gyp_chromium --depth=. \
		${use_system} \
		-Dgoogle_api_key="$_google_api_key" \
		-Dgoogle_default_client_id="$_google_default_client_id" \
		-Dgoogle_default_client_secret="$_google_default_client_secret" \
		-Dwerror= \
		-Dclang=0 \
		-Dpython_ver=2.7 \
		-Dlinux_link_cups=1 \
		-Dlinux_link_gsettings=1 \
		-Dlinux_link_libpci=1 \
		-Dlinux_link_libspeechd=0 \
		-Dlinux_strip_binary=1 \
		-Dlinux_use_bundled_binutils=0 \
		-Dlinux_use_bundled_gold=0 \
		-Dlinux_use_gold_flags=0 \
		-Dicu_use_data_file_flag=1 \
		-Dlogging_like_official_build=1 \
		-Dlibspeechd_h_prefix=speech-dispatcher/ \
		-Dffmpeg_branding=Chrome \
		-Dproprietary_codecs=1 \
		-Duse_allocator=none \
		-Duse_experimental_allocator_shim=false \
		-Duse_gnome_keyring=0 \
		-Dusb_ids_path=/usr/share/hwdata/usb.ids \
		-Duse_mojo=0 \
		-Duse_gconf=0 \
		-Duse_sysroot=0 \
		-Duse_pulseaudio=0 \
		-Denable_hotwording=0 \
		-Ddisable_fatal_linker_warnings=1 \
		-Ddisable_glibc=1 \
		-Ddisable_nacl=1 \
		-Ddisable_pnacl=1 \
		-Dtarget_arch="$target_arch" \
		-Drelease_extra_cflags="$CFLAGS" \
		-Ddisable_sse2=1 \
		|| return 1

	msg "Ninja turtles GO!"
	# build mksnapshot and paxmark it
	ninja -C out/Release mksnapshot || return 1
	paxmark -m out/Release/mksnapshot || return 1

	# finish rest of the build
	ninja -C out/Release chrome chrome_sandbox chromedriver || return 1
	paxmark -m out/Release/chrome || return 1
}

package() {
	cd "$builddir"
	local bin pak

	for bin in chrome natives_blob.bin snapshot_blob.bin; do
		install -Dm755 out/Release/$bin \
			"$pkgdir"/usr/lib/$pkgname/$bin || return 1
	done

        install -Dm4755 "$builddir"/out/Release/chrome_sandbox \
		"$pkgdir"/usr/lib/$pkgname/chrome-sandbox || return 1

	install -m644 "$builddir"/out/Release/icudtl.dat \
		"$pkgdir"/usr/lib/$pkgname/icudtl.dat || return 1

	for pak in out/Release/*.pak; do
		install -Dm644 $pak \
			"$pkgdir"/usr/lib/$pkgname/${pak##*/} || return 1
	done

	install -Dm755 "$srcdir"/chromium-launcher.sh \
		"$pkgdir"/usr/lib/$pkgname/chromium-launcher.sh || return 1

	cp -r out/Release/locales "$pkgdir"/usr/lib/$pkgname/ || return 1

        install -Dm644 out/Release/chrome.1 \
                "$pkgdir"/usr/share/man/man1/chrome.1 || return 1

	install -Dm644 out/Release/chrome.1 \
		"$pkgdir"/usr/share/man/man1/chromium.1 || return 1

	# It is important that we name the target "chromium-browser",
	# xdg-utils expect it; bug #355517.
	mkdir -p "$pkgdir"/usr/bin || return 1
	cd "$pkgdir"/usr/bin || return 1
	ln -sf /usr/lib/$pkgname/chromium-launcher.sh \
		chromium-browser || return 1
	cd "$builddir"

	install -Dm644 "$srcdir"/chromium.conf \
		"$pkgdir"/etc/chromium/chromium.conf || return 1

	install -Dm644 "$srcdir"/chromium.desktop \
		"$pkgdir"/usr/share/applications/chromium.desktop

	for size in 22 24 48 64 128 256; do
		install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
			"$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
	done

	for size in 16 32; do
		install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \
			"$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
	done

	install -Dm755 "$builddir"/out/Release/chromedriver \
		"$pkgdir"/usr/lib/$pkgname/chromedriver || return 1
	ln -sf /usr/lib/$pkgname/chromedriver "$pkgdir"/usr/bin/ || return 1
}

chromedriver() {
	pkgdesc="WebDriver driver for the Chromium Browser"
	mkdir -p "$subpkgdir"/usr/lib/$pkgname "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/lib/$pkgname/chromedriver \
		"$subpkgdir"/usr/lib/$pkgname/ || return 1
	mv "$pkgdir"/usr/bin/chromedriver "$subpkgdir"/usr/bin || return 1
}

md5sums="fdc737af242421b2a9a0bb84f6b17040  chromium-53.0.2785.143.tar.xz
b6d015c1da85aa65ee21bc974c7fc7d2  chromium-launcher.sh
c5aa73a87d4b88cce9f1a680ca691bb6  chromium.conf
2962ac6259e39a797d441daf43aa49c9  chromium.desktop
2d2ee5f22d65c756871301b4a407f4ca  google-api.keys
eb7ce3cac0fde703474cb127b63ba705  musl-fixes.patch
6723002017d7103639d919e2cd053fbe  no-execinfo.patch
f99a4572c0be2c2123acc2478905e01f  resolver.patch
4b69f969c7b959348cf5b10ca05eca97  no-mallinfo.patch
2c8de771a7c0e5e0e9fc68fa978785f7  no-getcontext.patch
c805e026abc748d9925fab8250760bcc  musl-sandbox.patch
183bf3b136f99a0f60f8e171ddd147e8  unset-madv_free.patch
b034187a2c9046e8bb3e56b9055c56cf  default-pthread-stacksize.patch
97b1578585ab600ed9adef4f341ccd80  chromium-system-jinja-r7.patch
de717d6430532f34fe161035dfdafcdf  chromium-widevine.patch
5f1bca53835b6380b5949c96860f6894  musl-hacks.patch"
sha256sums="c52a58b79bfb27bb87e4a0a6ff213001485fbc747657b290f75d39ddce07dcc3  chromium-53.0.2785.143.tar.xz
89f1eb19d1ed998a190045ea173959f01faee3490d58a6a34ca3fe21228e569f  chromium-launcher.sh
b466559340a36998354a0577325fe533d9e6b74c24a15b7599671171506bf128  chromium.conf
3ae90cea7503d0039de53448ed112b9bc0cb5a09f6b0045506eb777fc23517e5  chromium.desktop
267ba8ff50574e51d2582c4fca9b9e14f7225c1fa064d135cbceff9cef2324ac  google-api.keys
a620b4492cb28e4b0d571ba3b79ec7635506f297824d390167ec7391f23eb27e  musl-fixes.patch
1bc3edae8d591b7fc89d9b45d159b35f45d628bcdf8ede0684877cb2ee1c7405  no-execinfo.patch
914c513bb54d4d97cd2a7622647f6af5cd0c8d29a0aa2962a60fdbed88f54429  resolver.patch
633885c9af2b2f635e93ab0dbaa76eb72cb87d030b237459e82d35400999af83  no-mallinfo.patch
ea79f9a46116c8b56bbc69d226abd9252e4ae4d946ca695203f2298279cc2211  no-getcontext.patch
3d0303f9ea04b2c24e16068ea2d423fce0e37ebb2b89dde342f9e8f9d0b149b4  musl-sandbox.patch
178fbdd552b21b7675425067b1c6ee84f6a24ec275bb40a0769d71072adfe482  unset-madv_free.patch
67b235079c768a5fb0f93203e5f13e1e4cd78ce217c48e858bca97d123a59fb8  default-pthread-stacksize.patch
872f5a38d8263b14308bb117828496a4093d0e6ad755d39d2c5e6857314fe071  chromium-system-jinja-r7.patch
1d1ead77250475228524770e57c17282aff9098c5efc3d7719b0df76229b8874  chromium-widevine.patch
10a4d81e1d8f70e4993ba0b7e1b9069f18c28190e6660e0f67bf24d598aa7c66  musl-hacks.patch"
sha512sums="d51ee1bd60d9ac0ae2dfa66b7ba10cae479002f32995d169c181e7ef1170953069531ec786e8031d3fc4777f002b213471213b4ed3e6f1e89f851547305456b9  chromium-53.0.2785.143.tar.xz
b9a810416dd7a8ffc3a5ced85ad9acebda1665bd08a57eec7b189698cc5f74d2c3fd69044e20fcb83297a43214b2772a1312b2c6122ea0eb716abacf39524d60  chromium-launcher.sh
f6d962b9e4c22dd42183df3db5d3202dab33eccecafb1bf63ca678147289581262db1e5e64cbe8f9c212beefb0a6717bb8d311e497f56b55fe95b8bab2db493f  chromium.conf
e182c998a43d22d1c76a86c561619afd1fca8c2be668265ad5e2f81a3806f7a154272cc027a2f8b370fb69446892c69e5967a4be76082325c14245ee7915234c  chromium.desktop
2d8237a940ea691bd10b08315429677a587f7ef9692a0cca53bfd066eae82998a6c71f402a8669e9de39f94d7f3280745d1628ea6eac5d76ca7116844d4e0dac  google-api.keys
a81c323024537e02f03e3d7cfd62f7a3e0ceb6d2534d1a6169841fc58a1ccdf106ab942151b0124333b23a8955fbf6d0bc18b6dc64e9ff4cfd070abc3dd20253  musl-fixes.patch
0d0b69dcc4779f5a6e9820513e35d94c8959f8f57a8a3f9d2a63b0d48222526fc6657d6f3d23eafbf1cb2f9ad3a5d3d6f1e6b0ca7d20f17b7459979a1c5390cf  no-execinfo.patch
d60407a8faadfd2a8294570163b4d1b1112c8a70a6f8e778fc3aff25d20613a2e26c66cd87e69c54953cc1b984e4038015ad04797b0495df13932541b05398fe  resolver.patch
286f8bf4941c62b691059ad7cc1ec446a5b6ca3e4c740ecb7bd2ab1fab2e77b538bc975c6d7941b006380574758b584aa02aae3878092ac477aa0427d7d35e18  no-mallinfo.patch
42d9a6ebea2d95cdc169b921cc1a1b846cf500997059fd3084de09e21f00b63b76e60c6124f4af247d402ff5ca3f4bf8867a6f2c78198c05b4273ca01fb29241  no-getcontext.patch
ce8276bb35a8d72cf58868a6331e85286b350a1aad694525ebf637499819219dd4d87ab67dd3b938830a6bd3e7172fc9bcd9c8971820d0ed95c0d141867a24fe  musl-sandbox.patch
a86f262d6fde8497ba448052fa8777867633eff7eb71d91e56e005e2c00951a9f447d636e1bc86b682979b6746d1355963df0a6aaf4bb7ae9577226457493e09  unset-madv_free.patch
2767cbfda98a6ec40ccccab759c5de53155396c15fdb9789bf246947816e9f06833ce4730dc4845a936c1570951b88e78c098de244ee0706952375e679275ef2  default-pthread-stacksize.patch
10bcc6a467b6766d13b5e41e7b7dcdbd62de7c04daad16c83037e88043032a0c118627029f91ef8a2a57faaaebc8b6f4ee16e8d1fecb5921d0d49efd60a27863  chromium-system-jinja-r7.patch
4a11b46afa8ce84bd23a8c506301b5848ee4291a764f3aed282b8a98706ece16cf9346dec6cc71b1e17812b15f43a5cbc7bc6d38ed4dcc88c12d6fcb03bd9295  chromium-widevine.patch
4043dd7a64dcb9b73e15786b407934dd1b171df8b628ab1b18718fd93f9758c76eb25d1bdf1e1a22901544185088b8f817d3e2a58154c54949704dc8cc87b84d  musl-hacks.patch"