From e2e6bfc01f6b695c18a0ea0e39392e10191b36f5 Mon Sep 17 00:00:00 2001
From: Mike Hommey <mh+mozilla@glandium.org>
Date: Fri, 17 Sep 2021 09:11:22 +0000
Subject: [PATCH] Bug 1731195 - Remove the wine-wrapping for makensis.
 r=firefox-build-system-reviewers,andi

Now that we have a bootstrappable linux-native makensis, we don't need
the wine-wrapping anymore.

Differential Revision: https://phabricator.services.mozilla.com/D125927
---
 moz.configure                                      | 11 ++++-------
 toolkit/mozapps/installer/windows/nsis/makensis.mk |  8 ++++----
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/moz.configure b/moz.configure
index dd9d8aaa3fa80..87882d0d31d58 100755
--- a/moz.configure
+++ b/moz.configure
@@ -889,7 +889,7 @@ check_prog("RPMBUILD", extra_programs.RPMBUILD, allow_missing=True)
 
 nsis = check_prog(
     "MAKENSISU",
-    ("makensis", "makensis.exe"),
+    ("makensis",),
     bootstrap="nsis/bin",
     allow_missing=True,
     when=target_is_windows,
@@ -898,19 +898,16 @@ nsis = check_prog(
 # Make sure the version of makensis is up to date.
 
 
-@depends(nsis, wine, when=nsis)
+@depends_if(nsis)
 @checking("for NSIS version")
 @imports("re")
-def nsis_version(nsis, wine):
+def nsis_version(nsis):
     nsis_min_version = "3.0b1"
 
     def onerror():
         return die("Failed to get nsis version.")
 
-    if wine and nsis.lower().endswith(".exe"):
-        out = check_cmd_output(wine, nsis, "-version", onerror=onerror)
-    else:
-        out = check_cmd_output(nsis, "-version", onerror=onerror)
+    out = check_cmd_output(nsis, "-version", onerror=onerror)
 
     m = re.search(r"(?<=v)[0-9]+\.[0-9]+((a|b|rc)[0-9]+)?", out)
 
diff --git a/toolkit/mozapps/installer/windows/nsis/makensis.mk b/toolkit/mozapps/installer/windows/nsis/makensis.mk
index 52eae8c7131d6..b175c77e21b06 100755
--- a/toolkit/mozapps/installer/windows/nsis/makensis.mk
+++ b/toolkit/mozapps/installer/windows/nsis/makensis.mk
@@ -55,9 +55,9 @@ $(CONFIG_DIR)/setup.exe::
 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/,$(CUSTOM_UI)) $(CONFIG_DIR)
-	cd $(CONFIG_DIR) && $(call WINEWRAP,$(MAKENSISU)) $(MAKENSISU_FLAGS) installer.nsi
+	cd $(CONFIG_DIR) && $(MAKENSISU) $(MAKENSISU_FLAGS) installer.nsi
 ifdef MOZ_STUB_INSTALLER
-	cd $(CONFIG_DIR) && $(call WINEWRAP,$(MAKENSISU)) $(MAKENSISU_FLAGS) stub.nsi
+	cd $(CONFIG_DIR) && $(MAKENSISU) $(MAKENSISU_FLAGS) stub.nsi
 endif
 
 ifdef ZIP_IN
@@ -107,7 +107,7 @@ $(CONFIG_DIR)/helper.exe: $(HELPER_DEPS)
 	  $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
-	cd $(CONFIG_DIR) && $(call WINEWRAP,$(MAKENSISU)) $(MAKENSISU_FLAGS) uninstaller.nsi
+	cd $(CONFIG_DIR) && $(MAKENSISU) $(MAKENSISU_FLAGS) uninstaller.nsi
 
 uninstaller:: $(CONFIG_DIR)/helper.exe
 	$(NSINSTALL) -D $(DIST)/bin/uninstall
@@ -126,7 +126,7 @@ maintenanceservice_installer::
 	  $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/toolkit/mozapps/installer/windows/nsis/,$(TOOLKIT_NSIS_FILES)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/Plugins/,$(CUSTOM_NSIS_PLUGINS)) $(CONFIG_DIR)
-	cd $(CONFIG_DIR) && $(call WINEWRAP,$(MAKENSISU)) $(MAKENSISU_FLAGS) maintenanceservice_installer.nsi
+	cd $(CONFIG_DIR) && $(MAKENSISU) $(MAKENSISU_FLAGS) maintenanceservice_installer.nsi
 	$(NSINSTALL) -D $(DIST)/bin/
 	cp $(CONFIG_DIR)/maintenanceservice_installer.exe $(DIST)/bin
 endif
-- 
GitLab