1 # Copyright 2009 Heiko Przybyl <zuxez@cs.tu-berlin.de>
2 # Distributed under the terms of the GNU General Public License v2
4 require chromium multilib scm toolchain-funcs
6 PLATFORMS="~amd64 ~x86"
8 # Main repo -- note that dir "src" is needed by build chain, so don't drop it
9 SCM_REPOSITORY="git://git.chromium.org/chromium.git"
12 SCM_CHECKOUT_TO="${PN}/src"
13 SCM_UNPACK_TO="${WORKBASE}/${PNV}/src"
15 # All the other repos, required externals should go last
16 SCM_SECONDARY_REPOSITORIES="
34 # Deps needed to build.
35 CHR_BURL="http://src.chromium.org/svn"
36 WKIT_BURL="http://svn.webkit.org/repository/webkit"
37 UNPACK_BURL=${PNV}/src
39 # MYSCM_<name>=( _REPOSITORY _TYPE _SUBPATH _UNPACK_TO )
40 MYSCM_acid3=( ${CHR_BURL} svn deps/page_cycler/acid3 tools/page_cycler/acid3 )
41 MYSCM_hunspell=( ${CHR_BURL} svn deps/third_party/hunspell128 third_party/hunspell )
42 MYSCM_icu42=( ${CHR_BURL} svn deps/third_party/icu42 third_party/icu )
43 MYSCM_support=( ${CHR_BURL} svn deps/support build/util/support )
44 MYSCM_webkit=( ${CHR_BURL} svn deps/third_party/WebKit third_party/WebKit )
45 MYSCM_xdgutils=( ${CHR_BURL} svn deps/third_party/xdg-utils third_party/xdg-utils )
47 MYSCM_gurl=( "http://google-url.googlecode.com/svn" svn "" googleurl )
48 MYSCM_gtest=( "http://googletest.googlecode.com/svn" svn "" testing/gtest )
49 MYSCM_openvcdiff=( "http://open-vcdiff.googlecode.com/svn" svn "" sdch/open-vcdiff )
50 MYSCM_protobuf=( "http://protobuf.googlecode.com/svn" svn "" third_party/protobuf2/src )
51 MYSCM_skia=( "http://skia.googlecode.com/svn" svn "" third_party/skia )
52 MYSCM_tcmalloc=( "http://google-perftools.googlecode.com/svn" svn "" third_party/tcmalloc/tcmalloc )
53 MYSCM_v8=( "http://v8.googlecode.com/svn" svn "" v8 )
55 MYSCM_webkitjscore=( ${WKIT_BURL} svn JavaScriptCore third_party/WebKit/JavaScriptCore )
56 MYSCM_webkitwebcore=( ${WKIT_BURL} svn WebCore third_party/WebKit/WebCore )
58 # We don't need that external, so drop it.
59 SCM_protobuf_SVN_EXTERNALS+=" gtest:"
63 for SCM_THIS in ${SCM_SECONDARY_REPOSITORIES} ; do
64 var="MYSCM_${SCM_THIS}[0]"
65 scm_set_var REPOSITORY ${!var}
66 var="MYSCM_${SCM_THIS}[1]"
67 scm_set_var TYPE ${!var}
68 var="MYSCM_${SCM_THIS}[2]"
69 [[ -n ${!var} ]] && scm_set_var SUBPATH ${!var}
70 var="MYSCM_${SCM_THIS}[3]"
71 scm_set_var UNPACK_TO "${UNPACK_BURL}"/${!var}
72 scm_set_var CHECKOUT_TO ${PN}/${SCM_THIS}
73 scm_set_var METADATA_UNNEEDED screw_dot_svn
83 dev-libs/libxml2[>=2.6.32]
84 dev-libs/libxslt[>=1.1.24]
85 dev-util/gperf[>=3.0.3]
88 media-libs/libpng[>=1.2.37]
91 # Needs special patching for sqlite
92 # dev-db/sqlite[>=3.6.1]
94 # See http://code.google.com/p/chromium/wiki/LinuxChromium64
98 local gccver=$(gcc-major-version)$(gcc-minor-version)
100 option debug && build=Debug
101 option "platform:amd64" && myconf="${myconf} target_arch=x64"
104 gcc_version=${gccver}
114 # Needs special patching for sqlite
115 # use_system_sqlite=1
117 [[ ${gccver} -ge 44 ]] && myconf="${myconf} no_strict_aliasing=1"
119 einfo "Using config: ${myconf}"
123 # The build chain preparator. Setting cflags on the Makefile doesn't really
124 # work and i dunno why, so just do it here. Won't harm if build=Debug.
125 export GYP_GENERATORS=make
126 export GYP_DEFINES="${myconf} release_extra_cflags=\"${CFLAGS}\""
127 build/gyp_chromium || die "running build/gyp_chromium failed"
129 # The actual compilation...
130 emake -r chrome BUILDTYPE=${build} LDFLAGS+="-L/usr/$(get_libdir)/nss"
133 CHROMIUM_IMPORTANCE="999999"
137 local dest=/opt/chromium-${PV}
138 local ffmpeg="libavcodec.so.52 libavformat.so.52 libavutil.so.50"
140 option debug && build=Debug
142 # Files were generated in here
145 # Executable binaries
147 doexe chrome chrome-wrapper mksnapshot xdg-settings
151 doins -r *.pak *.png locales resources themes
153 # Install shared libs if existing (e.g. libxpcom.so and libxul.so)
154 for l in $(find . -maxdepth 1 -name *.so) ; do
158 # Link ffmpeg shared libs (not directly loaded by ld and thus needed :/)
159 for l in ${ffmpeg} ; do
160 dosym /usr/$(get_libdir)/${l%???} ${dest}/${l}
164 doman chromium-browser.1
166 chromium_do_wrapper "${dest}"