~chromium-team/chromium-browser/artful-beta

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Chad MILLER
  • Date: 2015-07-28 00:34:31 UTC
  • Revision ID: chad.miller@canonical.com-20150728003431-enyzc9pduo8savs4
fix up rules breakage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
GYP_PARAMS := --depth=$(CURDIR) --format=ninja
56
56
 
57
57
BROWSER_GYP_DEFINES =
58
 
FFMPEG_MT_GYP_DEFINES =
 
58
FFMPEG_GYP_DEFINES =
59
59
GYP_DEFINES =
60
60
 
61
61
# Build the launchpad translations (already landed upstream)
147
147
 
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
151
151
endif
152
152
 
153
153
# Webkit library is enormous. Exclude for now.
170
170
GYP_DEFINES += logging_like_official_build=1
171
171
endif
172
172
 
 
173
BUILD_ARGS := -v 
173
174
BUILD_ARGS += -C $(DEB_TAR_SRCDIR)/out/$(BUILD_TYPE)
174
175
 
175
176
# Shared libraries
198
199
BROWSER_GYP_DEFINES += \
199
200
        proprietary_codecs=1 \
200
201
        $(NULL)
201
 
FFMPEG_MT_GYP_DEFINES = \
 
202
FFMPEG_GYP_DEFINES += \
202
203
        use_system_vpx=0 \
203
204
        release_extra_cflags=-g \
204
205
        $(NULL)
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
207
208
 
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:
250
251
        @set -eux
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 $@
252
253
 
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'.
276
277
 
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
279
280
 
280
281
override_dh_fixperms:
281
282
        dh_fixperms --exclude $(DEB_FIXPERMS_EXCLUDE)
300
301
local-install-arch:
301
302
        @set -eux
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 -;)
 
304
 
 
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
 
307
 
 
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
 
310
 
 
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/
308
315
endif
309
316
 
310
317
ifneq ($(SNAPPY_PKGR_TO_USE),)
392
399
 
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)/
397
404
endif
398
405
        # Locales: only keep en-US in the main deb
399
406
        # Discard everything except en-US
440
447
override_dh_clean:
441
448
        @set -eux
442
449
        test -d chrome
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
446
453
 
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
449
456
 
450
457
        set +x
451
458
        echo
459
466
        @set -eux
460
467
        ### configure
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' \
465
 
            $< > $@
466
 
        
 
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' \
 
472
    $< > $@
 
473
 
467
474
 
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
472
479
        @set -eux
 
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.
475
483
 
476
484
        cd $(SRC_DIR) && $(GYP_ENV) $(CROSS_BUILD) build/gyp_chromium build/all.gyp $(GYP_PARAMS)
477
485
 
478
486
        ### build
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; }
 
488
 
 
489
        mv $(SRC_DIR)/out/$(BUILD_TYPE) $(SRC_DIR)/out/$(BUILD_TYPE)-chromium
480
490
        touch $@
481
491
 
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-%:
486
497
        @set -eux
487
498
        ### configure
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)
489
501
 
490
502
        ### build
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-$*
494
506
        touch $@
495
507
 
496
508
 
546
558
        T=$$(mktemp -d -t chromium-comparisons-XXXXXXX); \
547
559
        test "$${T}"; \
548
560
        test -d $${T}; \
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);\
565
577
        test "$${T}"; \
566
578
        test -d $${T};\
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" ; \
570
582
          exit 1 ; \