Bug 345047 - Universal build fixup for XULRunner, r=mento

This commit is contained in:
benjamin%smedbergs.us 2006-08-18 20:34:56 +00:00
Родитель 0a0053c799
Коммит cdbbc055df
5 изменённых файлов: 58 добавлений и 78 удалений

Просмотреть файл

@ -51,55 +51,62 @@ include $(OBJDIR)/config/autoconf.mk
DIST = $(OBJDIR)/dist
ifeq ($(MOZ_BUILD_APP),macbrowser)
INSTALLER_DIR = camino/installer
MOZ_PKG_APPNAME = camino
APPNAME_BASE = Camino
BUILDCONFIG_JAR = Contents/MacOS/chrome/embed.jar
ifdef MOZ_DEBUG
DBGTAG = Debug
else
ifeq ($(MOZ_BUILD_APP),suite)
INSTALLER_DIR = xpinstall/packager
else
INSTALLER_DIR = $(MOZ_BUILD_APP)/installer
endif
MOZ_PKG_APPNAME = $(MOZ_APP_NAME)
APPNAME_BASE = $(MOZ_APP_DISPLAYNAME)
BUILDCONFIG_JAR = Contents/MacOS/chrome/toolkit.jar
DBGTAG =
endif
ifdef MOZ_DEBUG
APPNAME = $(APPNAME_BASE)Debug
else
APPNAME = $(APPNAME_BASE)
endif
APP_CONTENTS = Contents/MacOS
ifeq ($(MOZ_BUILD_APP),macbrowser) # {
INSTALLER_DIR = camino/installer
MOZ_PKG_APPNAME = camino
APPNAME = Camino.app
BUILDCONFIG_JAR = Contents/MacOS/chrome/embed.jar
else # } {
MOZ_PKG_APPNAME = $(MOZ_APP_NAME)
APPNAME = $(MOZ_APP_DISPLAYNAME)$(DBGTAG).app
BUILDCONFIG_JAR = Contents/MacOS/chrome/toolkit.jar
INSTALLER_DIR = $(MOZ_BUILD_APP)/installer
ifeq ($(MOZ_BUILD_APP),suite) # {
INSTALLER_DIR = xpinstall/packager
endif # } suite
ifeq ($(MOZ_BUILD_APP),xulrunner) # {
INSTALLER_DIR = xulrunner/installer/mac
BUILDCONFIG_JAR = Versions/Current/chrome/toolkit.jar
APPNAME = XUL.framework
APP_CONTENTS = Versions/Current
endif # } xulrunner
endif # } !camino
postflight_all:
# Build the universal package out of only the bits that would be released.
# Call the packager to set this up. Set UNIVERSAL_BINARY= to avoid producing
# a universal binary too early, before the unified bits have been staged.
# Set MAKE_PACKAGE= to avoid building a dmg. Set SIGN_NSS= to skip shlibsign.
# Set SIGN_NSS= to skip shlibsign.
$(MAKE) -C $(OBJDIR_PPC)/$(INSTALLER_DIR) \
UNIVERSAL_BINARY= MAKE_PACKAGE= SIGN_NSS=
UNIVERSAL_BINARY= SIGN_NSS= stage-package
$(MAKE) -C $(OBJDIR_X86)/$(INSTALLER_DIR) \
UNIVERSAL_BINARY= MAKE_PACKAGE= SIGN_NSS=
UNIVERSAL_BINARY= SIGN_NSS= stage-package
# Remove .chk files that may have been copied from the NSS build. These will
# cause unify to warn or fail if present. New .chk files that are
# appropriate for the merged libraries will be generated when the universal
# dmg is built.
rm -f $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME).app/Contents/MacOS/*.chk \
$(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME).app/Contents/MacOS/*.chk
rm -f $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(APP_CONTENTS)/*.chk \
$(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(APP_CONTENTS)/*.chk
# The only difference betewen the two trees now should be the
# about:buildconfig page. Fix it up.
$(TOPSRCDIR)/build/macosx/universal/fix-buildconfig \
$(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME).app/$(BUILDCONFIG_JAR) \
$(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME).app/$(BUILDCONFIG_JAR)
$(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG_JAR) \
$(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG_JAR)
mkdir -p $(DIST_UNI)/$(MOZ_PKG_APPNAME)
rm -f $(DIST_X86)/universal
ln -s $(DIST_UNI) $(DIST_X86)/universal
rm -rf $(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME).app
rm -rf $(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
$(TOPSRCDIR)/build/macosx/universal/unify \
$(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME).app \
$(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME).app \
$(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME).app
$(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
$(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
$(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
# A universal .dmg can now be produced by making in either architecture's
# INSTALLER_DIR.

Просмотреть файл

@ -4346,7 +4346,7 @@ calendar)
xulrunner)
MOZ_APP_NAME=xulrunner
MOZ_APP_DISPLAYNAME=Mozilla
MOZ_APP_DISPLAYNAME=XULRunner
MOZ_XUL_APP=1
MOZ_UPDATER=1
MOZ_XULRUNNER=1

Просмотреть файл

@ -106,7 +106,9 @@ else
_APPNAME = $(MOZ_APP_DISPLAYNAME).app
endif
endif
ifndef _BINPATH
_BINPATH = /$(_APPNAME)/Contents/MacOS
endif # _BINPATH
PKG_SUFFIX = .dmg
PKG_DMG_FLAGS =
ifneq (,$(MOZ_PKG_MAC_DSSTORE))
@ -232,7 +234,7 @@ NO_PKG_FILES += \
# browser/locales/Makefile uses this makefile for it's variable defs, but
# doesn't want the libs:: rule.
ifndef PACKAGER_NO_LIBS
libs:: $(PACKAGE)
libs:: make-package
endif
DEFINES += -DDLL_PREFIX=$(DLL_PREFIX) -DDLL_SUFFIX=$(DLL_SUFFIX)
@ -246,12 +248,6 @@ endif
GARBAGE += $(DIST)/$(PACKAGE) $(PACKAGE)
ifdef USE_SHORT_LIBNAME
MOZILLA_BIN = $(DIST)/bin/$(MOZ_PKG_APPNAME)$(BIN_SUFFIX)
else
MOZILLA_BIN = $(DIST)/bin/$(MOZ_PKG_APPNAME)-bin
endif
ifeq ($(OS_ARCH),IRIX)
STRIP_FLAGS = -f
endif
@ -311,7 +307,7 @@ endif
$(foreach pkg,$(MOZ_OPTIONAL_PKG_LIST),$(PKG_ARG)) )
$(PERL) $(topsrcdir)/xpinstall/packager/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DEPTH)/installer-stage/nonlocalized/components -v
$(PACKAGE): $(MOZILLA_BIN) $(MOZ_PKG_MANIFEST) $(MOZ_PKG_REMOVALS_GEN)
stage-package: $(MOZ_PKG_MANIFEST) $(MOZ_PKG_REMOVALS_GEN)
@rm -rf $(DIST)/$(MOZ_PKG_APPNAME) $(DIST)/$(PKG_BASENAME).tar $(DIST)/$(PKG_BASENAME).dmg $@ $(EXCLUDE_LIST)
# NOTE: this must be a tar now that dist links into the tree so that we
# do not strip the binaries actually in the tree.
@ -368,5 +364,7 @@ endif
ifdef MOZ_PKG_REMOVALS
$(SYSINSTALL) $(MOZ_PKG_REMOVALS_GEN) $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)
endif # MOZ_PKG_REMOVALS
make-package: stage-package
@echo "Compressing..."
cd $(DIST); $(MAKE_PACKAGE)

Просмотреть файл

@ -54,10 +54,14 @@ NO_PKG_FILES = \
xpt_link* \
$(NULL)
# If we're on mac, we want to make the .pkg first, in the mac/
# directory. Then packager.mk can put it into a DMG
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
DIRS += mac
_APPNAME = $(PKG_BASENAME).pkg
PKG_SKIP_STRIP = 1
MOZ_PKG_APPNAME = xulrunner-pkg
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -58,19 +58,17 @@ NO_PKG_FILES = \
include $(topsrcdir)/config/rules.mk
libs:: stage-package
%.plist: %.plist.in
$(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $< > $@
PACKAGER_NO_LIBS=1
_APPNAME = XUL.framework
_BINPATH = /$(_APPNAME)/Versions/Current
# Include this solely for additional NO_PKG_FILES
include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
BINARY_DIR = $(DIST)/package-stage/XUL.framework/Versions/$(MOZILLA_VERSION)
SOFTOKN = $(BINARY_DIR)/$(DLL_PREFIX)softokn3$(DLL_SUFFIX)
FREEBL = $(BINARY_DIR)/$(DLL_PREFIX)freebl3$(DLL_SUFFIX)
_ABS_OBJDIR := $(shell pwd)
_ABS_DIST := $(shell cd $(DIST) && pwd)
@ -88,44 +86,17 @@ CHOWN_REVERT ?= $(error CHOWN_REVERT must be set to a setuid script.)
libs:: Info.plist Description.plist
$(RM) -rf resource-stage
mkdir resource-stage
$(RM) -rf $(DIST)/package-stage
mkdir $(DIST)/package-stage
rsync --copy-unsafe-links -a $(DIST)/XUL.framework $(DIST)/package-stage
cd $(BINARY_DIR) && $(RM) -rf $(NO_PKG_FILES)
echo "Stripping package directory..."
find $(BINARY_DIR) ! -type d \
! -name "*.js" \
! -name "*.xpt" \
! -name "*.gif" \
! -name "*.jpg" \
! -name "*.png" \
! -name "*.xpm" \
! -name "*.txt" \
! -name "*.rdf" \
! -name "*.sh" \
! -name "*.properties" \
! -name "*.dtd" \
! -name "*.html" \
! -name "*.xul" \
! -name "*.css" \
! -name "*.xml" \
! -name "*.jar" \
! -name "*.dat" \
! -name "*.tbl" \
! -name "*.src" \
! -name "*.reg" \
$(PLATFORM_EXCLUDE_LIST) \
-exec $(STRIP) $(STRIP_FLAGS) {} >/dev/null 2>&1 \;
$(SIGN_NSS)
chmod -R a+rX,u+w,go-w,-s,-t $(DIST)/package-stage
$(RM) -rf $(DIST)/$(STAGEPATH)xulrunner-pkg
mkdir $(DIST)/$(STAGEPATH)xulrunner-pkg
chmod -R a+rX,u+w,go-w,-s,-t $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)
# For some unknown reason, PackageMaker requires absolute paths to everything.
# For other poor reasons, PackageMaker returns an exit code of "1" if the
# version string has any letters in it (e.g. 1.9a1).
unset NEXT_ROOT; \
$(CHOWN_ROOT) $(DIST)/package-stage && \
$(CHOWN_ROOT) $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME) && \
/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -build -v \
-p $(_ABS_DIST)/$(PKG_BASENAME).pkg \
-f $(_ABS_DIST)/package-stage \
-p $(_ABS_DIST)/$(STAGEPATH)xulrunner-pkg/$(PKG_BASENAME).pkg \
-f $(_ABS_DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME) \
-r $(_ABS_OBJDIR)/resource-stage \
-i $(_ABS_OBJDIR)/Info.plist \
-d $(_ABS_OBJDIR)/Description.plist > packagemaker.log; \
@ -134,5 +105,5 @@ libs:: Info.plist Description.plist
`grep -c 'was completed with the following non-fatal errors' < packagemaker.log` -gt 0 ]; then \
SAVED=0; \
fi; \
$(CHOWN_REVERT) $(DIST)/package-stage; \
$(CHOWN_REVERT) $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME); \
exit $$SAVED