chromium 开发 on ubuntu14.10 (x64)


系统需求: 

           https://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites

        1, Ubuntu 14.04

    2, Disk space

                  It takes about 10GB or so of disk space to check out and build the source tree. This number grows over time.

     3, Memory space

             It takes about 8GB of swap file to link chromium and its tests. If you get an out-of-memory error during the final link, you will need to add swap space with swapon. It's recommended to have at least 4GB of memory available for building a statically linked debug build. Dynamic linking and/or building a release build lowers memory requirements. People with less than 8GB of memory may want to not build tests since they are quite large.

     4, 64-bit Systems

                   Chromium can be compiled as either a 32-bit or 64-bit application. Chromium requires several system libraries to compile and run. While it is possible to compile and run a 32-bit Chromium on 64-bit Linux, many distributions are missing the necessary 32-bit libraries, and will result in build or run-time errors.

      5, Depot tools

              Before setting up the environment, make sure you install the depot tools first.

    6, Software Requirements

         Ubuntu Setup

                     Run build/install-build-deps.sh The script only supports current releases as listed onhttps://wiki.ubuntu.com/Releases.

                      Building on Linux requires software not usually installed with the distributions. The script attempts to automate installing the required software. This script is used to set up the canonical builders, and as such is the most up to date reference for the required prerequisites.


blink code standard:

      http://dev.chromium.org/blink/coding-style









1, get the source code:   http://dev.chromium.org/developers/how-tos/get-the-code

       

   1.1 GET DEPOT TOOLS     (http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up)

      Clone the depot_tools repository:

          $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
     Add depot_tools to the end of your PATH (you will probably want to put thisin your ~/.bashrc or ~/.zshrc). Assuming you cloned depot_tools to /path/to/depot_tools:

          $  export PATH=$PATH:/mnt/blink_chromium_browser/depot_tools


    1.2, get the blink source code:
           # mkdir blink && cd $_

           # /mnt/blink_chromium_browser/blink$ ../depot_tools/fetch --nohooks  --no-history  blink

              [0:22:22] Still working on:
              [0:22:22]   src/third_party/WebKit
              Syncing projects: 100% (78/78), done.                
               Running: git submodule foreach 'git config -f $toplevel/.git/config submodule.$name.ignore all'
               Running: git config --add remote.origin.fetch '+refs/tags/*:refs/tags/*'
                Running: git config diff.ignoreSubmodules all



2, Install any necessary dependencies

    2.1   Install any necessary dependencies
           build/install-build-deps.sh             If you are on linux and fetching the code for the first time, then you’ll needto run:

          Run build/install-build-deps.sh The script only supports current releases as listed onhttps://wiki.ubuntu.com/Releases.

         #/browser_webkit/chromium_dev_blink/src$ build/install-build-deps.sh

        Problems:    1,

         How can I accept the Microsoft EULA agreement for ttf-mscorefonts-installer?

       
  • Use the Tab key to move from one element (e.g., button, text box) to the next. UseShift+Tab to move in reverse.
  • Use Spacebar to "click" the selected button.
  • Use Enter to click the default button (or currently selected button, if there is no default).
  • You can move up and down in a textbox with the arrow keys, and with Page Up andPage Down. If that doesn't work, pressTab until the text box you want to navigate in is selected.


       2.2  Run post-sync hooks 

            Finally, runhooks to run any post-sync scripts


     $ gclient runhooks

 




3, build blink 

       https://code.google.com/p/chromium/wiki/LinuxBuildInstructions

      3.1    Building Chromium base

            If you've checked out the code, you should see the following files and folders in the directory where you ran  fetch:
  •  .gclient This file (generated by fetch) defines the configuration of your checkout. It contains the location of the repository, as well as some other useful  configuration
  •  .gclient_entries This file (also generated by fetch) contains the repository and version information for each of Chromium's sub-repositories (dependencies)
  • src/ Contains the Chromium codebase (an explanation of the directory structure)
    • out/ Contains the generated output from builds
      • Debug/ One of the default build folders; builds the debug build
      • Release/ One of the default build folders; builds the release build

               GYP build (standard)

              GYP (Generate-Your-Project) is our current build system, it works for all targets. The build configurations for GYP are stored    in    *.gyp  or   *.gypi  files.
                    Generating the build files
                 If you've changed (or updated and have changes to) any   *.gyp  or   *.gypi   files , you'll need to re-generate the build files:
  $ ./build/gyp_chromium -Dcomponent=shared_library
                      By default, this will add the build files to the   out/  directory, but you can specify a different directory if you wish, e.g.:
$ ./build/gyp_chromium -Goutput_dir=out_cros
                  Each generator output directory will have its own   Debug  and   Release  subdirectories.  For a full list of parameters GYP supports, run   ./build/gyp_chromium --help  .
               Specifying build parameters
                 You can specify custom build parameters that affect the target or speed of your build. For more info, see  GYP build parameters.
                    Building Chrome
                 You can then build Chromium (the   chrome  target)  using:

               $ ninja -C out/Debug chrome
                   For a release build, replace   out/Debug  with   out/Release  .


    3,2   gyp (configuring)

     $ gclient sync

            This will pull all dependencies of the Chromium src checkout. You will needto run this any time you update the main src checkout, including when youswitch branches.

         $  ./build/gyp_chromium -Dcomponent=shared_library

    

         If you've changed (or updated and have changes to) any   *.gyp  or   *.gypi   files , you'll need to re-generate the build files:
$ ./build/gyp_chromium -Dcomponent=shared_library
                  By default, this will add the build files to the   out/  directory, but you can specify a different directory if you wish, e.g.:
$ ./build/gyp_chromium -Goutput_dir=out_cros
                Each generator output directory will have its own   Debug  and   Release  subdirectories.  For a full list of parameters GYP supports, run   ./build/gyp_chromium --help  .
               Specifying build parameters
           You can specify custom build parameters that affect the target or speed of your build. For more info, see  GYP build parameters.
    



     3.3   Building Chrome
        You can then build Chromium (the chrome target) using:

            https://code.google.com/p/chromium/wiki/LinuxBuildInstructions

            http://dev.chromium.org/developers/how-tos/get-the-code

        $ ninja -C out/Release  chrome

        $ ninja -C out/Debug chrome

        $ ninja -C out/Release  chrome  chrome_sandbox




   

 


4  Running Chromium

      4.1   You can run chrome with:
         http://dev.chromium.org/developers/how-tos/get-the-code
          https://code.google.com/p/chromium/wiki/LinuxBuildInstructions

            $ out/Debug/chrome



      meeting the problem:   https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment

             [4084:4084:0420/123757:FATAL:browser_main_loop.cc(169)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.

     How to fix it?????  https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment

      $ ninja -C out/Release  chrome  chrome_sandbox

      $ sudo cp out/Release/chrome_sandbox /usr/local/sbin/chrome-devel-sandbox

     $  sudo chown root:root /usr/local/sbin/chrome-devel-sandbox

     $ sudo chmod 4755 /usr/local/sbin/chrome-devel-sandbox

     $ export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox



 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值