{"action":"created","issue":{"url":"https://api.github.com/repos/archlinuxcn/repo/issues/283","repository_url":"https://api.github.com/repos/archlinuxcn/repo","labels_url":"https://api.github.com/repos/archlinuxcn/repo/issues/283/labels{/name}","comments_url":"https://api.github.com/repos/archlinuxcn/repo/issues/283/comments","events_url":"https://api.github.com/repos/archlinuxcn/repo/issues/283/events","html_url":"https://github.com/archlinuxcn/repo/issues/283","id":180461375,"number":283,"title":"Rebuild package chromium-dev with vaapi patch? if possible =)) (Included: a rough sample of a new PKGBUILD)","user":{"login":"BigEars431","id":15715121,"avatar_url":"https://avatars.githubusercontent.com/u/15715121?v=3","gravatar_id":"","url":"https://api.github.com/users/BigEars431","html_url":"https://github.com/BigEars431","followers_url":"https://api.github.com/users/BigEars431/followers","following_url":"https://api.github.com/users/BigEars431/following{/other_user}","gists_url":"https://api.github.com/users/BigEars431/gists{/gist_id}","starred_url":"https://api.github.com/users/BigEars431/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigEars431/subscriptions","organizations_url":"https://api.github.com/users/BigEars431/orgs","repos_url":"https://api.github.com/users/BigEars431/repos","events_url":"https://api.github.com/users/BigEars431/events{/privacy}","received_events_url":"https://api.github.com/users/BigEars431/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"fqj1994","id":1436410,"avatar_url":"https://avatars.githubusercontent.com/u/1436410?v=3","gravatar_id":"","url":"https://api.github.com/users/fqj1994","html_url":"https://github.com/fqj1994","followers_url":"https://api.github.com/users/fqj1994/followers","following_url":"https://api.github.com/users/fqj1994/following{/other_user}","gists_url":"https://api.github.com/users/fqj1994/gists{/gist_id}","starred_url":"https://api.github.com/users/fqj1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fqj1994/subscriptions","organizations_url":"https://api.github.com/users/fqj1994/orgs","repos_url":"https://api.github.com/users/fqj1994/repos","events_url":"https://api.github.com/users/fqj1994/events{/privacy}","received_events_url":"https://api.github.com/users/fqj1994/received_events","type":"User","site_admin":false},"assignees":[{"login":"fqj1994","id":1436410,"avatar_url":"https://avatars.githubusercontent.com/u/1436410?v=3","gravatar_id":"","url":"https://api.github.com/users/fqj1994","html_url":"https://github.com/fqj1994","followers_url":"https://api.github.com/users/fqj1994/followers","following_url":"https://api.github.com/users/fqj1994/following{/other_user}","gists_url":"https://api.github.com/users/fqj1994/gists{/gist_id}","starred_url":"https://api.github.com/users/fqj1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fqj1994/subscriptions","organizations_url":"https://api.github.com/users/fqj1994/orgs","repos_url":"https://api.github.com/users/fqj1994/repos","events_url":"https://api.github.com/users/fqj1994/events{/privacy}","received_events_url":"https://api.github.com/users/fqj1994/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-10-01T15:08:28Z","updated_at":"2016-10-04T17:56:07Z","closed_at":null,"body":"Hi,\r\n\r\nAgain, thank you for maintaining this really awesome repo. Really helps me alot as a web-developer. \r\n\r\nChromium-dev in the AUR used to be compiled with the VAAPI patch; however; ever since the 55.0.XXXX.Y-Z release the patch is disabled by default as indicated by the maintainer, sl1pkn07\r\n\r\n` \"Now pushed the option for enable the vaapi patch (disabled by default, to enable, you need set 1 the option _patch_vaapi in the PKGBUILD)\" `\r\n\r\nI believe that's in line 17 \r\n\r\nThe VAAPI patch is something, I believe, will benefit the people downloading chromium-dev from this repo, including me of course\r\n\r\nNew PKGBUILD should look something like this... Hope it compiles =))\r\n\r\n```\r\n# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>\r\n# Contributor: Mikhail Vorozhtsov <mikhail.vorozhtsov@gmail.com>\r\n# Contributor: Nagisa <simonas@kazlauskas.me>\r\n# Contributor: Misc <andreas.reis@gmail.com>\r\n# Contributor: Jeagoss <jgoliver@jeago.com>\r\n# Contributor: Saikrishna Arcot <saiarcot895@gmail.com> (Author of enable_vaapi_on_linux.diff)\r\n\r\n#########################\r\n## -- Build options -- ##\r\n#########################\r\n\r\n_use_clang=1           # Use clang compiler (downloaded binaries from google). Results in faster build and smaller chromium.\r\n_use_ccache=0          # Use ccache when build.\r\n_use_pax=0             # Set 1 to change PaX permisions in executables NOTE: only use if use PaX environment.\r\n_use_gtk3=1            # If set 1, then build with GTK3 support, if set 0, then build with GTK2.\r\n_debug_mode=0          # Build in debug mode.\r\n_patch_vaapi=1         # Apply the vaapi patch by Saikrishna Arcot.\r\n\r\n\r\n##############################################\r\n## -- Package and components information -- ##\r\n##############################################\r\npkgname=chromium-dev\r\npkgver=55.0.2873.4\r\n_launcher_ver=3\r\npkgrel=1\r\npkgdesc=\"The open-source project behind Google Chrome (Dev Channel)\"\r\narch=('i686' 'x86_64')\r\nurl='http://www.chromium.org'\r\nlicense=('BSD')\r\ndepends=('desktop-file-utils'\r\n         'jsoncpp'\r\n#          'libsrtp'\r\n         'libwebp'\r\n         'libxslt'\r\n         'libxss'\r\n         'minizip'\r\n         'perl-file-basedir'\r\n         'nss'\r\n         'pciutils'\r\n         're2'\r\n         'snappy'\r\n         'speech-dispatcher'\r\n         'speex'\r\n         'xdg-utils'\r\n#          'opus'\r\n#          'protobuf'\r\n#          'libevent'\r\n         'libvpx.so'\r\n         'ffmpeg'\r\n         )\r\nmakedepends=('libexif'\r\n             'elfutils'\r\n             'gperf'\r\n             'ninja'\r\n             'perl-json'\r\n             'python2-beautifulsoup4'\r\n             'python2-html5lib'\r\n             'python2-simplejson'\r\n             'python2-jinja'\r\n             'python2-ply'\r\n             'subversion'\r\n             'yasm'\r\n             'git'\r\n             'imagemagick'\r\n             'hwids'\r\n             )\r\noptdepends=('pepper-flash: PPAPI Flash Player'\r\n            'chromium-widevine-dev: Widevine plugin (eg: Netflix) (Dev Channel)'\r\n            #\r\n            'kdebase-kdialog: Needed for file dialogs in KDE4/KF5'\r\n            'kdialog-git: Needed for file dialogs in KF5'\r\n            #\r\n            'kwalletmanager: Needed for storing passwords in KWallet'\r\n            #\r\n            'libexif: Need for read EXIF metadata'\r\n            'ttf-font: For some typography'\r\n            )\r\nsource=( #\"https://gsdview.appspot.com/chromium-browser-official/chromium-${pkgver}.tar.xz\"\r\n        \"https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${pkgver}.tar.xz\"\r\n        \"chromium-launcher-${_launcher_ver}.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v${_launcher_ver}.tar.gz\"\r\n        'chromium-dev.svg'\r\n        'BUILD.gn'\r\n        # Patch form Gentoo\r\n        'https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-system-ffmpeg-r4.patch'\r\n        'https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-system-jinja-r14.patch'\r\n        'https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-system-zlib-r1.patch'\r\n        'https://raw.githubusercontent.com/gentoo/gentoo/master/www-client/chromium/files/chromium-gn-r7.patch'\r\n        # Misc Patches\r\n        'https://launchpad.net/~saiarcot895/+archive/ubuntu/chromium-dev/+files/chromium-browser_55.0.2868.3-0ubuntu1~ppa2~16.10.1.debian.tar.xz'\r\n        'minizip.patch::http://pastebin.com/raw/QCqSDam5'\r\n        'unset-madv_free.patch'\r\n        # Patch from crbug (chromium bugtracker)\r\n        'chromium-widevine-r1.patch'\r\n        )\r\nsha256sums=( #\"$(curl -sL https://gsdview.appspot.com/chromium-browser-official/chromium-55.0.2873.0.tar.xz.hashes | grep sha256 | cut -d ' ' -f3)\"\r\n            \"$(curl -sL https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${pkgver}.tar.xz.hashes | grep sha256 | cut -d ' ' -f3)\"\r\n            '8b01fb4efe58146279858a754d90b49e5a38c9a0b36a1f84cbb7d12f92b84c28'\r\n            'dd2b5c4191e468972b5ea8ddb4fa2e2fa3c2c94c79fc06645d0efc0e63ce7ee1'\r\n            'c7d9974834fc3803b5f1a1d310ff391306964caaabc807a62f8e5c3d38526ee6'\r\n            # Patch form Gentoo\r\n            'e3c474dbf3822a0be50695683bd8a2c9dfc82d41c1524a20b4581883c0c88986'\r\n            'a9cb08fbac8ffcf6371edd7ab67833efd42c5b92938f1e2e7922d1d22d226db8'\r\n            '9e7bd19f8ee7a67393d0f7f50f5f27e52cb943602107d3784a28f31cf684748c'\r\n            '90cb9498355c420b5b81873d4339a8fe45e96b206296968ea5f01b5a7de16b78'\r\n            # Misc Patches\r\n            'd5df04b9a828e9449309ef021be824344fb26bc9ce3955c292ad160c2613b82c'\r\n            'c1131b4f969d4ff20208aa26bada30b75752c1c18853a2aa41d40901f53c8f31'\r\n            '3b3aa9e28f29e6f539ed1c7832e79463b13128863a02e9c6fecd16c30d61c227'\r\n            # Patch from crbug (chromium bugtracker)\r\n            '0d537830944814fe0854f834b5dc41dc5fc2428f77b2ad61d4a5e76b0fe99880'\r\n            )\r\noptions=('!strip')\r\ninstall=chromium-dev.install\r\nnoextract=('chromium-browser_55.0.2868.3-0ubuntu1~ppa2~16.10.1.debian.tar.xz')\r\n\r\n################################################\r\n## -- Don't touch anything below this line -- ##\r\n################################################\r\n\r\n# Build Debug mode?.\r\nif [ \"${_debug_mode}\" = \"1\" ]; then\r\n  _debug_flag=\"symbol_level=1\"\r\n  _strip=false\r\nelif [ \"${_debug_mode}\" = \"0\" ]; then\r\n  _strip=true\r\nfi\r\n\r\n# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)\r\n# NOTE: These are for Arch Linux use ONLY. For your own distribution, please\r\n# get your own set of keys. Feel free to contact foutrelis@archlinux.org for\r\n# more information.\r\n_google_api_key=\"AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM\"\r\n_google_default_client_id=\"413772536636.apps.googleusercontent.com\"\r\n_google_default_client_secret=\"0ZChLK6AxeA3Isu96MkwqDR4\"\r\n\r\n# Build NaCL?. disabled if detect 32bit system\r\nif [ \"${CARCH}\" = \"i686\" ]; then\r\n  _build_nacl=0\r\n  _nacl=\"false\"\r\nelif [ \"${CARCH}\" = \"x86_64\" ]; then\r\n  _build_nacl=1\r\n  _nacl=\"true\"\r\n  makedepends+=('ncurses5-compat-libs')\r\nfi\r\n\r\n# If use PaX environment.\r\nif [ \"${_use_pax}\" = \"1\" ]; then\r\n  makedepends+=('paxctl')\r\nfi\r\n\r\n# Build with GTK3?.\r\nif [ \"${_use_gtk3}\" = \"1\" ]; then\r\n  depends+=('gtk3')\r\n  _launcher_gtk='GTK=3'\r\n  optdepends+=('libappindicator-gtk3: Needed for show systray icon in the panel in plasma-next (KF5)')\r\n  _gtk3=true\r\nelif [ \"${_use_gtk3}\" = \"0\" ]; then\r\n  depends+=('gtk2')\r\n  optdepends+=('libappindicator-gtk2: Needed for show systray icon in the panel in plasma-next (KF5)')\r\n  _gtk3=false\r\nfi\r\n\r\n# Need you use ccache?.\r\nif [ \"${_use_ccache}\" = \"1\" ]; then\r\n  makedepends+=('ccache')\r\n  export CCACHE_CPP2=yes\r\n  export CCACHE_SLOPPINESS=time_macros\r\n  _ccache='ccache'\r\nfi\r\n\r\n# Are you use gnome-keyring/gnome?.\r\n_gnome_keyring=false\r\nif [ -e /usr/lib/security/pam_gnome_keyring.so ]; then\r\n  depends+=('gnome-keyring')\r\n  _gnome_keyring=true\r\nfi\r\n\r\n# Are you use Pulseaudio?.\r\n_pulseaudio=false\r\nif [ -e /usr/lib/pulseaudio/libpulsecore-9.0.so ]; then\r\n  depends+=('pulseaudio')\r\n  _pulseaudio=true\r\nfi\r\n\r\n# List of third-party components needed for build chromium. The rest is remove by remove_bundled_libraries srcipt in prepare().\r\n_keeplibs=('base/third_party/dmg_fp'\r\n           'base/third_party/dynamic_annotations'\r\n           'base/third_party/icu'\r\n           'base/third_party/libevent'\r\n           'base/third_party/nspr'\r\n           'base/third_party/superfasthash'\r\n           'base/third_party/symbolize'\r\n           'base/third_party/valgrind'\r\n           'base/third_party/xdg_mime'\r\n           'base/third_party/xdg_user_dirs'\r\n           'breakpad/src/third_party/curl'\r\n           'chrome/third_party/mozilla_security_manager'\r\n           'courgette/third_party'\r\n           'native_client/src/third_party/dlmalloc'\r\n           'native_client_sdk/src/libraries/third_party/newlib-extras'\r\n           'net/third_party/mozilla_security_manager'\r\n           'net/third_party/nss'\r\n           'third_party/WebKit'\r\n           'third_party/adobe'\r\n           'third_party/analytics'\r\n           'third_party/angle'\r\n           'third_party/angle/src/common/third_party/numerics'\r\n           'third_party/angle/src/third_party/compiler'\r\n           'third_party/angle/src/third_party/murmurhash'\r\n           'third_party/angle/src/third_party/trace_event'\r\n           'third_party/angle/src/third_party/libXNVCtrl'\r\n           'third_party/boringssl'\r\n           'third_party/brotli'\r\n           'third_party/cacheinvalidation'\r\n           'third_party/catapult'\r\n           'third_party/catapult/third_party/polymer'\r\n           'third_party/catapult/third_party/py_vulcanize'\r\n           'third_party/catapult/third_party/py_vulcanize/third_party/rcssmin'\r\n           'third_party/catapult/third_party/py_vulcanize/third_party/rjsmin'\r\n           'third_party/catapult/tracing/third_party/d3'\r\n           'third_party/catapult/tracing/third_party/gl-matrix'\r\n           'third_party/catapult/tracing/third_party/jszip'\r\n           'third_party/catapult/tracing/third_party/mannwhitneyu'\r\n           'third_party/ced'\r\n           'third_party/cld_2'\r\n           'third_party/cld_3'\r\n           'third_party/cros_system_api'\r\n           'third_party/devscripts'\r\n           'third_party/dom_distiller_js'\r\n           'third_party/fips181'\r\n           'third_party/flatbuffers'\r\n           'third_party/flot'\r\n           'third_party/google_input_tools'\r\n           'third_party/google_input_tools/third_party/closure_library'\r\n           'third_party/google_input_tools/third_party/closure_library/third_party/closure'\r\n           'third_party/hunspell'\r\n           'third_party/iccjpeg'\r\n           'third_party/jstemplate'\r\n           'third_party/khronos'\r\n           'third_party/leveldatabase'\r\n           'third_party/libXNVCtrl'\r\n           'third_party/libaddressinput'\r\n           'third_party/libjingle'\r\n           'third_party/libphonenumber'\r\n           'third_party/libsecret'\r\n           'third_party/libsrtp'\r\n           'third_party/libudev'\r\n           'third_party/libusb'\r\n           'third_party/libva'\r\n           'third_party/libwebm'\r\n           'third_party/libxml/chromium'\r\n           'third_party/libyuv'\r\n           'third_party/lss'\r\n           'third_party/lzma_sdk'\r\n           'third_party/mesa'\r\n           'third_party/modp_b64'\r\n           'third_party/mt19937ar'\r\n           'third_party/openh264'\r\n           'third_party/openmax_dl'\r\n           'third_party/opus'\r\n           'third_party/ots'\r\n           'third_party/pdfium'\r\n           'third_party/pdfium/third_party/agg23'\r\n           'third_party/pdfium/third_party/base'\r\n           'third_party/pdfium/third_party/bigint'\r\n           'third_party/pdfium/third_party/freetype'\r\n           'third_party/pdfium/third_party/lcms2-2.6'\r\n           'third_party/pdfium/third_party/libjpeg'\r\n           'third_party/pdfium/third_party/libopenjpeg20'\r\n           'third_party/pdfium/third_party/libpng16'\r\n           'third_party/pdfium/third_party/libtiff'\r\n           'third_party/pdfium/third_party/zlib_v128'\r\n           'third_party/polymer'\r\n           'third_party/protobuf'\r\n           'third_party/protobuf/third_party/six'\r\n           'third_party/qcms'\r\n           'third_party/sfntly'\r\n           'third_party/skia'\r\n           'third_party/smhasher'\r\n           'third_party/speech-dispatcher'\r\n           'third_party/sqlite'\r\n           'third_party/tcmalloc'\r\n           'third_party/usb_ids'\r\n           'third_party/usrsctp'\r\n           'third_party/web-animations-js'\r\n           'third_party/webdriver'\r\n           'third_party/webrtc'\r\n           'third_party/widevine'\r\n           'third_party/woff2'\r\n           'third_party/x86inc'\r\n           'third_party/xdg-utils'\r\n           'third_party/yasm/run_yasm.py'\r\n           'third_party/zlib/google'\r\n           'url/third_party/mozilla'\r\n           'v8/src/third_party/valgrind'\r\n           )\r\n\r\n# Set build flags.\r\n\r\n_flags=('is_debug=false'\r\n        'enable_widevine=true'\r\n        'enable_hangout_services_extension=false'\r\n        \"ffmpeg_branding=\\\"ChromeOS\\\"\"\r\n        'proprietary_codecs=true'\r\n        \"google_api_key=\\\"${_google_api_key}\\\"\"\r\n        \"google_default_client_id=\\\"${_google_default_client_id}\\\"\"\r\n        \"google_default_client_secret=\\\"${_google_default_client_secret}\\\"\"\r\n        'fieldtrial_testing_like_official_build=false'\r\n        \"remove_webcore_debug_symbols=${_strip}\"\r\n        'use_gconf=false'\r\n        \"use_gio=false\"\r\n        \"use_gnome_keyring=${_gnome_keyring}\"\r\n        \"use_gtk3=${_gtk3}\"\r\n        \"use_pulseaudio=${_pulseaudio}\"\r\n        \"link_pulseaudio=${_pulseaudio}\"\r\n        'use_kerberos=true'\r\n        'use_cups=true'\r\n        'use_sysroot=false'\r\n        'use_gold=false'\r\n        \"use_allocator=\\\"none\\\"\"\r\n        'linux_use_bundled_binutils=false'\r\n        'fatal_linker_warnings=false'\r\n        'treat_warnings_as_errors=false'\r\n        \"enable_nacl=${_nacl}\"\r\n        \"enable_nacl_nonsfi=${_nacl}\"\r\n        )\r\n\r\n# Set the bundled/external components.\r\n# TODO: need ported to GN as GYP doing before. see status page: https://crbug.com/551343\r\n# hunspell\r\n# libusb\r\n# opus\r\n# sqlite\r\n# ssl\r\n# libsrtp\r\n# protobuf\r\n\r\n_use_system=('ffmpeg'\r\n             'flac'\r\n             'harfbuzz-ng'\r\n#              'libevent' # Get segfaults and other problems https://bugs.gentoo.org/593458\r\n             'libjpeg'\r\n             'libpng'\r\n             'libvpx'\r\n             'libwebp'\r\n             'libxml'\r\n             'libxslt'\r\n             're2'\r\n             'snappy'\r\n             'yasm'\r\n             'zlib'\r\n             )\r\n\r\n# Conditionals.\r\nif [ \"${_debug_mode}\" = \"1\" ]; then\r\n  _keeplibs+=('native_client/src/third_party/valgrind')\r\nfi\r\n\r\nif [ \"${_build_nacl}\" = \"1\" ]; then\r\n  _keeplibs+=('third_party/icu')\r\nelif [ \"${_build_nacl}\" = \"0\" ]; then\r\n  depends+=('icu')\r\n  _use_system+=('icu')\r\nfi\r\n\r\n################################################\r\n\r\nprepare() {\r\n\r\n  # Use custom toolchain.\r\n  _flags+=(\"custom_toolchain=\\\"${srcdir}:default\\\"\")\r\n\r\n  # Set Python2 path.\r\n  mkdir -p python-path\r\n  ln -s /usr/bin/python2 \"${srcdir}/python-path/python\"\r\n  export PATH=\"${srcdir}/python-path:$PATH\"\r\n\r\n  cd \"chromium-${pkgver}\"\r\n\r\n  # Fix to save configuration in ~/.config/chromium-dev.\r\n  sed -e 's|filename = \"chromium-browser\"|filename = \"chromium-dev\"|' \\\r\n      -e 's|confdir = \"chromium\"|confdir = \"chromium-dev\"|' \\\r\n      -i chrome/BUILD.gn\r\n  sed -e 's|config_dir.Append(\"chromium\")|config_dir.Append(\"chromium-dev\")|' \\\r\n      -i chrome/common/chrome_paths_linux.cc\r\n\r\n  msg2 \"Patching the sources\"\r\n  # Patch sources from Gentoo.\r\n  patch -p1 -i \"${srcdir}/chromium-system-ffmpeg-r4.patch\"\r\n  patch -p1 -i \"${srcdir}/chromium-system-jinja-r14.patch\"\r\n  patch -p1 -i \"${srcdir}/chromium-system-zlib-r1.patch\"\r\n  patch -p1 -i \"${srcdir}/chromium-gn-r7.patch\"\r\n\r\n  # Misc Patches:\r\n  if [ \"${_patch_vaapi}\" = \"1\" ]; then\r\n    (cd \"${srcdir}\"; bsdtar -xf \"chromium-browser_55.0.2868.3-0ubuntu1~ppa2~16.10.1.debian.tar.xz\" debian/patches/enable_vaapi_on_linux.diff; mv debian/patches/enable_vaapi_on_linux.diff .; rm -fr debian)\r\n    patch -p1 -i \"${srcdir}/enable_vaapi_on_linux.diff\"\r\n  elif [ \"${_patch_vaapi}\" = \"0\" ]; then\r\n    # Fix paths.\r\n    sed -e 's|/usr/lib/|/usr/lib32/|g' \\\r\n        -e 's|/usr/lib64/|/usr/lib/|g' \\\r\n        -i content/common/sandbox_linux/bpf_gpu_policy_linux.cc\r\n  fi\r\n  patch -p1 -i \"${srcdir}/minizip.patch\"\r\n  patch -p1 -i \"${srcdir}/unset-madv_free.patch\"\r\n\r\n  # Patch from crbug (chromium bugtracker).\r\n  # https://crbug.com/473866\r\n  patch -p0 -i \"${srcdir}/chromium-widevine-r1.patch\"\r\n  sed 's|@WIDEVINE_VERSION@|The Cake Is a Lie|g' -i \"third_party/widevine/cdm/stub/widevine_cdm_version.h\"\r\n\r\n  ##\r\n  # Fix libpng errors.\r\n  msg2 \"Attempt for fix libpng errors\"\r\n  for _path in 'chrome/app/theme' 'chrome/renderer' 'ui'; do\r\n    pushd \"${_path}\" &> /dev/null\r\n    export IFS=$'\\n'\r\n    for i in $(find . -name '*.png' -type f); do\r\n      mogrify \"${i}\" &> /dev/null\r\n    done\r\n    export IFS=' '\r\n    popd &> /dev/null\r\n  done\r\n\r\n  # Make it possible to remove third_party/adobe.\r\n  echo > \"${srcdir}/flapper_version.h\"\r\n\r\n  # Remove most bundled libraries. Some are still needed.\r\n  msg2 \"Removing unnecessary components to save space\"\r\n  python2 build/linux/unbundle/remove_bundled_libraries.py ${_keeplibs[@]} --do-remove\r\n  rm -fr native_client/toolchain\r\n  rm -fr build/linux/debian*\r\n\r\n  msg2 \"Make sure use Python2\"\r\n  find . -name '*.py' -exec sed -r 's|/usr/bin/python$|&2|g' -i {} +\r\n  find . -name '*.py' -exec sed -r 's|/usr/bin/env python$|&2|g' -i {} +\r\n\r\n  touch chrome/test/data/webui/i18n_process_css_test.html\r\n\r\n  # Changing bundle libraries to system ones.\r\n  python2 build/linux/unbundle/replace_gn_files.py --system-libraries ${_use_system[@]}\r\n\r\n  # update libaddressinput strings.\r\n  python2 third_party/libaddressinput/chromium/tools/update-strings.py\r\n\r\n  # Use the file at run time instead of effectively compiling it in.\r\n  sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' -i device/usb/BUILD.gn\r\n\r\n  if [ \"${_build_nacl}\" = \"1\" ]; then\r\n    msg2 \"Setup NaCl/PNaCl SDK: Download and install NaCl/PNaCl toolchains\"\r\n    python2 build/download_nacl_toolchains.py --packages nacl_x86_newlib,pnacl_newlib,pnacl_translator sync --extract\r\n    # Download clang from google. need for build NaCl. also is used by build the project in x86_64 systems when use clang\r\n    python2 tools/clang/scripts/update.py\r\n  fi\r\n\r\n  # Setup compilers.\r\n  # Use system/bundled Clang? or GCC?.\r\n  if [ \"${_use_clang}\" = \"0\" ]; then\r\n    _flags+=('is_clang=false'\r\n             'clang_use_chrome_plugins=false'\r\n             )\r\n    export CC=\"${_ccache} gcc -Wall\"\r\n    export CXX=\"${_ccache} g++ -Wall\"\r\n  elif [ \"${_use_clang}\" = \"1\" ]; then\r\n    if [ \"${CARCH}\" = 'i686' ]; then\r\n      msg2 \"Build with (bundled) clang is not possible in 32bit systems. then, Use system GCC\"\r\n      _flags+=('is_clang=false'\r\n               'clang_use_chrome_plugins=false'\r\n               )\r\n      export CC=\"${_ccache} gcc -Wall\"\r\n      export CXX=\"${_ccache} g++ -Wall\"\r\n    elif [ \"${CARCH}\" = 'x86_64' ]; then\r\n      msg2 \"Setup for use clang\"\r\n      _flags+=('is_clang=true'\r\n               'clang_use_chrome_plugins=true'\r\n               )\r\n      _clang_path=\"${srcdir}/chromium-${pkgver}/third_party/llvm-build/Release+Asserts/bin\"\r\n      export CXXFLAGS=\"${CXXFLAGS} -Wno-unknown-warning-option\"\r\n      export CC=\"${_ccache} ${_clang_path}/clang -Qunused-arguments\"\r\n      export CXX=\"${_ccache} ${_clang_path}/clang++ -Qunused-arguments\"\r\n    fi\r\n  fi\r\n}\r\n\r\nbuild() {\r\n\r\n  msg2 \"Build the Launcher\"\r\n  make -C \"chromium-launcher-${_launcher_ver}\" CHROMIUM_SUFFIX=\"-dev\" PREFIX=/usr ${_launcher_gtk}\r\n\r\n  cd \"chromium-${pkgver}\"\r\n\r\n  msg2 \"Starting building Chromium...\"\r\n  # Configure the builder.\r\n  python2 tools/gn/bootstrap/bootstrap.py -v --gn-gen-args \"${_flags[*]} ${_debug_flag}\"\r\n  out/Release/gn gen out/Release -v --args=\"${_flags[*]} ${_debug_flag}\" --script-executable=/usr/bin/python2\r\n\r\n  # Build mksnapshot and pax-mark it.\r\n  if [ \"${_use_pax}\" = \"1\" ]; then\r\n    ninja -C out/Release -v mksnapshot\r\n    paxctl -cm out/Release/mksnapshot\r\n  fi\r\n\r\n  # Build all with ninja.\r\n  LC_ALL=C ninja -C out/Release -v pdf chrome chrome_sandbox chromedriver widevinecdmadapter clearkeycdm\r\n\r\n  # Pax-mark again.\r\n  if [ \"${_use_pax}\" = \"1\" ]; then\r\n    paxctl -cm out/Release/chrome\r\n  fi\r\n}\r\n\r\npackage() {\r\n  # Install launcher.\r\n  make -C \"chromium-launcher-${_launcher_ver}\" CHROMIUM_SUFFIX=\"-dev\" PREFIX=/usr DESTDIR=\"${pkgdir}\" install-strip\r\n  install -Dm644 \"chromium-launcher-${_launcher_ver}/LICENSE\" \"${pkgdir}/usr/share/licenses/chromium-dev/LICENSE.launcher\"\r\n\r\n  pushd \"chromium-${pkgver}/out/Release\" &> /dev/null\r\n\r\n  if [ \"${_debug_mode}\" = \"1\" ]; then\r\n    # Build with debug needs a tons of space. remove this save that space, but break the rebuild process.\r\n    rm -fr \"chromium-launcher-${_launcher_ver}/third_party\"\r\n  fi\r\n\r\n  # Install binaries.\r\n  install -Dm755 chrome \"${pkgdir}/usr/lib/chromium-dev/chromium-dev\"\r\n  install -Dm644 chrome.1 \"${pkgdir}/usr/share/man/man1/chromium-dev.1\"\r\n  install -Dm4755 chrome_sandbox \"${pkgdir}/usr/lib/chromium-dev/chrome-sandbox\"\r\n  install -Dm755 chromedriver \"${pkgdir}/usr/lib/chromium-dev/chromedriver\"\r\n  ln -s /usr/lib/chromium-dev/chromedriver \"${pkgdir}/usr/bin/chromedriver-dev\"\r\n\r\n  # Install libs.\r\n  for i in libwidevinecdmadapter libclearkeycdm; do\r\n    install -Dm755 \"${i}.so\" \"${pkgdir}/usr/lib/chromium-dev/${i}.so\"\r\n  done\r\n  install -Dm644 natives_blob.bin \"${pkgdir}/usr/lib/chromium-dev/natives_blob.bin\"\r\n  install -Dm644 snapshot_blob.bin \"${pkgdir}/usr/lib/chromium-dev/snapshot_blob.bin\"\r\n\r\n  _resources=('chrome_100_percent'\r\n              'chrome_200_percent'\r\n              'keyboard_resources'\r\n              'mus_app_resources_100'\r\n              'mus_app_resources_200'\r\n              'mus_app_resources_strings'\r\n              'resources'\r\n              'views_mus_resources'\r\n              )\r\n  # Install Resources.\r\n  for i in \"${_resources[@]}\"; do\r\n    install -Dm644 \"${i}.pak\" \"${pkgdir}/usr/lib/chromium-dev/${i}.pak\"\r\n  done\r\n\r\n  # Install locales.\r\n  find locales -type f -name \"*.pak\" -exec install -Dm644 '{}' \"${pkgdir}/usr/lib/chromium-dev/{}\" \\;\r\n  find resources -type f -name \"*\" -exec install -Dm644 '{}' \"${pkgdir}/usr/lib/chromium-dev/{}\" \\;\r\n  (cd \"${pkgdir}/usr/lib/chromium-dev\"; ln -s locales remote_locales)\r\n\r\n  # Install icons.\r\n  for _size in 16 22 24 32 48 128 256; do\r\n    case \"${_size}\" in\r\n      16|32) _branding=\"${srcdir}/chromium-${pkgver}/chrome/app/theme/default_100_percent/chromium\" ;;\r\n      *) _branding=\"${srcdir}/chromium-${pkgver}/chrome/app/theme/chromium\" ;;\r\n    esac\r\n    install -Dm644 \"${_branding}/product_logo_${_size}.png\" \"${pkgdir}/usr/share/icons/hicolor/${_size}x${_size}/apps/chromium-dev.png\"\r\n  done\r\n\r\n  # Install NaCL stuff if is detected.\r\n  if [ \"${_build_nacl}\" = \"1\" ]; then\r\n    install -Dm755 nacl_helper \"${pkgdir}/usr/lib/chromium-dev/nacl_helper\"\r\n    install -Dm755 nacl_helper_bootstrap \"${pkgdir}/usr/lib/chromium-dev/nacl_helper_bootstrap\"\r\n    install -Dm755 nacl_helper_nonsfi \"${pkgdir}/usr/lib/chromium-dev/nacl_helper_nonsfi\"\r\n    install -Dm755 \"nacl_irt_x86_64.nexe\" \"${pkgdir}/usr/lib/chromium-dev/nacl_irt_x86_64.nexe\"\r\n    install -Dm644 icudtl.dat \"${pkgdir}/usr/lib/chromium-dev/icudtl.dat\"\r\n  fi\r\n\r\n  popd &> /dev/null\r\n\r\n  # Install some external files.\r\n  install -Dm644 \"chromium-${pkgver}/chrome/installer/linux/common/desktop.template\" \"${pkgdir}/usr/share/applications/chromium-dev.desktop\"\r\n  sed -e 's|@@MENUNAME@@|Chromium-dev|g' \\\r\n      -e 's|@@USR_BIN_SYMLINK_NAME@@|chromium-dev|g' \\\r\n      -e 's|@@PACKAGE@@|chromium-dev|g' \\\r\n      -i \"${pkgdir}/usr/share/applications/chromium-dev.desktop\"\r\n  install -Dm644 chromium-dev.svg \"${pkgdir}/usr/share/icons/hicolor/scalable/apps/chromium-dev.svg\"\r\n  install -Dm644 \"chromium-${pkgver}/LICENSE\" \"${pkgdir}/usr/share/licenses/chromium-dev/LICENSE\"\r\n\r\n  if [ \"${_debug_mode}\" = \"0\" ]; then\r\n    # Manually strip binaries so that 'nacl_irt_*.nexe' is left intact.\r\n    if [ \"${_build_nacl}\" = \"1\" ]; then\r\n      strip $STRIP_BINARIES \"${pkgdir}/usr/lib/chromium-dev/\"nacl_helper{,_bootstrap,_nonsfi}\r\n    fi\r\n    strip $STRIP_BINARIES \"${pkgdir}/usr/lib/chromium-dev/\"{chromium-dev,chrome-sandbox,chromedriver}\r\n    strip $STRIP_SHARED \"${pkgdir}/usr/lib/chromium-dev/\"lib{widevinecdmadapter,clearkeycdm}.so\r\n  fi\r\n}\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/archlinuxcn/repo/issues/comments/251463357","html_url":"https://github.com/archlinuxcn/repo/issues/283#issuecomment-251463357","issue_url":"https://api.github.com/repos/archlinuxcn/repo/issues/283","id":251463357,"user":{"login":"fqj1994","id":1436410,"avatar_url":"https://avatars.githubusercontent.com/u/1436410?v=3","gravatar_id":"","url":"https://api.github.com/users/fqj1994","html_url":"https://github.com/fqj1994","followers_url":"https://api.github.com/users/fqj1994/followers","following_url":"https://api.github.com/users/fqj1994/following{/other_user}","gists_url":"https://api.github.com/users/fqj1994/gists{/gist_id}","starred_url":"https://api.github.com/users/fqj1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fqj1994/subscriptions","organizations_url":"https://api.github.com/users/fqj1994/orgs","repos_url":"https://api.github.com/users/fqj1994/repos","events_url":"https://api.github.com/users/fqj1994/events{/privacy}","received_events_url":"https://api.github.com/users/fqj1994/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T17:56:07Z","updated_at":"2016-10-04T17:56:07Z","body":"I updated this manually, and it's building now.  I'll upload it to archlinuxcn/ tomorrow (Europe Central Time) if the build succeded.\r\nAnd updated to code to replace _vaapi to 1 by default.\r\nbut before aur fixes the problem the file name in\r\nnoextract= (L115), the preprare (L397) function \r\nand the downloaded url (L90)\r\nare not consistent, the automatic build will fail for further updates.\r\n"}}
{"actor":{"display_login":"fqj1994"}}