Fix importance for -scm
[pippings-exhereses.git] / packages / net-www / chromium / chromium-scm.exheres-0
blobace1f804a482d39e086235bf0013e307ccc9f096
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"
10 SCM_TYPE=git
11 SCM_BRANCH=trunk
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="
17     acid3
18     gtest
19     gurl
20     hunspell
21     icu42
22     openvcdiff
23     protobuf
24     skia
25     support
26     tcmalloc
27     v8
28     webkit
29     webkitjscore
30     webkitwebcore
31     xdgutils
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:"
61 chromium-init-scm() {
62     local SCM_THIS var
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
74     done
77 chromium-init-scm
79 scm_finalise
81 DEPENDENCIES+="
82     build:
83         dev-libs/libxml2[>=2.6.32]
84         dev-libs/libxslt[>=1.1.24]
85         dev-util/gperf[>=3.0.3]
86         media/ffmpeg[>=0.5]
87         media-libs/jpeg[>=6b]
88         media-libs/libpng[>=1.2.37]
89         sys-devel/gyp[~scm]
91     # Needs special patching for sqlite
92     #    dev-db/sqlite[>=3.6.1]
94 # See http://code.google.com/p/chromium/wiki/LinuxChromium64
95 src_compile() {
96     local myconf=""
97     local build=Release
98     local gccver=$(gcc-major-version)$(gcc-minor-version)
100     option debug && build=Debug
101     option "platform:amd64" && myconf="${myconf} target_arch=x64"
103     myconf="${myconf}
104             gcc_version=${gccver}
105             use_system_bzip2=1
106             use_system_ffmpeg=1
107             use_system_libjpeg=1
108             use_system_libpng=1
109             use_system_libxml=1
110             use_system_libxslt=1
111             use_system_zlib=1
112     "
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}"
121     cd src
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"
135 src_install() {
136     # Install into /opt
137     local dest=/opt/chromium-${PV}
138     local ffmpeg="libavcodec.so.52 libavformat.so.52 libavutil.so.50"
139     local build=Release
140     option debug && build=Debug
142     # Files were generated in here
143     cd src/out/${build}
145     # Executable binaries
146     exeinto ${dest}
147     doexe chrome chrome-wrapper mksnapshot xdg-settings
149     # Data
150     insinto ${dest}
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
155         doins ${l}
156     done
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}
161     done
163     # Man page
164     doman chromium-browser.1
166     chromium_do_wrapper "${dest}"