Bug 1291944 - Search for nsis in msys environment; r?glandium
Previously, configure found nsis on PATH, likely from MozillaBuild.
In our msys2 environment, nsis is installed under /mingw32. We
supplement moz.configure to look for nsis in this location.
MozReview-Commit-ID: 34mjoCrI7B6
--- a/moz.configure
+++ b/moz.configure
@@ -246,19 +246,36 @@ def check_for_hunspell(value, compile_en
system_hunspell = pkg_check_modules('MOZ_HUNSPELL', 'hunspell',
check_for_hunspell)
set_config('MOZ_SYSTEM_HUNSPELL', system_hunspell)
@depends(target)
+@imports('os')
def makensis_progs(target):
- if target.kernel == 'WINNT':
- return ('makensis-3.0b3.exe', 'makensis-3.0b1.exe', 'makensis.exe', 'makensis')
+ if target.kernel != 'WINNT':
+ return
+
+ candidates = [
+ 'makensis-3.0b3.exe',
+ 'makensis-3.0b1.exe',
+ 'makensis.exe',
+ 'makensis',
+ ]
+
+ # Look for nsis installed by msys environment. But only the 32-bit version.
+ # We use an absolute path and insert as the first entry so it is preferred
+ # over a 64-bit exe that may be in PATH.
+ if 'MSYSTEM_PREFIX' in os.environ:
+ prefix = os.path.dirname(os.environ['MSYSTEM_PREFIX'])
+ candidates.insert(0, os.path.join(prefix, 'mingw32', 'bin', 'makensis.exe'))
+
+ return tuple(candidates)
nsis = check_prog('MAKENSISU', makensis_progs)
# Make sure the version of makensis is up to date.
@depends_if(nsis)
@checking('for NSIS version')
@imports('re')
def nsis_version(nsis):