# Contributor: Carlo Landmeter # Maintainer: Natanael Copa pkgname=chromium pkgver=81.0.4044.129 pkgrel=0 pkgdesc="Chromium web browser" url="https://www.chromium.org/Home" arch="x86_64 aarch64 armv7" license="BSD-3-Clause" depends="xdg-utils" makedepends=" alsa-lib-dev bash binutils-gold bison flex bsd-compat-headers bzip2-dev cairo-dev clang-dev cups-dev dbus-glib-dev elfutils-dev eudev-dev ffmpeg-dev findutils flac-dev freetype-dev gnutls-dev gperf gtk+3.0-dev gzip harfbuzz-dev hunspell-dev hwids-usb jpeg-dev jsoncpp-dev krb5-dev libbsd-dev libcap-dev libevent-dev libexif-dev libgcrypt-dev libgnome-keyring-dev libjpeg-turbo-dev libpng-dev libusb-dev libva-dev libwebp-dev libxcomposite-dev libxcursor-dev libxinerama-dev libxml2-dev libxrandr-dev libxscrnsaver-dev libxslt-dev linux-headers mesa-dev minizip-dev ninja nodejs nss-dev openjdk8 opus-dev pciutils-dev perl python2 re2-dev snappy-dev speex-dev sqlite-dev xdg-utils yasm zlib-dev " # explicit depends for --headless depends="eudev-libs ttf-opensans" options="suid" subpackages="$pkgname-chromedriver" source="https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz pstables-2.8.h::https://git.savannah.gnu.org/cgit/freetype/freetype2.git/plain/src/psnames/pstables.h?h=VER-2-8 chromium-launcher.sh chromium.conf chromium.desktop google-api.keys default-pthread-stacksize.patch musl-fixes.patch musl-fixes-breakpad.patch musl-hacks.patch musl-libc++.patch musl-sandbox.patch no-execinfo.patch no-mallinfo.patch resolver.patch swiftshader.patch create-extra-view-redefinition.patch chromium-use-alpine-target.patch media-base.patch musl-crashpad.patch musl-v8-monotonic-pthread-cont_timedwait.patch nasm.patch gcc-fno-delete-null-pointer-checks.patch gcc-arm.patch aarch64-fixes.patch elf-arm.patch " # secfixes: # 72.0.3626.121-r0: # - CVE-2019-5786 if [ -n "$DEBUG" ]; then _buildtype=Debug _is_debug=true else _buildtype=Release _is_debug=false fi prepare() { patch_args="-p0" default_prepare # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion touch chrome/test/data/webui/i18n_process_css_test.html # Use the file at run time instead of effectively compiling it in sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \ -i services/device/public/cpp/usb/BUILD.gn mkdir -p third_party/node/linux/node-linux-x64/bin ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/ # reusable system library settings local use_system=" ffmpeg flac fontconfig freetype harfbuzz-ng libdrm libevent libjpeg libpng libwebp libxml libxslt opus re2 snappy yasm " for _lib in $use_system libjpeg_turbo; do msg "Removing buildscripts for system provided $_lib" find -type f -path "*third_party/$_lib/*" \ \! -path "*third_party/$_lib/chromium/*" \ \! -path "*third_party/$_lib/google/*" \ \! -path './base/third_party/icu/*' \ \! -path './third_party/libxml/*' \ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \ \! -path './third_party/yasm/run_yasm.py' \ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \ -delete done msg "Replacing gn files" python2 build/linux/unbundle/replace_gn_files.py --system-libraries \ $use_system third_party/libaddressinput/chromium/tools/update-strings.py } _gn_flags() { echo $* } build() { ############################################################## # 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 "Bootstrapping GN" local _c=$(_gn_flags is_clang=true \ use_sysroot=false \ treat_warnings_as_errors=false \ fatal_linker_warnings=false \ binutils_path=\"/usr/bin\" \ use_custom_libcxx=false \ use_gold=false \ use_allocator=\"none\" \ use_allocator_shim=false \ use_vaapi=true \ ) # AR="ar" CC="${CC:-gcc}" CXX="${CXX:-g++}" LD="${CXX:-g++}" \ CC="${CC:-clang}" CXX="${CXX:-clang++}" LD="${CXX:-clang++}" \ python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "$_c" msg "Configuring build" _c=$(_gn_flags \ blink_symbol_level=0 \ clang_use_chrome_plugins=false \ closure_compile=true \ custom_toolchain=\"//build/toolchain/linux/unbundle:default\" \ enable_hangout_services_extension=true \ enable_nacl_nonsfi=false \ enable_nacl=false \ enable_precompiled_headers=false \ fatal_linker_warnings=false \ ffmpeg_branding=\"Chrome\" \ fieldtrial_testing_like_official_build=true \ gold_path=\"/usr/bin/ld.gold\" \ google_api_key=\"$_google_api_key\" \ google_default_client_id=\"$_google_default_client_id\" \ google_default_client_secret=\"$_google_default_client_secret\" \ host_toolchain=\"//build/toolchain/linux/unbundle:default\" \ icu_use_data_file=true \ is_clang=true \ is_component_build=false \ is_debug=$_is_debug \ is_desktop_linux=true \ linux_use_bundled_binutils=false \ proprietary_codecs=true \ symbol_level=0 \ treat_warnings_as_errors=false \ use_allocator_shim=false \ use_allocator=\"none\" \ use_cups=true \ use_custom_libcxx=false \ use_gnome_keyring=false \ use_gold=false \ use_lld=false \ use_pulseaudio=false \ use_sysroot=false \ use_system_harfbuzz=true \ ) AR="ar" CC="clang" CXX="clang++" LD="clang++" NM=/usr/bin/nm \ out/Release/gn gen out/$_buildtype --args="$_c $_ca" msg "Ninja turtles GO!" # workaround parallel build ninja -C out/Release gen/ui/accessibility/ax_enums.p # build mksnapshot ninja -C out/$_buildtype mksnapshot ninja -C out/$_buildtype v8_context_snapshot_generator # final link needs lots of file descriptors ulimit -n 2048 # finish rest of the build ninja -C out/$_buildtype chrome chrome_sandbox chromedriver } package() { cd out/$_buildtype local bin pak for bin in chrome chromedriver *.bin; do install -Dm755 $bin "$pkgdir"/usr/lib/$pkgname/$bin done install -Dm755 swiftshader/libEGL.so "$pkgdir"/usr/lib/$pkgname/swiftshader/libEGL.so install -Dm755 swiftshader/libGLESv2.so "$pkgdir"/usr/lib/$pkgname/swiftshader/libGLESv2.so install -Dm4755 chrome_sandbox "$pkgdir"/usr/lib/$pkgname/chrome-sandbox install -m644 icudtl.dat "$pkgdir"/usr/lib/$pkgname/icudtl.dat install -Dm755 xdg-mime "$pkgdir"/usr/lib/$pkgname/xdg-mime install -Dm755 xdg-settings "$pkgdir"/usr/lib/$pkgname/xdg-settings for pak in *.pak; do install -Dm644 $pak "$pkgdir"/usr/lib/$pkgname/$pak done install -Dm755 "$srcdir"/chromium-launcher.sh \ "$pkgdir"/usr/lib/$pkgname/chromium-launcher.sh cp -a locales "$pkgdir"/usr/lib/$pkgname/ cp -a MEIPreload "$pkgdir"/usr/lib/$pkgname/ # It is important that we name the target "chromium-browser", # xdg-utils expect it; bug #355517. mkdir -p "$pkgdir"/usr/bin cd "$pkgdir"/usr/bin ln -sf /usr/lib/$pkgname/chromium-launcher.sh chromium-browser ln -sf /usr/lib/$pkgname/chromedriver "$pkgdir"/usr/bin/ install -Dm644 "$srcdir"/chromium.conf \ "$pkgdir"/etc/chromium/chromium.conf install -Dm644 "$srcdir"/chromium.desktop \ "$pkgdir"/usr/share/applications/chromium.desktop cd "$builddir" for size in 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 } 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/ mv "$pkgdir"/usr/bin/chromedriver "$subpkgdir"/usr/bin } sha512sums="93dfc5c1050bc226b836721d422a8d98a183fff81e91f55477dce0c650d35a95aeb89c810bea6e07ffb948ee62e8e150c8b8c5bad4658fcc215de05a681b064a chromium-81.0.4044.129.tar.xz a3bb959c65944ae2fb765725cedcffd743a58bc0c2cd1f1999d15fe79801d00f3474b08b4ed7b48859ed921eb57093d0ad09d90f201d729ed9b8a419a591ed29 pstables-2.8.h b9a810416dd7a8ffc3a5ced85ad9acebda1665bd08a57eec7b189698cc5f74d2c3fd69044e20fcb83297a43214b2772a1312b2c6122ea0eb716abacf39524d60 chromium-launcher.sh f6d962b9e4c22dd42183df3db5d3202dab33eccecafb1bf63ca678147289581262db1e5e64cbe8f9c212beefb0a6717bb8d311e497f56b55fe95b8bab2db493f chromium.conf e182c998a43d22d1c76a86c561619afd1fca8c2be668265ad5e2f81a3806f7a154272cc027a2f8b370fb69446892c69e5967a4be76082325c14245ee7915234c chromium.desktop 2d8237a940ea691bd10b08315429677a587f7ef9692a0cca53bfd066eae82998a6c71f402a8669e9de39f94d7f3280745d1628ea6eac5d76ca7116844d4e0dac google-api.keys b726ef2ecfe7d471e60d67de1e05847d214df6093b41bb2055652a9028327af19a8b10e7175467240f4dfec9e3ae97a6c4666bfd2cd6cb436c54656a085653ae default-pthread-stacksize.patch 0321c55b51af6265c39836d9e4ea5e2dde4efa9702a10a0c8fd77461f6933b349802c155df6d39072cd3b2963fdb1a4de4bfa1da1d94a95186d6395fcae8510b musl-fixes.patch 893211a39e5b5b2e1dabcac9b232d34c6048304b706029ebb25023718a1c73d9afd889e811002351befa9db5f3b4814b25c5911a3230a9729696e2b15f2bf35b musl-fixes-breakpad.patch d78479bdea1c847d6e1506421a3eb716031cd24aa979f0e653c0406b507a5a89924d15e6c603e291f1b17751fb0788571f42699214fd1462334c0daabd584ffe musl-hacks.patch 919f13a2cd65673f267321cf95c5410e65bc5264d6704d0791b25d39111282bedb425bd9824dde3b67422cfb874c86a9383ded686e39cfd4aac239edaf41cfc8 musl-libc++.patch 8d57d524978852ded41394793d611083d82241ecbc64808bbf5759d7bf0db0fe92af84935cf9e556d555f8d9963c847611413fa68634202f817b671be414c224 musl-sandbox.patch 129ec746fd951ee6d0bf0b4389b7c988523870507de1f92f5706f4eb49039d4a49ed30e92b0634e3ae521fc3e129adc1c6edc7435922fc91658d8c087520c707 no-execinfo.patch 06d6b4c466fa48f2d22c338e20458d8fa50bbbf744468f41bc3c1892e739002b1fbc5c133a37252cec4ff4f804847add6b9c0cc1f84fb276939471c09e467fb6 no-mallinfo.patch b1edab2a782a0fd554d0fcee893374282ceca797e9595f1b4dd1c4dbeb65a5d6c368f2000f8d44baea3a53880621fa33c456b663d72960e94f2e05f9ec4f7965 resolver.patch f4265df7532625070c51ac43466e3e0f21e696f90c3b6040ef62a21defa7666203ff8219d9c9a5bebc011024aff300fbcbd941cebd0df59c4bc068d8f290221e swiftshader.patch aa5e2b73196ea8db15ff995964032d3afcda9acf3f06bd3b196d9abfec022c462284a703e713b0ab7e613a384e8eaa271413025f18948443f58151974984670b create-extra-view-redefinition.patch cf9970ef403ff7a68bf08c0ba5e681eec459fcb1afb6859e5a80f4874f1b9a656377b4540eeb5208ddec570efa206f147e32718c687fa29ca3acc4fde6e8cbe8 chromium-use-alpine-target.patch 599f5ef338b5797e04436bdc88921c31365d2dea2613d40053be6e774f654e2889efb0c0bd55c2c5044a6805510fbc337da555971169a75d584fac93e18256ac media-base.patch 2e5a83826239849d096aead033eb519338b84e6fbbf58abfcd7cfe40d0b3070b66bcc825ec84406484d73d1a333f1b9d23a8ab44987ab5c8b187076c84cd668b musl-crashpad.patch 556cc2ba28184a75745f13c673605327f5be590be179eb3f941dc0abded854a814e5da1432a28fb8d4dcdcd66ffd4c94ee1a8824d2cd93b632f48e9310dbc3fa musl-v8-monotonic-pthread-cont_timedwait.patch 7957aae04e8ef3badbc98c982ba1acb1b9ef5e665440116c704512f11554d7b64ba3643b7ff7d00476a6686324033b0cf762deb78ce798619226380953b9dc9c nasm.patch 56a357668c0928bc488ccec8f53fd37fccbaefe0a185ceaf067c8c39e0fae3d2b61ca010ccabc785bec0f2e86b19f37cebb3ac344225aa8d7651c822e48c6064 gcc-fno-delete-null-pointer-checks.patch 4a7ea09356823392f75ce188973422c8978fd84f238ed0f533376c50030210323b27e8401749bfb8ebe7d02d29c4b6067259f0a1fa55f0916e9c82c29ff3a420 gcc-arm.patch 7f81d97cce25d5530a2cb84105247e3707e344a285b0ac73c2f9275eae4bcc5aea6ff27307ec6607f95c13e9e724fab0e15e6fb8a33b3a9bfe0b3dbfdfb33ae6 aarch64-fixes.patch bddf4ddaed63fbea15083d7a9e19173aa204fcdce9b4fdde2f673df71c79e56c313325a090af86e3df03034188c83c40e96b497f1f83057ed6bbbe8343490d4a elf-arm.patch"