148
148
ifeq (1,$(COMPONENT_SHARED_LIB_BUILD))
149
149
BROWSER_GYP_DEFINES += component=shared_library
150
FFMPEG_MT_GYP_DEFINES += component=shared_library
150
FFMPEG_GYP_DEFINES += component=shared_library
153
153
# Webkit library is enormous. Exclude for now.
198
199
BROWSER_GYP_DEFINES += \
199
200
proprietary_codecs=1 \
201
FFMPEG_MT_GYP_DEFINES = \
202
FFMPEG_GYP_DEFINES += \
202
203
use_system_vpx=0 \
203
204
release_extra_cflags=-g \
205
FFMPEG_MT_STD_GYP_DEFINES = $(NULL)
206
FFMPEG_MT_EXTRA_GYP_DEFINES = ffmpeg_branding=Chrome
206
FFMPEG_STD_GYP_DEFINES = $(NULL)
207
FFMPEG_EXTRA_GYP_DEFINES = ffmpeg_branding=Chrome
208
209
# Precise doesn't set some settings.
209
210
ifeq (,$(filter 12.04%,$(UBUNTU_DIST)))
248
249
# Debian Policy §4.9
249
250
binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep patch:
251
dh --sourcedirectory=$(DEB_TAR_SRCDIR) --builddirectory=$(DEB_TAR_SRCDIR)/out/$(BUILD_TYPE) --with quilt $@
252
dh --sourcedirectory=$(DEB_TAR_SRCDIR) --builddirectory=$(DEB_TAR_SRCDIR)/out/$(BUILD_TYPE)-chromium --with quilt $@
253
254
# BZR build-deb rule
254
255
get-packaged-orig-source: URL=https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$(ORIG_VERSION).tar.xz
274
275
override_dh_auto_configure:
275
276
# Don't configure here. We configure and build many times in 'build'.
277
# There are three things to build. Standard, ffmpeg simple, and ffmpeg full.
278
override_dh_auto_build: build-stamp build-stamp-ffmpeg-std build-stamp-ffmpeg-extra
278
# There are three things to build. Standard and ffmpeg full.
279
override_dh_auto_build: build-stamp build-stamp-ffmpeg-extra
280
281
override_dh_fixperms:
281
282
dh_fixperms --exclude $(DEB_FIXPERMS_EXCLUDE)
300
301
local-install-arch:
302
303
# Two stages: Install out of source tree. Copy to packaging.
303
mkdir -p debian/tmp/$(LIB_DIR)
304
(cd $(SRC_DIR)/out/$(BUILD_TYPE); tar cf - . $(foreach excl,$(TRASH),--exclude=$(excl) );) | (cd debian/tmp/$(LIB_DIR); tar xvf -;)
305
mkdir -p $(CURDIR)/debian/tmp-std/$(LIB_DIR)/libs
306
mv -v $(SRC_DIR)/out/$(BUILD_TYPE)-chromium/lib/libffmpeg.so $(CURDIR)/debian/tmp-std/$(LIB_DIR)/libs
308
mkdir -p $(CURDIR)/debian/tmp-extra/$(LIB_DIR)/libs
309
mv -v $(SRC_DIR)/out/$(BUILD_TYPE)-ffmpeg-extra/lib/libffmpeg.so $(CURDIR)/debian/tmp-extra/$(LIB_DIR)/libs
311
mkdir -p $(CURDIR)/debian/tmp/$(LIB_DIR)
312
(cd $(SRC_DIR)/out/$(BUILD_TYPE)-chromium; tar cf - . $(foreach excl,$(TRASH),--exclude=$(excl) );) | (cd debian/tmp/$(LIB_DIR); tar xvf -;)
305
313
ifeq (1,$(COMPONENT_SHARED_LIB_BUILD))
306
314
mkdir -p debian/tmp/$(LIB_DIR)/libs
307
cp $(SRC_DIR)/out/$(BUILD_TYPE)/lib/*.so debian/tmp/$(LIB_DIR)/libs/
310
317
ifneq ($(SNAPPY_PKGR_TO_USE),)
393
400
# NaCL may be blacklisted, so only include it when it's been built
394
401
ifeq (,$(filter disable_nacl=1,$(GYP_DEFINES)))
395
cp -a $(SRC_DIR)/out/$(BUILD_TYPE)/libppGoogleNaClPluginChrome.so debian/chromium-browser/$(LIB_DIR)/
396
cp -a $(SRC_DIR)/out/$(BUILD_TYPE)/nacl_irt_* debian/chromium-browser/$(LIB_DIR)/
402
cp -a $(SRC_DIR)/out/$(BUILD_TYPE)-chromium/libppGoogleNaClPluginChrome.so debian/chromium-browser/$(LIB_DIR)/
403
cp -a $(SRC_DIR)/out/$(BUILD_TYPE)-chromium/nacl_irt_* debian/chromium-browser/$(LIB_DIR)/
398
405
# Locales: only keep en-US in the main deb
399
406
# Discard everything except en-US
440
447
override_dh_clean:
443
rm -rf $(DEB_TAR_SRCDIR)/out
450
rm -rf $(SRC_DIR)/out
444
451
dh_clean debian/chromium-browser.sh debian/*-stamp debian/stamp-* debian/tmp-* build-stamp* $(subst_files) $(FFMPEG_SRC_DIR)/yasm
445
452
rm -rf debian/snappy
447
find $(DEB_TAR_SRCDIR) \( -name \*.pyc -o -name \*.pyo -name \*.o \) -delete
448
find $(DEB_TAR_SRCDIR) -regex '.*/\([^/]*\)/\1[^/]*\.\(Makefile\|\(target\|host\)\.mk\)' -delete
454
find $(SRC_DIR) \( -name \*.pyc -o -name \*.pyo -name \*.o \) -delete
455
find $(SRC_DIR) -regex '.*/\([^/]*\)/\1[^/]*\.\(Makefile\|\(target\|host\)\.mk\)' -delete
461
468
sed -e 's/@BUILD_DIST@/$(DEBIAN_DIST_NAME) $(DEBIAN_DIST_VERSION)/g' \
462
-e 's/@BUILD_DIST_NAME@/$(DEBIAN_DIST_NAME)/g' \
463
-e 's/@BUILD_DIST_VERSION@/$(DEBIAN_DIST_VERSION)/g' \
464
-e 's/@UPSTREAM_VERSION@/$(DEBIAN_UPSTREAM_VERSION)/g' \
469
-e 's/@BUILD_DIST_NAME@/$(DEBIAN_DIST_NAME)/g' \
470
-e 's/@BUILD_DIST_VERSION@/$(DEBIAN_DIST_VERSION)/g' \
471
-e 's/@UPSTREAM_VERSION@/$(DEBIAN_UPSTREAM_VERSION)/g' \
468
475
# This is really configure+build in one step. b depends on c.
469
476
build-stamp: GYP_ENV = GYP_GENERATORS=ninja
470
477
build-stamp: GYP_ENV += GYP_DEFINES="$(GYP_DEFINES) $(BROWSER_GYP_DEFINES)"
471
478
build-stamp: debian/chromium-browser.sh
480
test ! -e $(SRC_DIR)/out/$(BUILD_TYPE)
473
481
# Upstream changes often. Fail when they introduce a config flag we don't know about.
474
482
-diff --ignore-case --suppress-common-lines --unified=0 debian/known_gyp_flags <(sed -e "/: *'<(/{ s,.*'<(,,g; s,).*,,; p; }" -e d build/common.gypi | LC_ALL=C sort -u |grep -v '^\(win_\|mac_\|android_\|.san\|..san\|msvs_\|ios_\|goma_\|windows_\|wix_\|directx_\)') || echo This seems bad.
476
484
cd $(SRC_DIR) && $(GYP_ENV) $(CROSS_BUILD) build/gyp_chromium build/all.gyp $(GYP_PARAMS)
479
while sleep 1200; do echo "# I ATEN'T DEAD"; done& $(BUILD_DEFINES) $(NINJA) $(BUILD_ARGS) $(BUILD_TARGETS) && { kill \%1; sleep 1; echo; exit 0; } || { kill \%1; exit 1; sleep 2; echo; exit 1; }
487
while sleep 1200; do echo "# I ATEN'T DEAD"; done& $(BUILD_DEFINES) $(NINJA) $(BUILD_ARGS) $(BUILD_TARGETS) && { kill \%1; sleep 1; echo; true; } || { kill \%1; exit 1; sleep 2; echo; false; }
489
mv $(SRC_DIR)/out/$(BUILD_TYPE) $(SRC_DIR)/out/$(BUILD_TYPE)-chromium
482
build-stamp-ffmpeg-%: GYP_DEFINES += $(FFMPEG_MT_$(subst std,STD,$(subst extra,EXTRA,$*))_GYP_DEFINES) $(FFMPEG_MT_GYP_DEFINES)
492
build-stamp-ffmpeg-%: GYP_DEFINES += $(FFMPEG_EXTRA_GYP_DEFINES) $(FFMPEG_GYP_DEFINES)
483
493
build-stamp-ffmpeg-%: GYP_ENV = GYP_GENERATORS=ninja
484
494
build-stamp-ffmpeg-%: GYP_ENV += GYP_DEFINES="$(GYP_DEFINES)"
495
build-stamp-ffmpeg-%: TARGET := lib/libffmpeg.so
485
496
build-stamp-ffmpeg-%:
488
cd $(SRC_DIR) && $(GYP_ENV) $(CROSS_BUILD) build/gyp_chromium $(FFMPEG_DIR)/ffmpeg.gyp $(GYP_PARAMS)
499
test ! -e $(SRC_DIR)/out/$(BUILD_TYPE)
500
cd $(SRC_DIR) && $(GYP_ENV) $(CROSS_BUILD) build/gyp_chromium build/all.gyp $(GYP_PARAMS)
491
$(NINJA) $(BUILD_ARGS)
503
$(NINJA) $(BUILD_ARGS) $(TARGET)
492
504
mkdir -p debian/tmp-$*/$(LIB_DIR)
493
cp $(SRC_DIR)/out/$(BUILD_TYPE)/lib/libffmpeg.so $(CURDIR)/debian/tmp-$*/$(LIB_DIR)/libs
505
mv -v $(SRC_DIR)/out/$(BUILD_TYPE) $(SRC_DIR)/out/$(BUILD_TYPE)-ffmpeg-$*
546
558
T=$$(mktemp -d -t chromium-comparisons-XXXXXXX); \
549
find debian/tmp debian/tmp-extra debian/tmp-std -type f |cut -d/ -f3- >$${T}/unfiltered-built; \
561
find debian/tmp debian/tmp-extra -type f |cut -d/ -f3- >$${T}/unfiltered-built; \
550
562
grep -E \($(subst $(SPACE),\|,$(INDEP_MATCH))\) $${T}/unfiltered-built $(foreach expr,$(RENAMED_FILE), |sed -r -e $(expr)) |grep -v /en-US.pak | LC_ALL=C sort >$${T}/built; \
551
563
dh_listpackages -i |while read pkgname; do find debian/$${pkgname} -type f; done |grep -v /DEBIAN |cut -d/ -f3- |grep -v ^usr/lib/debug/ | LC_ALL=C sort >$${T}/unfiltered-packaged; \
552
564
grep -E \($(subst $(SPACE),\|,$(INDEP_MATCH))\) $${T}/unfiltered-packaged |grep -v /en-US.pak >$${T}/packaged || true; \
564
576
T=$$(mktemp -d -t chromium-comparisons-XXXXXXX);\
567
DUPES=`find $(PKG_DIRS) -type f -print | grep -v /DEBIAN/ | cut -d/ -f3- | LC_ALL=C sort | uniq -c | grep -vE '^ *2 .*/lib/libffmpeg.so$$' | grep -vE '^ *1 '` || true; \
579
DUPES=`find $(PKG_DIRS) -type f -print | grep -v /DEBIAN/ | cut -d/ -f3- | LC_ALL=C sort | uniq -c | grep -vE '^ *2 .*/libs/libffmpeg.so$$' | grep -vE '^ *1 '` || true; \
568
580
if [ "Z$$DUPES" != Z ] ; then \
569
581
echo " => Found duplicates:\n $$DUPES" ; \