3
DEBIAN_NAME := $(shell dpkg-parsechangelog | sed -n 's/^Source: *\(.*\)$$/\1/ p')
4
DEBIAN_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)$$/\1/ p')
5
DEBIAN_UPSTREAM_VERSION := $(shell echo $(DEBIAN_VERSION) | sed 's/^\(.*\)-[^-]*$$/\1/')
6
DEBIAN_REVISION := $(shell echo $(DEBIAN_VERSION) | sed 's/^.*r\([^-]*\)-.*/\1/')
7
DEBIAN_DIST := $(shell lsb_release -ds | tr -d '()')
8
DEBIAN_DIST_NAME := $(shell lsb_release -si)
9
DEBIAN_DIST_VERSION := $(shell lsb_release -sr)
10
DEBIAN_CODECS_NAME := $(subst browser,codecs-ffmpeg,$(DEBIAN_NAME))
12
# DEB_TAR_SRCDIR has to be 'src' as this is what gyp expects :(
14
SRC_DIR := $(CURDIR)/$(DEB_TAR_SRCDIR)
15
LIB_DIR := usr/lib/$(DEBIAN_NAME)
16
DEB_BUILDDIR := $(SRC_DIR)
18
# Whitelist LP provided new langs only in release builds, PPAs ship them all
19
WANT_ONLY_WHITELISTED_NEW_LANGS ?= 1
28
PROCESSORS ?= $(shell grep -ic ^processor /proc/cpuinfo)
29
ifeq (0,$(PROCESSORS))
33
# Enable the hardening wrapper (See https://wiki.ubuntu.com/Security/HardeningWrapper)
34
# Don't do it on maverick/armel either for now, it fails to link
35
# Don't do it on lucid/armel either, it crashes: LP #716703
36
ifeq (armel,$(DEB_BUILD_ARCH))
37
ifeq (,$(filter 10.04 10.10 11.04 11.10 12.04 12.10 13.04,$(DEBIAN_DIST_VERSION)))
38
export DEB_BUILD_HARDENING=1
40
$(warning ## Not enabling DEB_BUILD_HARDENING on Ubuntu 10.04+ armel. See LP #641126 and LP #716703)
43
$(warning ## DEB_BUILD_HARDENING=$(DEB_BUILD_HARDENING))
46
GYP_DEFINES = disable_sse2=1
48
# Build the launchpad translations (already landed upstream)
49
GYP_DEFINES += use_third_party_translations=0
50
# Also merges the newer translations from launchpad
51
#WANT_LP_TRANSLATIONS ?= 1
53
# Only keep -Werror when building for the Debian or Ubuntu development branches
54
ifeq (,$(filter unstable development,$(DEBIAN_DIST)))
55
GYP_DEFINES += werror=$(NULL)
58
# Disable NaCl until we figure out what to do with the private toolchain
59
GYP_DEFINES += disable_nacl=1
61
# do not use third_party/gold as the linker.
62
GYP_DEFINES += linux_use_gold_binary=0 linux_use_gold_flags=0
64
ifneq (,$(findstring armhf,$(DEB_BUILD_ARCH)))
66
v8_use_arm_eabi_hardfloat=true \
71
ifneq (,$(findstring arm,$(DEB_BUILD_ARCH)))
78
linux_use_tcmalloc=0 \
83
ifneq (,$(filter 10.10 11.04 11.10 12.04 12.10 unstable development,$(DEBIAN_DIST)))
84
# on $(DEB_BUILD_ARCH) and $(DEBIAN_DIST), enforce an armv7 with thumb build (or not)
90
ifeq (amd64,$(DEB_BUILD_ARCH))
91
GYP_DEFINES += target_arch=x64
93
ifeq (i386,$(DEB_BUILD_ARCH))
94
GYP_DEFINES += target_arch=ia32
96
$(warning unsupported target arch $(DEB_BUILD_ARCH) - continuing anyway)
101
# Don't let dh_installinit install *.default in /etc/default
102
DEB_DH_INSTALLINIT_ARGS += --noscripts --onlyscripts
104
# Don't let scour touch the svg files
105
DEB_DH_SCOUR_ARGS += -Xsvg
107
# Use lzma instead of gzip inside the debs (passed to dpkg-deb)
108
ifeq (1,$(WANT_XZ_DEBS))
109
DEB_DH_BUILDDEB_ARGS += -- -Z xz
112
ifeq (1,$(WANT_DEBUG))
115
BUILD_TYPE := Release
117
BUILD_ARGS += SYMBOLS=1
119
BUILD_ARGS += BUILDTYPE=$(BUILD_TYPE)
127
ifeq (1,$(WANT_SHARED_LIBS))
128
GYP_DEFINES += library=shared_library
131
# Use upstream build flags (defined in build/common.gypi)
132
BUILD_ARGS += CFLAGS="" CXXFLAGS="" CPPFLAGS="" LDFLAGS=""
134
CC_VERSION := $(shell gcc -dumpversion | cut -d. -f-2)
136
# Set this to use gcc 4.6 instead of 4.7
138
ifeq (4.7,$(CC_VERSION))
139
GYP_DEFINES += werror=$(NULL)
140
ifeq (1,$(AVOID_GCC_47))
143
BUILD_ARGS += CC=$(CC) CXX=$(CXX) CC.host=$(CC) CXX.host=$(CXX) LINK.host=$(CXX)
148
debian/$(DEBIAN_NAME).sh \
149
debian/patches/chromium_useragent.patch \
153
rm -f debian/*-stamp debian/stamp-* debian/tmp-*
154
rm -f $(subst_files) *.cdbs-config_list
155
rm -rf third_party chrome src/out
156
# cd src && find . -name "Makefile" -print0 | xargs -0 rm -f
157
# cd src && find . -name "*.mk" -print0 | xargs -0 rm -f
161
ifneq (1,$(PROCESSORS))
162
BUILD_ARGS += -j$(PROCESSORS)
165
INSTALL_EXCLUDE_DIRS = \
177
INSTALL_EXCLUDE_FILES = \
179
product_logo_48.png \
180
libnpapi_layout_test_plugin.so \
181
libnpapi_test_plugin.so \
185
ssl_false_start_blacklist_process \
196
libvpx_obj_int_extract \
200
# Don't build it as part of chromium. Build it separately twice, once with
201
# the Chrome branding to gain the extra codecs, and once without branding.
202
# The ffmpeg_branding variable controls which codecs are built inside the sumo lib.
203
# By default, ffmpeg_branding equals to "Chromium" and only builds the ogg/vorbis/theora codecs.
204
# When set to "Chrome", it also builds aac/ac3/mpeg4audio/h264/mov/mp3
205
DEB_DH_SHLIBDEPS_ARGS_$(DEBIAN_CODECS_NAME) := -l$(CURDIR)/debian/$(DEBIAN_CODECS_NAME)/$(LIB_DIR)
206
DEB_DH_SHLIBDEPS_ARGS_$(DEBIAN_CODECS_NAME)-extra := -l$(CURDIR)/debian/$(DEBIAN_CODECS_NAME)-extra/$(LIB_DIR)
207
BROWSER_GYP_DEFINES += \
208
proprietary_codecs=1 \
211
FFMPEG_MT_GYP_DEFINES = \
213
release_extra_cflags=-g \
215
FFMPEG_MT_STD_GYP_DEFINES = $(NULL)
216
FFMPEG_MT_EXTRA_GYP_DEFINES = ffmpeg_branding=Chrome
218
ifneq (,$(filter 12.10 unstable development,$(DEBIAN_DIST)))
219
# enable compile-time dependency on gnome-keyring
220
GYP_DEFINES += use_gnome_keyring=1 linux_link_gnome_keyring=1
221
# controlling the use of GConf (the classic GNOME configuration
222
# and GIO, which contains GSettings (the new GNOME config system)
223
GYP_DEFINES += use_gconf=1 use_gio=1
226
USE_SYSTEM_SQLITE := $(shell pkg-config 'sqlite3 >= 3.6.1' && echo 1 || echo 0)
227
USE_SYSTEM_SQLITE := 0
230
ifeq (1,$(WANT_SYSTEM_LIBS))
233
use_system_libjpeg=1 \
234
use_system_libpng=1 \
235
use_system_sqlite=$(USE_SYSTEM_SQLITE) \
236
use_system_libxml=0 \
237
use_system_libxslt=1 \
241
# Build everything (like All), including test programs but minus things we don't
242
# want (breakpad, courgette, ..) or don't need (the other small tools)
248
ifeq (1,$(WANT_SANDBOXING))
250
linux_sandbox_path=/$(LIB_DIR)/$(DEBIAN_NAME)-sandbox \
251
linux_sandbox_chrome_path=/$(LIB_DIR)/$(DEBIAN_NAME) \
254
# needed to preserve the suid and make the sandbox happy
255
DEB_FIXPERMS_EXCLUDE := $(DEBIAN_NAME)-sandbox
259
ifeq (1,$(USE_SYSTEM_V8))
261
javascript_engine=system-v8 \
266
DO = (touch r1; echo '$(1)'; $(1); touch r2 ; T1=`date -r r1 +%s` ; T2=`date -r r2 +%s`; echo "PERF: '$(2)' built in "`expr $$T2 - $$T1`" sec"; rm -f r1 r2;)
269
sed -e 's/@BUILD_DIST@/$(DEBIAN_DIST_NAME) $(DEBIAN_DIST_VERSION)/g' \
270
-e 's/@BUILD_DIST_NAME@/$(DEBIAN_DIST_NAME)/g' \
271
-e 's/@BUILD_DIST_VERSION@/$(DEBIAN_DIST_VERSION)/g' \
274
DEB_MAKE_EXTRA_ARGS := $(NULL)
275
DEB_MAKE_BUILD_TARGET := $(BUILD_ARGS) $(BUILD_TARGETS) || ( $(KEEPALIVE) stop ; exit 1 )
277
GYP_ENV := GYP_GENERATORS=make
278
ifneq (,$(GYP_DEFINES))
279
GYP_ENV += GYP_DEFINES="$(GYP_DEFINES) $(BROWSER_GYP_DEFINES)"
282
configure: configure-stamp
286
sed -i 's,/etc/chromium/policies,/etc/$(DEBIAN_NAME)/policies,' \
287
$(DEB_TAR_SRCDIR)/chrome/common/chrome_paths.cc
289
cd $(SRC_DIR) && $(GYP_ENV) python build/gyp_chromium --no-circular-check build/all.gyp
291
# Populate the LASTCHANGE file template as we no longer have the VCS files at this point
292
echo "$(DEBIAN_REVISION)" > $(SRC_DIR)/build/LASTCHANGE.in
294
build: configure-stamp build-stamp
295
build-stamp: configure-stamp
296
$(MAKE) -C $(SRC_DIR) $(BUILD_ARGS) $(BUILD_TARGETS)
297
build-stamp-ffmpeg-std
298
build-stamp-ffmpeg-extra
301
binary-indep: build install
303
binary-arch: build install
311
#dh_installchangelogs ChangeLog
321
binary: binary-indep binary-arch
323
configure-stamp-ffmpeg-%:
324
rm -rf $(FFMPEG_SRC_DIR)/*.mk $(FFMPEG_SRC_DIR)/out
325
cd $(SRC_DIR) && GYP_DEFINES="$(GYP_DEFINES)" GYP_GENERATORS=make build/gyp_chromium --depth=../src $(FFMPEG_DIR)/ffmpeg.gyp
328
build-stamp-ffmpeg-%:
329
GYP_DEFINES += $(FFMPEG_MT_$(subst std,STD,$(subst extra,EXTRA,$*))_GYP_DEFINES) $(FFMPEG_MT_GYP_DEFINES)
330
FFMPEG_DIR = third_party/ffmpeg
331
FFMPEG_SRC_DIR = $(SRC_DIR)/$(FFMPEG_DIR)
332
BUILD_ARGS += CFLAGS="" CXXFLAGS="" CPPFLAGS="" LDFLAGS=""
333
configure-stamp-ffmpeg-%
334
cd $(FFMPEG_SRC_DIR) ; $(MAKE) -f ffmpeg.Makefile $(BUILD_ARGS)
335
install -d -m 755 $(CURDIR)/debian/tmp-$*/$(LIB_DIR)
336
install -m 644 $(FFMPEG_SRC_DIR)/out/$(BUILD_TYPE)/libffmpegsumo.so $(CURDIR)/debian/tmp-$*/$(LIB_DIR)
344
dh_installdirs --package=chromium-browser $(LIB_DIR)
345
( cd $(SRC_DIR)/out/$(BUILD_TYPE) && cp -r !($(shell echo $(INSTALL_EXCLUDE_DIRS) $(INSTALL_EXCLUDE_FILES) | tr ' ' '||')) debian/chromium-browser/$(LIB_DIR))
347
dh_installdirs --package=chromium-browser usr/bin
348
cp -a debian/$(DEBIAN_NAME).sh debian/chromium-browser/usr/bin/$(DEBIAN_NAME)
349
chmod 755 debian/chromium-browser/usr/bin/$(DEBIAN_NAME)
351
dh_installdirs --package=chromium-browser etc/$(DEBIAN_NAME)
352
cp -a debian/$(DEBIAN_NAME).default debian/chromium-browser/etc/$(DEBIAN_NAME)/default
353
# Rename the binary from chrome to $(DEBIAN_NAME), this is required
354
# as chromium dereferences all symlinks before starting its children
355
# making the Gnome System Monitor confused with icons
356
mv debian/chromium-browser/$(LIB_DIR)/chrome debian/chromium-browser/$(LIB_DIR)/$(DEBIAN_NAME)
357
mv debian/chromium-browser/$(LIB_DIR)/chrome_sandbox debian/chromium-browser/$(LIB_DIR)/$(DEBIAN_NAME)-sandbox
359
mv debian/chromium-browser/$(LIB_DIR)/chrome.1 debian/chromium-browser/$(LIB_DIR)/chromium-browser.1
360
dh_installman -package=chromium-browser debian/chromium-browser/$(LIB_DIR)/chromium-browser.1
361
rm -f debian/chromium-browser/$(LIB_DIR)/chromium-browser.1
363
dh_installdirs --package=chromium-browser usr/share/pixmaps
364
cp -a $(DEB_TAR_SRCDIR)/chrome/app/theme/chromium/product_logo_48.png debian/chromium-browser/usr/share/pixmaps/$(DEBIAN_NAME).png
365
for size in 16 22 24 32 48 64 128 256 ; do \
366
dh_installdirs --package=chromium-browser usr/share/icons/hicolor/$${size}x$${size}/apps ; \
367
cp -a $(DEB_TAR_SRCDIR)/chrome/app/theme/chromium/product_logo_$$size.png \
368
debian/chromium-browser/usr/share/icons/hicolor/$${size}x$${size}/apps/chromium-browser.png ; \
370
dh_installdirs --package=chromium-browser usr/share/icons/hicolor/scalable/apps
371
cp -a debian/chromium-browser.svg debian/chromium-browser/usr/share/icons/hicolor/scalable/apps
372
ifeq (1,$(WANT_SANDBOXING))
373
chmod 4755 debian/$(DEBIAN_NAME)/$(LIB_DIR)/chromium-browser-sandbox
375
rm -vf debian/$(DEBIAN_NAME)/$(LIB_DIR)/chromium-browser-sandbox
377
# NaCL may be blacklisted, so only include it when it's been built
378
#ifeq (,$(filter disable_nacl=1,$(GYP_DEFINES)))
379
# cp -a debian/tmp/$(LIB_DIR)/libppGoogleNaClPluginChrome.so debian/chromium-browser/$(LIB_DIR)/
380
# cp -a debian/tmp/$(LIB_DIR)/nacl_irt_* debian/chromium-browser/$(LIB_DIR)/
382
# Locales: only keep en-US in the main deb
383
# cd debian/chromium-browser/$(LIB_DIR)/locales && \
384
# rm -f $(filter-out en-US.pak,$(notdir $(wildcard debian/chromium-browser/$(LIB_DIR)/locales/*)))
386
dh_installdirs --package=chromium-codecs-ffmpeg $(LIB_DIR)
387
cp debian/tmp-std/libffmpegsumo.so debian/chromium-codecs-ffmpeg/$(LIB_DIR)
389
dh_installdirs --package=chromium-codecs-ffmpeg-extra $(LIB_DIR)
390
cp debian/tmp-extra/libffmpegsumo.so debian/chromium-codecs-ffmpeg-extra/$(LIB_DIR)
395
PKG_DIRS = $(addprefix debian/,$(shell grep ^Package debian/control | cut -d' ' -f2))
397
binary-predeb/$(DEBIAN_NAME):
398
ifneq (,$(findstring Ubuntu,$(DEBIAN_DIST)))
399
# we need space on the CD, so remove duplicates of the doc files
400
# (See LP: #194574 as for why we don't let cdbs do it)
401
@for doc in copyright AUTHORS changelog.Debian.gz ; do \
402
F=debian/$(DEBIAN_NAME)/usr/share/doc/$(DEBIAN_NAME)/$$doc ; \
403
for file in `find $(addsuffix /usr/share/doc,$(filter-out debian/$(DEBIAN_NAME),$(PKG_DIRS))) -type f -name $$doc -print`; do \
404
cmp -s $$file $$F ; \
405
if [ $$? -eq 0 ] ; then \
407
echo " symlinking $$doc in '"`echo $$file | awk 'BEGIN{ FS="/"} { print $$2 }'`"' to file in '$(DEBIAN_NAME)'" ; \
408
( cd `dirname $$file` ; ln -s ../$(DEBIAN_NAME)/$$doc ) ; \
414
###############################################################################################
416
# Tarball (get-orig-source & get-current-source)
417
GCLIENT_URL := http://src.chromium.org/svn/trunk/tools/depot_tools
418
CHROMIUM_URL := http://src.chromium.org/svn/trunk/src
419
CHROMIUM_RLZ := http://src.chromium.org/svn/releases
420
DEPS_URL := http://src.chromium.org/svn/trunk/deps/third_party
421
GREEN_REV_URL := http://chromium-status.appspot.com/lkgr
422
CHANNELS_URL := http://omahaproxy.appspot.com/
424
TRANSLATIONS_TOOLS_BRANCH := lp:~chromium-team/chromium-browser/chromium-translations-tools.head
425
TRANSLATIONS_EXPORT_BRANCH := lp:~chromium-team/chromium-browser/chromium-translations-exports.head
427
chrome/app/chromium_strings.grd \
428
chrome/app/generated_resources.grd \
429
chrome/app/policy/policy_templates.grd \
430
ui/base/strings/ui_strings.grd \
431
webkit/glue/inspector_strings.grd \
432
webkit/glue/webkit_strings.grd \
434
OTHER_GRIT_TEMPLATES := \
435
ui/base/strings/app_locale_settings.grd \
436
chrome/app/resources/locale_settings.grd \
437
chrome/app/resources/locale_settings_linux.grd \
439
MAPPED_GRIT_TEMPLATES := \
440
--map-template-names ui/base/strings/ui_strings.grd=ui/base/strings/app_strings.grd \
443
# New langs with enough coverage to land in official builds
444
# (leave empty to accept all new lang)
445
GRIT_WHITELISTED_LANGS ?= \
497
GRIT_CONVERTER_FLAGS := \
498
--create-patches translations-patches \
499
--import-gettext ../translations-export \
500
--export-grit ../translations-grit \
501
--build-gyp-file build/common.gypi \
502
--other-grd-files $(shell echo $(OTHER_GRIT_TEMPLATES) | tr ' ' ',') \
503
$(MAPPED_GRIT_TEMPLATES) \
506
ifeq (1,$(WANT_ONLY_WHITELISTED_NEW_LANGS))
507
GRIT_CONVERTER_FLAGS += --whitelisted-new-langs $(shell echo $(GRIT_WHITELISTED_LANGS) | tr ' ' ',')
510
# See Staying Green More Of The Time at http://dev.chromium.org/developers/how-tos/get-the-code
515
STRIPPED_DIRS_FROM_CO := \
516
src/chrome/tools/test/reference_build \
517
src/chrome/tools/test/reference_build/chrome_linux \
518
src/webkit/data/layout_tests/LayoutTests \
519
src/third_party/WebKit/LayoutTests \
520
src/third_party/ffmpeg/binaries/chromium/linux/ia32 \
521
src/third_party/ffmpeg/binaries/chromium/linux/ia32_dbg \
522
src/third_party/ffmpeg/binaries/chromium/linux/x64 \
523
src/third_party/ffmpeg/binaries/chromium/linux/x64_dbg \
526
# stuff we don't have access to and shouldn't be in DEPS
527
STRIPPED_DIRS_FROM_CO += \
528
src/chrome/app/theme/google_chrome \
529
src/chrome/installer/linux \
532
# prefix with _ those that we can't remove (just yet) because of the gclient
533
# hooks (see build/all.gyp) or of some unneeded deps/includes
535
chrome/test/data/safe_browsing/old \
536
chrome/test/data/firefox2_nss_mac \
537
chrome/third_party/wtl/ \
543
third_party/bspatch \
544
third_party/ffmpeg/binaries \
545
third_party/fuzzymatch \
546
third_party/gles_book_examples \
548
third_party/hunspell/dictionaries \
549
third_party/icu/mac \
551
third_party/lighttpd \
555
third_party/pthread \
556
third_party/pyftpdlib \
557
third_party/simplejson \
559
_third_party/tcmalloc \
564
tools/wine_valgrind \
566
webkit/data/layout_tests \
569
# There are directories we want to strip, but that are unnecessarily required by the build-system
570
# So we drop everything but the gyp/gypi files and README.chromium (to see what that dir contained)
571
ALMOST_STRIPPED_DIRS := \
573
third_party/gles2_book \
574
third_party/openssl \
577
ifeq (1,$(WANT_SYSTEM_LIBS))
578
# Directories that will be dropped if the corresponding system lib are enabled in GYP_DEFINES
579
# We need to keep some files (like *.gyp) so we can't use STRIPPED_DIRS
580
# We can't drop third_party/zlib because we don't have contrib/minizip/*zip.h, and
581
# third_party/sqlite because it's a conditional build (see USE_SYSTEM_SQLITE)
582
STRIPPED_SYSTEM_LIB_DIRS += \
584
third_party/libjpeg \
586
third_party/libxslt \
590
STRIP_SYSTEM_DIRS = \
591
($(foreach DIR,$(1),$(if $(findstring use_system_$(notdir $(DIR))=1,$(GYP_DEFINES)),\
592
(cd $(2)/$(dir $(DIR)) && \
593
find $(notdir $(DIR)) -depth -mindepth 1 \! \( -name \*.gyp -o -name \*.gypi -o -name README.chromium -o -name \*.patch \) -print -delete );)))
595
ALMOST_STRIP_DIRS = \
596
($(foreach DIR,$(1),(cd $(2)/$(dir $(DIR)) && \
597
find $(notdir $(DIR)) -depth -mindepth 1 \! \( -name \*.gyp -o -name \*.gypi -o -name README.chromium \) -print -delete );))
599
TMP_DDIR := $(DEBIAN_NAME)-$(shell echo $$$$)
600
ifeq (,$(LOCAL_BRANCH))
601
TMP_DIR := $(TMP_DDIR)
603
TMP_DIR := $(LOCAL_BRANCH)
606
get-orig-source: REVISION = $(NULL)
607
get-orig-source: TAG = $(NULL)
608
ifneq (,$(DEBIAN_TAG))
609
get-orig-source: TAG = $(DEBIAN_TAG)
611
ifneq (,$(DEBIAN_REV))
612
get-orig-source: REVISION = --revision src@$(DEBIAN_REV)
614
# Doing either the dev or beta or stable channel
616
ifneq (,$(filter-out stable beta dev Stable Beta Dev,$(CHANNEL)))
617
# Assume it's a version
618
get-orig-source: VERS = $(CHANNEL)
620
get-orig-source: VERS = $(shell wget -qO - $(CHANNELS_URL) | grep -i '^linux,$(CHANNEL)' | cut -d, -f3)
622
get-orig-source: CHROMIUM_URL = $(CHROMIUM_RLZ)/$(VERS)
623
get-orig-source: USE_GREEN_REV = 0
627
get-orig-source: gos-all
629
get-current-source: TAG = $(NULL)
630
get-current-source: REVISION = --revision src@$(DEBIAN_REVISION)
631
ifneq (,$(DEBIAN_REV))
632
get-current-source: REVISION = --revision src@$(DEBIAN_REV)
634
get-current-source: gos-all
636
gos-all: gos-co gos-pack
637
gos-co: GCLIENT_UPDATE_FLAGS = --nohooks --delete_unversioned_trees $(REVISION)
640
@if [ Z$(VERS) = Z ] ; then \
641
echo "Error: Cannot parse $(CHANNELS_URL) to get the release version for channel $(CHANNEL)" ; \
646
$(error gclient doesn\'t support tags. We need to tweak CHROMIUM_URL. Abort)
648
ifeq (,$(LOCAL_BRANCH))
651
@if [ ! -d $(TMP_DIR) ] ; then echo mkdir $(TMP_DIR); mkdir $(TMP_DIR) ; fi
652
@if [ ! -d $(TMP_DIR)/tools/depot_tools ] ; then \
653
echo svn co $(GCLIENT_URL) $(TMP_DIR)/tools/depot_tools ; \
654
svn co $(GCLIENT_URL) $(TMP_DIR)/tools/depot_tools ; \
656
echo svn update $(TMP_DIR)/tools/depot_tools ; \
657
svn update $(TMP_DIR)/tools/depot_tools ; \
659
rm -f $(TMP_DIR)/.gclient
660
ifeq (1,$(USE_GREEN_REV)$(REVISION))
661
cd $(TMP_DIR) && ./tools/depot_tools/gclient config $(CHROMIUM_URL) $(GREEN_REV_URL)
663
cd $(TMP_DIR) && ./tools/depot_tools/gclient config $(CHROMIUM_URL)
665
ifeq (1,$(STRIP_TARBALL))
666
ifneq (,$(STRIPPED_DIRS_FROM_CO))
667
# Add exclusions in .gclient for $(STRIPPED_DIRS_FROM_CO)
668
@for excl in $(STRIPPED_DIRS_FROM_CO) ; do \
669
perl -i -pe 's,("custom_deps"\s*:\s*{),$$1\n "'$$excl'": None\,,' $(TMP_DIR)/.gclient ; \
671
grep -Ev '^($$|[[:blank:]]*#)' $(TMP_DIR)/.gclient
674
# Checkout (drop the previous content and retry if gclient failed, see http://crbug.com/39954)
675
cd $(TMP_DIR) && ./tools/depot_tools/gclient update $(GCLIENT_UPDATE_FLAGS) || \
676
( rm -rf $(foreach dir,src [0-9]*,$(wildcard $(TMP_DIR)/$(dir))) ; \
677
./tools/depot_tools/gclient update $(GCLIENT_UPDATE_FLAGS) )
678
# For NaCL, run the hooks, but not the gyp ones
680
SDIR=`grep '"name"' .gclient | cut -d\" -f4` ; \
681
perl -i~ -pe 's%(.python., .src/build/gyp_chromium.)%"echo", "#disabled#", $$1%' $$SDIR/DEPS; \
682
./tools/depot_tools/gclient runhooks ; \
683
mv $$SDIR/DEPS~ $$SDIR/DEPS ; )
685
ifneq (,$(LOCAL_BRANCH))
687
cp -la $(TMP_DIR) $(TMP_DDIR)
689
ifeq (1,$(STRIP_TARBALL))
690
# Strip tarball from some big directories not needed on the linux platform
691
cd $(TMP_DDIR)/src && rm -rfv $(STRIPPED_DIRS) | grep -vE '/\.svn(/|.$$)' > REMOVED-stripped.txt
692
ifneq (,$(ALMOST_STRIPPED_DIRS))
693
# Strip listed dirs almost completely (keep *.gyp and README.chromium)
694
$(call ALMOST_STRIP_DIRS,$(ALMOST_STRIPPED_DIRS),$(TMP_DDIR)/src) | grep -vE '/\.svn(/|.$$)' >> $(TMP_DDIR)/src/REMOVED-stripped.txt
696
ifneq (,$(STRIPPED_SYSTEM_LIB_DIRS))
697
$(call STRIP_SYSTEM_DIRS,$(STRIPPED_SYSTEM_LIB_DIRS),$(TMP_DDIR)/src) | grep -vE '/\.svn(/|.$$)' >> $(TMP_DDIR)/src/REMOVED-stripped.txt
701
cd $(TMP_DDIR)/src && find . -type f \( -iname \*.exe -o -iname \*.dll -o -iname \*.pdb -o -name \*.o -o -name \*.a -o -name \*.dylib -o -name \*.so -o -name \*.so.\* \) -exec rm -fv {} \; > REMOVED-bin_only.txt
702
wc -l $(TMP_DDIR)/src/REMOVED-*.txt
704
gos-pack: TMP_DIR = $(TMP_DDIR)
705
ifneq (,$(DEBIAN_TAG))
706
gos-pack: VERSION = $(shell echo $(DEBIAN_TAG) | cut -d= -f2)
709
gos-pack: REVISION = $(shell cd $(TMP_DIR)/src && svn log --xml --limit 1 | grep -E '^( *revision=|<date>)' | tr -d '\n' | \
710
sed -e 's/.*"\([0-9]*\)".*>\(....\)-\(..\)-\(..\)T.*/\2\3\4r\1/')
711
gos-pack: VERSION = $(shell cut -d= -f2 $(TMP_DIR)/src/chrome/VERSION | sed -e 's,$$,.,' | tr -d '\n' | sed -e 's/.$$//')~svn$(REVISION)
713
gos-pack: REVISION = $(shell cd $(TMP_DIR)/src && svn info | grep ^Revision: | cut -d' ' -f2)
714
gos-pack: VERSION = $(shell cut -d= -f2 $(TMP_DIR)/src/chrome/VERSION | sed -e 's,$$,.,' | tr -d '\n' | sed -e 's/.$$//')~r$(REVISION)
718
ifneq (,$(findstring Ubuntu,$(DEBIAN_DIST)))
719
# Merge Translations from Launchpad
720
if [ ! -d $(TMP_DIR)/translations-tools ] ; then bzr export $(TMP_DIR)/translations-tools $(TRANSLATIONS_TOOLS_BRANCH) ; fi
721
if [ ! -d $(TMP_DIR)/translations-export ] ; then bzr export $(TMP_DIR)/translations-export $(TRANSLATIONS_EXPORT_BRANCH) ; fi
722
( cd $(TMP_DIR)/src ; ../translations-tools/chromium2pot.py $(GRIT_CONVERTER_FLAGS) $(GRIT_TEMPLATES); cp translations-patches ../../debian/patches; mv translations-patches/* ../../debian/patches; cd ../../debian/patches/translation-patches; sed 's\--- old\--- old/src\' *; sed 's\+++ new\+++ new/src\' * )
724
@( cd debian/patches ; ls translations* | xargs --verbose -n 1 diffstat -p 1 )
727
if [ src != $(DEB_TAR_SRCDIR) ] ; then mv $(TMP_DIR)/src $(TMP_DIR)/$(DEB_TAR_SRCDIR) ; fi
728
#mv $(TMP_DIR)/tools/depot_tools $(TMP_DIR)/$(DEB_TAR_SRCDIR)/depot_tools
729
( cd $(TMP_DIR) ; tar --exclude-vcs -zcf ../../$(DEBIAN_NAME)_$(VERSION).orig.tar.gz $(DEB_TAR_SRCDIR) )
731
# Remove all files and re-extract to make sure we don't have any leftover VCS files
732
rm -rf $(TMP_DIR) && tar -zxf ../$(DEBIAN_NAME)_$(VERSION).orig.tar.gz
733
@echo "# Done (created $(DEBIAN_NAME)_$(VERSION).orig.tar.gz)"