81
81
# Build the launchpad translations (already landed upstream)
82
82
GYP_DEFINES += use_third_party_translations=1
83
# Also merges the newer translations from launchpad
84
WANT_LP_TRANSLATIONS_IN_BUILD ?= 0
86
## Policy: 2012-10-30, cm,kv,cc, disabling merging of LP translations. "0"
87
MERGE_LP_TRANSLATIONS_IN_TARBALL = 0
88
## Rationale: Instead of merging other stuff before "orig" (!) tarball
89
## creation, let's export translation templates to Launchpad, and send them
90
## upstream to be included in the real orig source. It's slower for circuit,
91
## but all users win, and is less buggy for us.
94
84
# Always add debug symbols, and strip them when we don't want them.
95
85
#GYP_DEFINES += release_extra_cflags="-g"
367
362
debian/pre-build-stamp:
368
363
ifneq (,$(findstring Ubuntu,$(DEBIAN_DIST)))
369
ifeq (1,$(WANT_LP_TRANSLATIONS_IN_BUILD))
370
# Apply the translations patches generated by get-orig-sources
371
@(set -e ; cd ./src ; if [ -d translations-patches ] ; then \
372
for patch in translations-patches/*.patch ; do \
373
echo "# Applying $$patch..." ; \
374
patch -p 1 < $$patch ; done ; fi )
376
364
sed -ri '/const PrepopulatedEngine google = \{/,/\}\;/ { s/sourceid=chrome\&/&client=ubuntu\&channel=cs\&/g; }' \
377
365
src/chrome/browser/search_engines/template_url_prepopulate_data.cc
439
427
# disabled: SecurityTest exhausts memory to fail
440
428
# disabled: PowerMonitorTest doesn't mock power enough, I think
441
429
# disabled: FileUtilTest fails because of fakeroot interaction
442
cd $(SRC_DIR); ./out/$(BUILD_TYPE)/base_unittests --gtest_filter=-SecurityTest.NewOverflow:PowerMonitorTest.\*:FileUtilTest.ChangeFilePermissionsAndRead:FileUtilTest.ChangeFilePermissionsAndWrite:FileUtilTest.ChangeDirectoryPermissionsAndEnumerate |tee $(TEMPFILE) |cat -n
430
# disabled: ReadOnlyFileUtilTest.ContentsEqual fakeroot
431
# disabled: ReadOnlyFileUtilTest.TextContentsEqual fakeroot
433
cd $(SRC_DIR); ./out/$(BUILD_TYPE)/base_unittests --gtest_filter=-SecurityTest.NewOverflow:PowerMonitorTest.\*:FileUtilTest.ChangeFilePermissionsAndRead:FileUtilTest.ChangeFilePermissionsAndWrite:FileUtilTest.ChangeDirectoryPermissionsAndEnumerate:ReadOnlyFileUtilTest.ContentsEqual:ReadOnlyFileUtilTest.TextContentsEqual: |tee $(TEMPFILE) |cat -n; $(KEEPALIVE) stop
443
434
@echo If more than 15 tests fail, then we interpret that as too poor quality to continue.
444
435
sed -e 1,/FAILED.\*tests,\ listed\ below/d $(TEMPFILE) |grep -c \\\[\ \ FAILED\ \ \\\] |xargs test 15 -gt
445
436
@echo Unit tests are good enough.
478
469
common-install-prehook-impl::
479
470
ifeq (1,$(COMPONENT_SHARED_LIB_BUILD))
480
471
# Set the directory for looking up component libraries.
481
find debian/tmp*/usr/lib/chromium-browser/libs -type f -name \*.so -execdir chrpath --replace "\$$ORIGIN" {} \;
482
find debian/tmp*/usr/lib/chromium-browser -type f -name \*.so -maxdepth 1 -execdir chrpath --replace "\$$ORIGIN/libs" {} \;
483
find debian/tmp*/usr/lib/chromium-browser -type f -executable -maxdepth 1 -execdir chrpath --replace "\$$ORIGIN/libs" {} \;
472
find debian/tmp*/usr/lib/chromium-browser/libs -type f -name \*.so -execdir chrpath --replace "\$$ORIGIN" {} \;
473
find debian/tmp*/usr/lib/chromium-browser -maxdepth 1 -type f -name \*.so -execdir chrpath --replace "\$$ORIGIN/libs" {} \;
474
find debian/tmp*/usr/lib/chromium-browser -maxdepth 1 -type f -executable -execdir chrpath --replace "\$$ORIGIN/libs" {} \;
486
477
binary-install/$(DEBIAN_NAME)::
503
494
cp -a debian/tmp/$(LIB_DIR)/nacl_irt_* debian/$(DEBIAN_NAME)/$(LIB_DIR)/
505
496
# Locales: only keep en-US in the main deb. This is the opposite of binary-install/$(DEBIAN_NAME)-l10n rule.
506
find $(CURDIR)/debian/$(DEBIAN_NAME)/$(LIB_DIR)/locales -type f -name \*.pak ! -name en-US.pak -delete
497
find $(CURDIR)/debian/$(DEBIAN_NAME)/$(LIB_DIR)/*locales -type f -name \*.pak ! -name en-US.pak -delete
499
# Tke l10n .install file is far too greedy, but we don't want to list every
500
# language there because we don't know them all. Remove what's are in the main
508
502
binary-install/$(DEBIAN_NAME)-l10n::
509
rm $(CURDIR)/debian/$(DEBIAN_NAME)-l10n/$(LIB_DIR)/locales/en-US.pak
503
rm $(CURDIR)/debian/$(DEBIAN_NAME)-l10n/$(LIB_DIR)/*locales/en-US.pak
512
506
PKG_DIRS = $(addprefix debian/,$(shell dh_listpackages))
596
592
echo " => Found differences, please investigate. /tmp/built-$$$$ /tmp/packaged-$$$$" ; \
599
for expr in $(BUILT_UNUSED_MATCH); do if ! grep -E $$expr /tmp/unfiltered-built-$$$$ >/dev/null; then echo Warning: Unused built matcher: $$expr; fi; done; \
600
for expr in $(PACKAGED_NOT_FROM_TREE_MATCH); do if ! grep -E $$expr /tmp/unfiltered-packaged-$$$$ >/dev/null; then echo Warning: Unused packaged matcher: $$expr; fi; done; \
601
rm -f /tmp/*built-$$$$ /tmp/*packaged-$$$$ /tmp/refiltering$$$$
595
for expr in $(BUILT_UNUSED_MATCH); do if ! grep -E $$expr /tmp/unfiltered-built-$$$$ >/dev/null; then echo "Warning: Unused built matcher: $$expr in /tmp/unfiltered-built-$$$$ "; fi; done; \
596
for expr in $(PACKAGED_NOT_FROM_TREE_MATCH); do if ! grep -E $$expr /tmp/unfiltered-packaged-$$$$ >/dev/null; then echo "Warning: Unused packaged matcher: $$expr"; fi; done; \
599
#rm -f /tmp/*built-$$$$ /tmp/*packaged-$$$$ /tmp/refiltering$$$$
603
601
###############################################################################################
606
TRANSLATIONS_TOOLS_BRANCH := lp:~chromium-team/chromium-browser/chromium-translations-tools.head
607
TRANSLATIONS_EXPORT_BRANCH := lp:~chromium-team/chromium-browser/chromium-translations-exports.head
609
chrome/app/chromium_strings.grd \
610
chrome/app/generated_resources.grd \
611
chrome/app/policy/policy_templates.grd \
612
ui/base/strings/ui_strings.grd \
613
webkit/glue/inspector_strings.grd \
614
webkit/glue/webkit_strings.grd \
616
OTHER_GRIT_TEMPLATES := \
617
ui/base/strings/app_locale_settings.grd \
618
chrome/app/resources/locale_settings.grd \
619
chrome/app/resources/locale_settings_linux.grd \
621
MAPPED_GRIT_TEMPLATES := \
622
--map-template-names ui/base/strings/ui_strings.grd=ui/base/strings/app_strings.grd \
625
604
# New langs with enough coverage to land in official builds
626
605
# (leave empty to accept all new lang)
627
GRIT_WHITELISTED_LANGS ?= \
634
GRIT_CONVERTER_FLAGS := \
635
--create-patches translations-patches \
636
--import-gettext ../translations-export \
637
--export-grit ../translations-grit \
638
--build-gyp-file build/common.gypi \
639
--other-grd-files $(shell echo $(OTHER_GRIT_TEMPLATES) | tr ' ' ',') \
640
$(MAPPED_GRIT_TEMPLATES) \
606
patch-translations: T := $(shell mktemp -d -t chromium-launchpad-translations-XXXXXXX)
607
patch-translations: GRIT_WHITELISTED_LANGS ?= ca@valencia eu gl ug
608
patch-translations: TRANSLATIONS_TOOLS_BRANCH := http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-translations-tools.head
609
patch-translations: TRANSLATIONS_EXPORT_BRANCH := http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-translations-exports.head
610
patch-translations: GRIT_TEMPLATES := chrome/app/chromium_strings.grd chrome/app/generated_resources.grd chrome/app/policy/policy_templates.grd ui/base/strings/ui_strings.grd webkit/glue/inspector_strings.grd webkit/glue/webkit_strings.grd
611
patch-translations: OTHER_GRIT_TEMPLATES := ui/base/strings/app_locale_settings.grd chrome/app/resources/locale_settings.grd chrome/app/resources/locale_settings_linux.grd
612
patch-translations: MAPPED_GRIT_TEMPLATES := --map-template-names ui/base/strings/ui_strings.grd=ui/base/strings/app_strings.grd
613
patch-translations: GRIT_CONVERTER_FLAGS := --create-patches translations-patches --import-gettext ../translations-export --export-grit $(T)/translations-grit --build-gyp-file build/common.gypi --other-grd-files $(shell echo $(OTHER_GRIT_TEMPLATES) | tr ' ' ',') $(MAPPED_GRIT_TEMPLATES)
643
614
ifeq (1,$(WANT_ONLY_WHITELISTED_NEW_LANGS))
644
GRIT_CONVERTER_FLAGS += --whitelisted-new-langs $(shell echo $(GRIT_WHITELISTED_LANGS) | tr ' ' ',')
615
patch-translations: GRIT_CONVERTER_FLAGS += --whitelisted-new-langs $(shell echo $(GRIT_WHITELISTED_LANGS) | tr ' ' ',')
617
patch-translations: PATCH_FILE := launchpad_translations.patch
619
test -d $(T)/translations-tools || bzr export $(T)/translations-tools $(TRANSLATIONS_TOOLS_BRANCH)
620
test -d $(T)/translations-export || bzr export $(T)/translations-export $(TRANSLATIONS_EXPORT_BRANCH)
621
cd src; $(T)/translations-tools/chromium2pot.py $(GRIT_CONVERTER_FLAGS) $(GRIT_TEMPLATES)
622
! test "$$(quilt diff)" # if any changes outstanding, abort!
623
-quilt delete "$(PATCH_FILE)"
624
quilt new "$(PATCH_FILE)"
625
set -eu; find translations-grit -type f |sed -e 's,^$(T)/translations-grit/,,' |while read updatedfile; do quilt add -P "$(PATCH_FILE)" src/"$$updatedfile"; cp $(T)/translations-grit/"$$updatedfile" src/"$$updatedfile"; done;
626
{ echo "Description: Contributed translations from Launchpad. "; echo; } |quilt header -r "$(PATCH_FILE)"
627
quilt refresh -pab --no-timestamps "$(PATCH_FILE)"
628
@echo "Patch needs committing."
647
631
###############################################################################################
648
632
# Retrieve/fabricate orig tarball.
654
638
gos: URL=https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$(ORIG_VERSION).tar.xz
655
639
gos: DEST_FILENAME=$(ORIG_PACKAGE)_$(ORIG_VERSION).orig.tar.xz
657
wget --continue --progress=dot:mega --output-document=source.tar.xz $(URL) && tar xf source.tar.xz --exclude-backups --exclude-vcs --directory $(ORIG_PACKAGE)-$(ORIG_VERSION)/src --strip-components=1 && tar cJf $(DEST_FILENAME) $(ORIG_PACKAGE)-$(ORIG_VERSION) || debian/checkout-orig-source.mk
641
mkdir -p $(ORIG_PACKAGE)-$(ORIG_VERSION)/src
642
@set -x; wget --continue --progress=dot:mega --output-document=source.tar.xz $(URL) && tar xf source.tar.xz --exclude-backups --exclude-vcs --directory $(ORIG_PACKAGE)-$(ORIG_VERSION)/src --strip-components=1 && tar cJf $(DEST_FILENAME) $(ORIG_PACKAGE)-$(ORIG_VERSION) || debian/checkout-orig-source.mk
658
643
@echo "# Done (created $(CURDIR)/$(DEST_FILENAME))"
661
#ifeq (1,$(MERGE_LP_TRANSLATIONS_IN_TARBALL))
662
# bzr export $(TMP_DIR)/translations-tools $(TRANSLATIONS_TOOLS_BRANCH)
663
# bzr export $(TMP_DIR)/translations-export $(TRANSLATIONS_EXPORT_BRANCH)
664
# ( cd $(TMP_DIR)/src ; ../translations-tools/chromium2pot.py $(GRIT_CONVERTER_FLAGS) $(GRIT_TEMPLATES) )
666
# @( cd $(TMP_DIR)/src ; find translations-patches -type f | xargs --verbose -n 1 diffstat -p 1 )