Bug 1290044 - Moved NSIS configure to Python. r=glandium

MozReview-Commit-ID: 6JFR5K1XDBr

--HG--
extra : rebase_source : 7125dfaf1b3be9e9044540238bd15ec518398607
This commit is contained in:
Nathan Hakkakzadeh 2016-07-28 17:39:24 -07:00
Родитель 41505f6b25
Коммит cd4636a6e4
2 изменённых файлов: 30 добавлений и 57 удалений

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

@ -228,6 +228,36 @@ system_hunspell = pkg_check_modules('MOZ_HUNSPELL', 'hunspell',
set_config('MOZ_SYSTEM_HUNSPELL', system_hunspell)
@depends(target)
def makensis_progs(target):
if target.kernel == 'WINNT':
return ('makensis-3.0b3.exe', 'makensis-3.0b1.exe', 'makensis.exe', 'makensis')
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):
nsis_min_version = '3.0b1'
out = check_cmd_output(nsis, '-version',
onerror=lambda: die('Failed to get nsis version.'))
m = re.search(r'(?<=v)[0-9]+\.[0-9]+((a|b|rc)[0-9]+)?', out)
if not m:
raise FatalCheckError('Unknown version of makensis')
ver = Version(m.group(0))
if ver < nsis_min_version:
raise FatalCheckError('To build the installer you must have NSIS'
' version %s or greater in your path'
% nsis_min_version)
return ver
# Fallthrough to autoconf-based configure
include('build/moz.configure/old.configure')
# Please do not add anything after the include of old.configure.

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

@ -4274,62 +4274,6 @@ if test -n "$MOZ_TREE_FREETYPE"; then
AC_SUBST_LIST(CAIRO_FT_CFLAGS)
fi
dnl ========================================================
dnl Installer
dnl ========================================================
dnl Abort Windows build if the required major version and
dnl minimum minor version of Unicode NSIS isn't in the path
dnl (unless in case of cross compiling, for which Unicode
dnl is not yet sufficient).
if test "$OS_ARCH" = "WINNT"; then
MIN_NSIS_MAJOR_VER=3
MIN_NSIS_MINOR_VER=0
MIN_NSIS_PRERELEASE_TYPE=b
MIN_NSIS_PRERELEASE_VER=1
MOZ_PATH_PROGS(MAKENSISU, $MAKENSISU makensis-3.0b3.exe makensis-3.0b1.exe makensis)
if test -n "$MAKENSISU" -a "$MAKENSISU" != ":"; then
AC_MSG_RESULT([yes])
MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null`
changequote(,)
MAKENSISU_PARSED_VER=`echo "$MAKENSISU_VER" | sed -e 's/^v\([0-9]\+\.[0-9]\+\).*$/\1/g'`
changequote([,])
MAKENSISU_MAJOR_VER=0
MAKENSISU_MINOR_VER=0
MAKENSISU_PRERELEASE_TYPE=$MIN_NSIS_PRERELEASE_TYPE
MAKENSISU_PRERELEASE_VER=$MIN_NSIS_PRERELEASE_VER
if test ! "$MAKENSISU_PARSED_VER" = ""; then
MAKENSISU_MAJOR_VER=`echo $MAKENSISU_PARSED_VER | $AWK -F\. '{ print $1 }'`
MAKENSISU_MINOR_VER=`echo $MAKENSISU_PARSED_VER | $AWK -F\. '{ print $2 }'`
changequote(,)
MAKENSISU_PARSED_PRERELEASE=`echo "$MAKENSISU_VER" | sed -e 's/^v[0-9]\+\.[0-9]\+\([^0-9]\+\)\([0-9]\+\).*$/\1.\2/g'`
changequote([,])
if test ! "$MAKENSISU_PARSED_PRERELEASE" = "$MAKENSISU_VER"; then
MAKENSISU_PRERELEASE_TYPE=`echo $MAKENSISU_PARSED_PRERELEASE | $AWK -F\. '{ print $1 }'`
MAKENSISU_PRERELEASE_VER=`echo $MAKENSISU_PARSED_PRERELEASE | $AWK -F\. '{ print $2 }'`
fi
fi
AC_MSG_CHECKING([for NSIS version $MIN_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER$MIN_NSIS_PRERELEASE_TYPE$MIN_NSIS_PRERELEASE_VER or greater])
if test "$MAKENSISU_MAJOR_VER" -eq $MIN_NSIS_MAJOR_VER -a \
"$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER -a \
"$MAKENSISU_PRERELEASE_TYPE" = "$MIN_NSIS_PRERELEASE_TYPE" -a \
"$MAKENSISU_PRERELEASE_VER" -ge $MIN_NSIS_PRERELEASE_VER; then
AC_MSG_RESULT([yes])
AC_MSG_RESULT([Found NSIS Version: $MAKENSISU_VER])
else
AC_MSG_RESULT([no])
if test -z "$CROSS_COMPILE"; then
AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or NSIS version $MIN_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER$MIN_NSIS_PRERELEASE_TYPE$MIN_NSIS_PRERELEASE_VER or greater in your path.])
else
MAKENSISU=
fi
fi
elif test -z "$CROSS_COMPILE"; then
AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or NSIS version $MIN_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER$MIN_NSIS_PRERELEASE_TYPE$MIN_NSIS_PRERELEASE_VER or greater in your path.])
else
MAKENSISU=
fi
fi
AC_CHECK_PROGS(WGET, wget, "")
AC_SUBST(WGET)
@ -6336,7 +6280,6 @@ fi
dnl win32 options
AC_SUBST(WIN32_REDIST_DIR)
AC_SUBST(WIN_UCRT_REDIST_DIR)
AC_SUBST(MAKENSISU)
dnl Echo the CFLAGS to remove extra whitespace.
CFLAGS=`echo \