Chromium60编译说明

  • 系统说明
    • Fedora21系统(Loongson发布的loongnix系统版本为主)—-推荐
    • Deepin系统
    • 其它系统也可进行源码编译,依赖库有所区别,其它过程都是一样的
  • 代码下载
     git clone http://cgit.loongnix.org/cgit/chromium60
     或者
     git clone git://cgit.loongnix.org/browser/chrome60.git
  • 环境配置
 1)安装依赖库
 Loongnix系统
 yum install gcc-c++ alsa-lib-devel ninja-build atk-devel bison cups-devel dbus-devel expat-devel flex fontconfig-devel GConf2-devel glib2-devel 
 yum install gtk3-devel glibc-devel gperf libatomic libcap-devel libdrm-devel libgcrypt-devel libudev-devel libusb-devel libXdamage-devel libXScrnSaver-devel 
 yum install libappstream-glib libgnome-keyring-devel gnome-keyring-devel gtk2-devel 
 yum install libstdc++-devel openssl-devel libXtst-devel nodejs nss-devel pciutils-devel   pulseaudio-libs-devel npm 
 yum install bzip2-devel dbus-glib-devel  elfutils-libelf-devel flac-devel hwdata kernel-headers libevent-devel libffi-devel
 yum install libicu-devel libuuid-devel
 yum install libudev-devel libxslt-devel opus-devel perl-Switch speech-dispatcher-devel yasm pam-devel
 yum install msttcorefonts kochi-substitute-fonts
 Deepin系统
 apt-get install net-tools git ftp
 apt-get install libcups2-dev libnss3-dev libfreetype6-dev libpango1.0-dev libatk1.0-dev libdbus-1-dev libpulse-dev libgtk2.0-dev libffi-dev
 apt-get install ninja-build nodejs(nodejs安装后,需执行sudo ln -sv /usr/bin/nodejs /usr/bin/node)
 apt-get install libasound2-dev bison gperf libpci-dev libgl1-mesa-dev libxtst-dev libxss-dev libkrb5-dev
 2)设置swap分区,防止编译内存地址空间不够
 最好设置4G及以上的交换分区
 dd if=/dev/zero of=/swapfile bs=1M count=4096
 mkswap /swapfile
 swapon /swapfile
  • 代码编译
  1)先进入$Chromium 目录进行GN_CONFIGS设置。
  GN_CONFIG=('google_api_key="AIzaSyDxKL42zsPjbke5O8_rPVpVrLrJ8aeE9rQ"'
            'google_default_client_id="595013732528-llk8trb03f0ldpqq6nprjp1s79596646.apps.googleusercontent.com"'
            'google_default_client_secret="5ntt6GbbkjnTVXx-MSxbmx5e"'
            'clang_use_chrome_plugins=false'
            'enable_hangout_services_extension=true'
            'enable_nacl=false'
            'enable_nacl_nonsfi=false'
            'enable_widevine=true'
            'fatal_linker_warnings=false'
            'ffmpeg_branding="Chrome"'
            'fieldtrial_testing_like_official_build=true'
            'is_debug=false'
            'is_clang=false'
            'link_pulseaudio=true'
            'linux_use_bundled_binutils=false'
            'proprietary_codecs=true'
            'remove_webcore_debug_symbols=true'
            'symbol_level=0'
            'treat_warnings_as_errors=false'
            'use_allocator="none"'
            'use_cups=true'
            'use_gconf=false'
            'use_gnome_keyring=false'
            'use_gold=false'
            'use_gtk3=false'
            'use_kerberos=true'
            'use_pulseaudio=true'
            'use_sysroot=false')
 2)GN生成配置
   a)下载depot_tools
      git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
      export PATH=$PATH:$depot_tools(你所下载的depot_tools的绝对路径)
   b)python tools/gn/bootstrap/bootstrap.py --gn-gen-args "${GN_CONFIG[*]}"
      该过程可能需要设置ninja的路径。
      cd ~
      git clone https://github.com/martine/ninja.git -b v1.7.2
      cd ninja && ./configure.py —bootstrap
      export PATH=$ninja:$PATH  ($ninja表示ninja所在的绝对路径)
   c)out/Release/gn gen out/Release --args="${GN_CONFIG[*]}" 
  3)代码编译
 ninja -C out/Release chrome 
 执行完,进入out/Release即可发现执行文件chrome,运行需要设置下chrome-sandbox
  4)chrome-sandbox设置
  ninja -C out/Release chrome_sandbox
  进入out/Release,进入如下设置:
  mv chrome_sandbox chrome-sandbox
  sudo chown root:root chrome-sandbox
  sudo chmod 4755 chrome-sandbox
  • 运行
    • 直接进入out/Release,运行./chrome即可打开你所编译的chromium浏览器了。
  • 安装包制作
    • 目前龙芯chromium只适配了Loongnix系统rpm包:
 git clone http://wangqing@gerritos.loongnix.org/p/chrome.git
 rpmbuild -bb chromium.spec

其它系统,大家可以利用源码自行适配。

返回浏览器

本页面最后修改于2018年11月29日 (星期四) 09:17。

© 2019 by 龙芯开源社区 • Powered by MediaWiki
京ICP备14017781号