suite/installer/windows/Makefile.in
author Bill Gianopoulos <wgianopoulos@gmail.com>
Wed, 11 Mar 2020 07:36:22 -0400
changeset 29033 a37cba884251c58d9304e65870ab18cb95df9ddb
parent 24525 6e3b94bc5eafa0c98c04953d225356b6465aa074
child 29443 362312fa34e819f73940c1ffa706bab813838d38
permissions -rw-r--r--
Bug 1623759 - Port bug 1620744 - Use py3_action when calling the preprocessor in suite. r=frg

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk

CONFIG_DIR = instgen
SFX_MODULE = $(topsrcdir)/comm/other-licenses/7zstub/seamonkey/7zSD.sfx

EXPAND_COMM_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/comm/$(1)/en-US,$(or $(realpath $(L10NBASEDIR)),$(abspath $(L10NBASEDIR)))/$(AB_CD)/$(subst /locales,,$(1)))

INSTALLER_FILES = \
	app.tag \
	nsis/installer.nsi \
	nsis/uninstaller.nsi \
	nsis/shared.nsh \
	nsis/custom.nsi \
	$(NULL)

BRANDING_FILES = \
	branding.nsi \
	wizHeader.bmp \
	wizHeaderRTL.bmp \
	wizWatermark.bmp \
	$(NULL)

ifdef MOZ_UPDATER
DEFINES += -DMOZ_UPDATER=1
endif

include $(topsrcdir)/config/config.mk

ifdef IS_LANGUAGE_REPACK
PPL_LOCALE_ARGS = \
  --l10n-dir=$(REAL_LOCALE_MERGEDIR)/suite/installer/windows \
  --l10n-dir=$(call EXPAND_COMM_LOCALE_SRCDIR,suite/locales)/installer/windows \
  --l10n-dir=$(topsrcdir)/comm/suite/locales/en-US/installer/windows \
  $(NULL)
else
PPL_LOCALE_ARGS=$(call EXPAND_COMM_LOCALE_SRCDIR,suite/locales)/installer/windows
endif

$(CONFIG_DIR)/setup.exe::
	$(RM) -r $(CONFIG_DIR)
	$(MKDIR) $(CONFIG_DIR)
	$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
	$(INSTALL) $(addprefix $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/,$(BRANDING_FILES)) $(CONFIG_DIR)
	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
	  --convert-utf8-utf16le $(topsrcdir)/comm/suite/installer/license.txt $(CONFIG_DIR)/license.txt
	$(call py3_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
	  $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
	  --preprocess-locale $(topsrcdir) \
	  $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)

GARBARGE_DIRS += instgen

include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/makensis.mk