Bug 1166538 - Make it more straightforward, path-wise, to change $(ZIP) uses to the zip py_action. r=gps

This commit is contained in:
Mike Hommey 2015-05-20 07:51:48 +09:00
parent 564ac40ac9
commit c4ea68a92f
2 changed files with 26 additions and 31 deletions

View File

@ -10,18 +10,14 @@ from mozpack.copier import Jarrer
from mozpack.errors import errors from mozpack.errors import errors
import argparse import argparse
import buildconfig
import mozpack.path as mozpath import mozpack.path as mozpath
import os
import sys import sys
import tempfile
def main(args): def main(args):
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--base-dir", parser.add_argument("-C", metavar='DIR', default=".",
default=os.path.join(buildconfig.topobjdir, help="Change to given directory before considering "
"dist", "bin"), "other paths")
help="Store paths relative to this directory")
parser.add_argument("zip", help="Path to zip file to write") parser.add_argument("zip", help="Path to zip file to write")
parser.add_argument("input", nargs="+", parser.add_argument("input", nargs="+",
help="Path to files to add to zip") help="Path to files to add to zip")
@ -30,12 +26,11 @@ def main(args):
jarrer = Jarrer(optimize=False) jarrer = Jarrer(optimize=False)
with errors.accumulate(): with errors.accumulate():
finder = FileFinder(args.base_dir) finder = FileFinder(args.C)
for i in args.input: for path in args.input:
path = mozpath.relpath(i, args.base_dir)
for p, f in finder.find(path): for p, f in finder.find(path):
jarrer.add(p, f) jarrer.add(p, f)
jarrer.copy(args.zip) jarrer.copy(mozpath.join(args.C, args.zip))
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -66,56 +66,56 @@ endif
# JavaScript Shell packaging # JavaScript Shell packaging
ifndef LIBXUL_SDK ifndef LIBXUL_SDK
JSSHELL_BINS = \ JSSHELL_BINS = \
$(DIST)/bin/js$(BIN_SUFFIX) \ js$(BIN_SUFFIX) \
$(DIST)/bin/$(DLL_PREFIX)mozglue$(DLL_SUFFIX) \ $(DLL_PREFIX)mozglue$(DLL_SUFFIX) \
$(NULL) $(NULL)
ifndef MOZ_NATIVE_NSPR ifndef MOZ_NATIVE_NSPR
ifdef MSVC_C_RUNTIME_DLL ifdef MSVC_C_RUNTIME_DLL
JSSHELL_BINS += $(DIST)/bin/$(MSVC_C_RUNTIME_DLL) JSSHELL_BINS += $(MSVC_C_RUNTIME_DLL)
endif endif
ifdef MSVC_CXX_RUNTIME_DLL ifdef MSVC_CXX_RUNTIME_DLL
JSSHELL_BINS += $(DIST)/bin/$(MSVC_CXX_RUNTIME_DLL) JSSHELL_BINS += $(MSVC_CXX_RUNTIME_DLL)
endif endif
ifdef MSVC_APPCRT_DLL ifdef MSVC_APPCRT_DLL
JSSHELL_BINS += $(DIST)/bin/$(MSVC_APPCRT_DLL) JSSHELL_BINS += $(MSVC_APPCRT_DLL)
endif endif
ifdef MSVC_DESKTOPCRT_DLL ifdef MSVC_DESKTOPCRT_DLL
JSSHELL_BINS += $(DIST)/bin/$(MSVC_DESKTOPCRT_DLL) JSSHELL_BINS += $(MSVC_DESKTOPCRT_DLL)
endif endif
ifdef MOZ_FOLD_LIBS ifdef MOZ_FOLD_LIBS
JSSHELL_BINS += $(DIST)/bin/$(DLL_PREFIX)nss3$(DLL_SUFFIX) JSSHELL_BINS += $(DLL_PREFIX)nss3$(DLL_SUFFIX)
else else
JSSHELL_BINS += \ JSSHELL_BINS += \
$(DIST)/bin/$(DLL_PREFIX)nspr4$(DLL_SUFFIX) \ $(DLL_PREFIX)nspr4$(DLL_SUFFIX) \
$(DIST)/bin/$(DLL_PREFIX)plds4$(DLL_SUFFIX) \ $(DLL_PREFIX)plds4$(DLL_SUFFIX) \
$(DIST)/bin/$(DLL_PREFIX)plc4$(DLL_SUFFIX) \ $(DLL_PREFIX)plc4$(DLL_SUFFIX) \
$(NULL) $(NULL)
endif # MOZ_FOLD_LIBS endif # MOZ_FOLD_LIBS
endif # MOZ_NATIVE_NSPR endif # MOZ_NATIVE_NSPR
ifdef MOZ_SHARED_ICU ifdef MOZ_SHARED_ICU
ifeq ($(OS_TARGET), WINNT) ifeq ($(OS_TARGET), WINNT)
JSSHELL_BINS += \ JSSHELL_BINS += \
$(DIST)/bin/icudt$(MOZ_ICU_DBG_SUFFIX)$(MOZ_ICU_VERSION).dll \ icudt$(MOZ_ICU_DBG_SUFFIX)$(MOZ_ICU_VERSION).dll \
$(DIST)/bin/icuin$(MOZ_ICU_DBG_SUFFIX)$(MOZ_ICU_VERSION).dll \ icuin$(MOZ_ICU_DBG_SUFFIX)$(MOZ_ICU_VERSION).dll \
$(DIST)/bin/icuuc$(MOZ_ICU_DBG_SUFFIX)$(MOZ_ICU_VERSION).dll \ icuuc$(MOZ_ICU_DBG_SUFFIX)$(MOZ_ICU_VERSION).dll \
$(NULL) $(NULL)
else else
ifeq ($(OS_TARGET), Darwin) ifeq ($(OS_TARGET), Darwin)
JSSHELL_BINS += \ JSSHELL_BINS += \
$(DIST)/bin/libicudata.$(MOZ_ICU_VERSION).dylib \ libicudata.$(MOZ_ICU_VERSION).dylib \
$(DIST)/bin/libicui18n.$(MOZ_ICU_VERSION).dylib \ libicui18n.$(MOZ_ICU_VERSION).dylib \
$(DIST)/bin/libicuuc.$(MOZ_ICU_VERSION).dylib \ libicuuc.$(MOZ_ICU_VERSION).dylib \
$(NULL) $(NULL)
else else
JSSHELL_BINS += \ JSSHELL_BINS += \
$(DIST)/bin/libicudata.so.$(MOZ_ICU_VERSION) \ libicudata.so.$(MOZ_ICU_VERSION) \
$(DIST)/bin/libicui18n.so.$(MOZ_ICU_VERSION) \ libicui18n.so.$(MOZ_ICU_VERSION) \
$(DIST)/bin/libicuuc.so.$(MOZ_ICU_VERSION) \ libicuuc.so.$(MOZ_ICU_VERSION) \
$(NULL) $(NULL)
endif # Darwin endif # Darwin
endif # WINNT endif # WINNT
endif # MOZ_STATIC_JS endif # MOZ_STATIC_JS
MAKE_JSSHELL = $(call py_action,zip,$(PKG_JSSHELL) $(abspath $(JSSHELL_BINS))) MAKE_JSSHELL = $(call py_action,zip,-C $(DIST)/bin $(abspath $(PKG_JSSHELL)) $(JSSHELL_BINS))
endif # LIBXUL_SDK endif # LIBXUL_SDK
_ABS_DIST = $(abspath $(DIST)) _ABS_DIST = $(abspath $(DIST))