[tbb-commits] [tor-browser-bundle/master] Bug 17895: Build and use NSIS 2.51 with Debian patches

gk at torproject.org gk at torproject.org
Fri Apr 22 12:54:37 UTC 2016


commit 186c4e271355646eb4b9faadffaaa7fc0f986a3e
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Thu Apr 21 23:46:08 2016 +0200

    Bug 17895: Build and use NSIS 2.51 with Debian patches
---
 gitian/descriptors/windows/gitian-bundle.yml     |  5 ++++-
 gitian/descriptors/windows/gitian-utils.yml      | 28 ++++++++++++++++++++++++
 gitian/fetch-inputs.sh                           |  6 +++--
 gitian/mkbundle-windows.sh                       |  5 ++++-
 gitian/patches/nsis-missing-unistd-include.patch | 11 ++++++++++
 gitian/verify-tags.sh                            |  2 +-
 gitian/versions                                  |  7 ++++++
 gitian/versions.alpha                            |  7 ++++++
 gitian/versions.nightly                          |  7 ++++++
 9 files changed, 73 insertions(+), 5 deletions(-)

diff --git a/gitian/descriptors/windows/gitian-bundle.yml b/gitian/descriptors/windows/gitian-bundle.yml
index 5a165a7..4fe4bb6 100644
--- a/gitian/descriptors/windows/gitian-bundle.yml
+++ b/gitian/descriptors/windows/gitian-bundle.yml
@@ -7,7 +7,6 @@ architectures:
 packages:
 - "unzip"
 - "zip"
-- "nsis"
 # Needed to compensate NSIS's failure of regenerating the PE-file checksum and
 # proper padding.
 - "python-pefile"
@@ -50,6 +49,7 @@ files:
 - "mar-tools-win32.zip"
 - "tbb-docs.zip"
 - "pe_checksum_fix.py"
+- "nsis-win32-utils.zip"
 script: |
   INSTDIR="$HOME/install"
   source versions
@@ -71,6 +71,9 @@ script: |
   # Extract the MAR tools.
   unzip -d ~/build ~/build/mar-tools-win32.zip
   MARTOOLS=~/build/mar-tools
+  # Extract nsis
+  unzip -d $INSTDIR ~/build/nsis-win32-utils.zip
+  export PATH=$INSTDIR/nsis/bin:$PATH
   #
   mkdir -p $OUTDIR/
   mkdir -p tbb-windows-installer/"Tor Browser"/Browser/TorBrowser/Data/Browser/profile.default/extensions/https-everywhere-eff at eff.org
diff --git a/gitian/descriptors/windows/gitian-utils.yml b/gitian/descriptors/windows/gitian-utils.yml
index ae938af..2767bad 100644
--- a/gitian/descriptors/windows/gitian-utils.yml
+++ b/gitian/descriptors/windows/gitian-utils.yml
@@ -13,6 +13,9 @@ packages:
 - "g++-mingw-w64-i686"
 # Needed for compiling gcc.
 - "libmpc-dev"
+# Needed for compiling nsis.
+- "scons"
+- "libcppunit-dev"
 reference_datetime: "2000-01-01 00:00:00"
 remotes:
 - "url": "http://git.code.sf.net/p/mingw-w64/mingw-w64"
@@ -30,6 +33,9 @@ files:
 - "peXXigen.patch"
 - "versions"
 - "dzip.sh"
+- "nsis.tar.bz2"
+- "nsis-debian.tar.xz"
+- "nsis-missing-unistd-include.patch"
 script: |
   INSTDIR="$HOME/install"
   source versions
@@ -157,6 +163,27 @@ script: |
   make install
   cd ..
 
+  # Building nsis
+  tar xf nsis.tar.bz2
+  cd nsis-${NSIS_VER}-src
+  tar xf ../nsis-debian.tar.xz
+  patch -p1 < ../nsis-missing-unistd-include.patch
+  # nsis_system_zlib.patch and parallel_build.patch cause build errors
+  # so we remove them
+  rm -f debian/patches/nsis_system_zlib.patch
+  rm -f debian/patches/parallel_build.patch
+  for patch in $(grep '\.patch$' debian/patches/series)
+  do
+     [ -f debian/patches/$patch ] && patch -p1 < debian/patches/$patch
+  done
+  # When the gcc-mingw-w64-i686 package is installed, files from
+  # /usr/i686-w64-mingw32/include are used, causing the build to fail.
+  # To prevent that we remove the gcc-mingw-w64-i686 package.
+  sudo -i apt-get remove -y gcc-mingw-w64-i686
+  scons APPEND_CCFLAGS="-fgnu89-inline" VERSION=${NSIS_VER} SKIPUTILS='NSIS Menu' XGCC_W32_PREFIX=i686-w64-mingw32- PREFIX=$INSTDIR/nsis
+  scons APPEND_CCFLAGS="-fgnu89-inline" VERSION=${NSIS_VER} SKIPUTILS='NSIS Menu' XGCC_W32_PREFIX=i686-w64-mingw32- PREFIX=$INSTDIR/nsis install
+  cd ..
+
   # Grabbing the remaining results
   cd $INSTDIR
   # We might want to bump binutils independent of bumping mingw-w64.
@@ -168,4 +195,5 @@ script: |
   ~/build/dzip.sh openssl-$OPENSSL_VER-win32-utils.zip openssl
   ~/build/dzip.sh gmp-$GMP_VER-win32-utils.zip gmp
   ~/build/dzip.sh gcclibs-$GCC_VER-win32-utils.zip gcclibs
+  ~/build/dzip.sh nsis-$NSIS_VER-win32-utils.zip nsis
   cp *-utils.zip $OUTDIR/
diff --git a/gitian/fetch-inputs.sh b/gitian/fetch-inputs.sh
index da487f4..99b984b 100755
--- a/gitian/fetch-inputs.sh
+++ b/gitian/fetch-inputs.sh
@@ -162,7 +162,7 @@ do
   get "${!PACKAGE}" "${MIRROR_URL_ASN}${!PACKAGE}"
 done
 
-for i in ZOPEINTERFACE TWISTED PY2EXE SETUPTOOLS PARSLEY GO STIXMATHFONT NOTOEMOJIFONT NOTOJPFONT NOTOKRFONT NOTOSCFONT NOTOTCFONT
+for i in ZOPEINTERFACE TWISTED PY2EXE SETUPTOOLS PARSLEY GO STIXMATHFONT NOTOEMOJIFONT NOTOJPFONT NOTOKRFONT NOTOSCFONT NOTOTCFONT NSIS NSIS_DEBIAN
 do
   URL="${i}_URL"
   PACKAGE="${i}_PACKAGE"
@@ -174,7 +174,7 @@ wget -U "" -N ${NOSCRIPT_URL}
 
 # Verify packages with weak or no signatures via direct sha256 check
 # (OpenSSL is signed with MD5, and OSXSDK + OSXSDK_OLD are not signed at all)
-for i in OSXSDK OSXSDK_OLD TOOLCHAIN4_OLD CCTOOLS NOSCRIPT MSVCR100 PYCRYPTO ARGPARSE PYYAML ZOPEINTERFACE TWISTED SETUPTOOLS OPENSSL GMP PARSLEY GO GCC STIXMATHFONT NOTOEMOJIFONT NOTOJPFONT NOTOKRFONT NOTOSCFONT NOTOTCFONT
+for i in OSXSDK OSXSDK_OLD TOOLCHAIN4_OLD CCTOOLS NOSCRIPT MSVCR100 PYCRYPTO ARGPARSE PYYAML ZOPEINTERFACE TWISTED SETUPTOOLS OPENSSL GMP PARSLEY GO GCC STIXMATHFONT NOTOEMOJIFONT NOTOJPFONT NOTOKRFONT NOTOSCFONT NOTOTCFONT NSIS NSIS_DEBIAN
 do
    PACKAGE="${i}_PACKAGE"
    HASH="${i}_HASH"
@@ -244,6 +244,8 @@ ln -sf "$SETUPTOOLS_PACKAGE" setuptools.tar.gz
 ln -sf "$GMP_PACKAGE" gmp.tar.bz2
 ln -sf "$PARSLEY_PACKAGE" parsley.tar.gz
 ln -sf "$GO_PACKAGE" go.tar.gz
+ln -sf "$NSIS_PACKAGE" nsis.tar.bz2
+ln -sf "$NSIS_DEBIAN_PACKAGE" nsis-debian.tar.xz
 
 # Fetch latest gitian-builder itself
 # XXX - this is broken if a non-standard inputs dir is selected using the command line flag.
diff --git a/gitian/mkbundle-windows.sh b/gitian/mkbundle-windows.sh
index 2de0f1e..1afa840 100755
--- a/gitian/mkbundle-windows.sh
+++ b/gitian/mkbundle-windows.sh
@@ -106,7 +106,8 @@ if [ ! -f inputs/binutils-$BINUTILS_VER-win32-utils.zip -o \
      ! -f inputs/zlib-${ZLIB_TAG_ORIG#v}-win32-utils.zip -o \
      ! -f inputs/libevent-${LIBEVENT_TAG_ORIG#release-}-win32-utils.zip -o \
      ! -f inputs/openssl-$OPENSSL_VER-win32-utils.zip -o \
-     ! -f inputs/gmp-$GMP_VER-win32-utils.zip ];
+     ! -f inputs/gmp-$GMP_VER-win32-utils.zip -o \
+     ! -f inputs/nsis-$NSIS_VER-win32-utils.zip ];
 then
   echo
   echo "****** Starting Utilities Component of Windows Bundle (1/5 for Windows) ******"
@@ -128,6 +129,7 @@ then
   ln -sf gmp-$GMP_VER-win32-utils.zip gmp-win32-utils.zip
   ln -sf gcclibs-$GCC_VER-win32-utils.zip gcclibs-win32-utils.zip
   ln -sf gcc-$GCC_VER-linux32-precise-utils.zip gcc-linux32-precise-utils.zip
+  ln -sf nsis-$NSIS_VER-win32-utils.zip nsis-win32-utils.zip
   cd ..
   #cp -a result/utils-win-res.yml inputs/
 else
@@ -144,6 +146,7 @@ else
   ln -sf gmp-$GMP_VER-win32-utils.zip gmp-win32-utils.zip
   ln -sf gcclibs-$GCC_VER-win32-utils.zip gcclibs-win32-utils.zip
   ln -sf gcc-$GCC_VER-linux32-precise-utils.zip gcc-linux32-precise-utils.zip
+  ln -sf nsis-$NSIS_VER-win32-utils.zip nsis-win32-utils.zip
   cd ..
 fi
 
diff --git a/gitian/patches/nsis-missing-unistd-include.patch b/gitian/patches/nsis-missing-unistd-include.patch
new file mode 100644
index 0000000..4f4fdd2
--- /dev/null
+++ b/gitian/patches/nsis-missing-unistd-include.patch
@@ -0,0 +1,11 @@
+--- nsis-2.46-src.old/Source/util.h	2009-03-28 09:47:26.000000000 +0000
++++ nsis-2.46-src/Source/util.h	2012-01-16 12:22:14.967416817 +0000
+@@ -17,6 +17,8 @@
+ #ifndef _UTIL_H_
+ #define _UTIL_H_
+ 
++#include <unistd.h>
++
+ #include <string> // for std::string
+ 
+ #include "boost/scoped_ptr.hpp" // for boost::scoped_ptr
diff --git a/gitian/verify-tags.sh b/gitian/verify-tags.sh
index 95bdaf1..a966626 100755
--- a/gitian/verify-tags.sh
+++ b/gitian/verify-tags.sh
@@ -143,7 +143,7 @@ done
 
 # Verify packages with weak or no signatures via direct sha256 check
 # (OpenSSL is signed with MD5, and OSXSDK + OSXSDK_OLD are not signed at all)
-for i in OSXSDK OSXSDK_OLD TOOLCHAIN4_OLD CCTOOLS NOSCRIPT MSVCR100 PYCRYPTO ARGPARSE PYYAML ZOPEINTERFACE TWISTED SETUPTOOLS OPENSSL GMP PARSLEY GO GCC STIXMATHFONT NOTOEMOJIFONT NOTOJPFONT NOTOKRFONT NOTOSCFONT NOTOTCFONT
+for i in OSXSDK OSXSDK_OLD TOOLCHAIN4_OLD CCTOOLS NOSCRIPT MSVCR100 PYCRYPTO ARGPARSE PYYAML ZOPEINTERFACE TWISTED SETUPTOOLS OPENSSL GMP PARSLEY GO GCC STIXMATHFONT NOTOEMOJIFONT NOTOJPFONT NOTOKRFONT NOTOSCFONT NOTOTCFONT NSIS NSIS_DEBIAN
 do
    PACKAGE="${i}_PACKAGE"
    HASH="${i}_HASH"
diff --git a/gitian/versions b/gitian/versions
index 4dd8aa5..a18afab 100755
--- a/gitian/versions
+++ b/gitian/versions
@@ -54,6 +54,7 @@ PY2EXE_VER=0.6.9
 SETUPTOOLS_VER=1.4
 PARSLEY_VER=1.2
 GO_VER=1.4.2
+NSIS_VER=2.51
 
 ## File names for the source packages
 OPENSSL_PACKAGE=openssl-${OPENSSL_VER}.tar.gz
@@ -75,6 +76,8 @@ PY2EXE_PACKAGE=py2exe-${PY2EXE_VER}.win32-py2.7.exe
 SETUPTOOLS_PACKAGE=setuptools-${SETUPTOOLS_VER}.tar.gz
 PARSLEY_PACKAGE=Parsley-${PARSLEY_VER}.tar.gz
 GO_PACKAGE=go${GO_VER}.src.tar.gz
+NSIS_PACKAGE=nsis-${NSIS_VER}-src.tar.bz2
+NSIS_DEBIAN_PACKAGE=nsis_${NSIS_VER}-1.debian.tar.xz
 STIXMATHFONT_PACKAGE=STIXv1.1.1-latex.zip
 NOTOEMOJIFONT_PACKAGE=NotoEmoji-Regular.ttf
 NOTOJPFONT_PACKAGE=NotoSansJP-Regular.otf
@@ -99,6 +102,8 @@ PY2EXE_HASH=610a8800de3d973ed5ed4ac505ab42ad058add18a68609ac09e6cf3598ef056c
 SETUPTOOLS_HASH=75d288687066ed124311d6ca5f40ffa92a0e81adcd7fff318c6e84082713cf39
 PARSLEY_HASH=50d30cee70770fd44db7cea421cb2fb75af247c3a1cd54885c06b30a7c85dd23
 GO_HASH=299a6fd8f8adfdce15bc06bde926e7b252ae8e24dd5b16b7d8791ed79e7b5e9b
+NSIS_HASH=43d4c9209847e35eb6e2c7cd5a7586e1445374c056c2c7899e40a080e17a1be7
+NSIS_DEBIAN_HASH=1dee6957b4a4b8dfe69bcf28bc7f301a13b96b3fa5a394e36c8926ae781e774a
 GCC_HASH=b7dafdf89cbb0e20333dbf5b5349319ae06e3d1a30bf3515b5488f7e89dca5ad
 STIXMATHFONT_HASH=e3b0f712e2644438eee2d0dcd2b10b2d54f1b972039de95b2f8e800bae1adbd8
 NOTOEMOJIFONT_HASH=415dc6290378574135b64c808dc640c1df7531973290c4970c51fdeb849cb0c5
@@ -126,6 +131,8 @@ PY2EXE_URL=http://liquidtelecom.dl.sourceforge.net/project/py2exe/py2exe/${PY2EX
 SETUPTOOLS_URL=https://pypi.python.org/packages/source/s/setuptools/${SETUPTOOLS_PACKAGE}
 PARSLEY_URL=https://pypi.python.org/packages/source/P/Parsley/${PARSLEY_PACKAGE}
 GO_URL=https://golang.org/dl/${GO_PACKAGE}
+NSIS_URL=http://downloads.sourceforge.net/nsis/${NSIS_PACKAGE}
+NSIS_DEBIAN_URL=http://http.debian.net/debian/pool/main/n/nsis/${NSIS_DEBIAN_PACKAGE}
 STIXMATHFONT_URL=http://iweb.dl.sourceforge.net/project/stixfonts/Current%20Release/${STIXMATHFONT_PACKAGE}
 NOTOEMOJIFONT_URL=https://github.com/googlei18n/noto-emoji/raw/2f1ffdd6fbbd05d6f382138a3d3adcd89c5ce800/fonts/${NOTOEMOJIFONT_PACKAGE}
 NOTOCJKBASE_URL=https://github.com/googlei18n/noto-cjk/raw/f36eda03dfa5582a6d49abbfb5c83d0209584158
diff --git a/gitian/versions.alpha b/gitian/versions.alpha
index 7e1dd98..0ba31d2 100755
--- a/gitian/versions.alpha
+++ b/gitian/versions.alpha
@@ -61,6 +61,7 @@ PY2EXE_VER=0.6.9
 SETUPTOOLS_VER=1.4
 PARSLEY_VER=1.2
 GO_VER=1.4.2
+NSIS_VER=2.51
 
 ## File names for the source packages
 OPENSSL_PACKAGE=openssl-${OPENSSL_VER}.tar.gz
@@ -83,6 +84,8 @@ PY2EXE_PACKAGE=py2exe-${PY2EXE_VER}.win32-py2.7.exe
 SETUPTOOLS_PACKAGE=setuptools-${SETUPTOOLS_VER}.tar.gz
 PARSLEY_PACKAGE=Parsley-${PARSLEY_VER}.tar.gz
 GO_PACKAGE=go${GO_VER}.src.tar.gz
+NSIS_PACKAGE=nsis-${NSIS_VER}-src.tar.bz2
+NSIS_DEBIAN_PACKAGE=nsis_${NSIS_VER}-1.debian.tar.xz
 STIXMATHFONT_PACKAGE=STIXv1.1.1-latex.zip
 NOTOEMOJIFONT_PACKAGE=NotoEmoji-Regular.ttf
 NOTOJPFONT_PACKAGE=NotoSansJP-Regular.otf
@@ -108,6 +111,8 @@ PY2EXE_HASH=610a8800de3d973ed5ed4ac505ab42ad058add18a68609ac09e6cf3598ef056c
 SETUPTOOLS_HASH=75d288687066ed124311d6ca5f40ffa92a0e81adcd7fff318c6e84082713cf39
 PARSLEY_HASH=50d30cee70770fd44db7cea421cb2fb75af247c3a1cd54885c06b30a7c85dd23
 GO_HASH=299a6fd8f8adfdce15bc06bde926e7b252ae8e24dd5b16b7d8791ed79e7b5e9b
+NSIS_HASH=43d4c9209847e35eb6e2c7cd5a7586e1445374c056c2c7899e40a080e17a1be7
+NSIS_DEBIAN_HASH=1dee6957b4a4b8dfe69bcf28bc7f301a13b96b3fa5a394e36c8926ae781e774a
 GCC_HASH=b7dafdf89cbb0e20333dbf5b5349319ae06e3d1a30bf3515b5488f7e89dca5ad
 STIXMATHFONT_HASH=e3b0f712e2644438eee2d0dcd2b10b2d54f1b972039de95b2f8e800bae1adbd8
 NOTOEMOJIFONT_HASH=415dc6290378574135b64c808dc640c1df7531973290c4970c51fdeb849cb0c5
@@ -136,6 +141,8 @@ PY2EXE_URL=http://liquidtelecom.dl.sourceforge.net/project/py2exe/py2exe/${PY2EX
 SETUPTOOLS_URL=https://pypi.python.org/packages/source/s/setuptools/${SETUPTOOLS_PACKAGE}
 PARSLEY_URL=https://pypi.python.org/packages/source/P/Parsley/${PARSLEY_PACKAGE}
 GO_URL=https://golang.org/dl/${GO_PACKAGE}
+NSIS_URL=http://downloads.sourceforge.net/nsis/${NSIS_PACKAGE}
+NSIS_DEBIAN_URL=http://http.debian.net/debian/pool/main/n/nsis/${NSIS_DEBIAN_PACKAGE}
 STIXMATHFONT_URL=http://iweb.dl.sourceforge.net/project/stixfonts/Current%20Release/${STIXMATHFONT_PACKAGE}
 NOTOEMOJIFONT_URL=https://github.com/googlei18n/noto-emoji/raw/2f1ffdd6fbbd05d6f382138a3d3adcd89c5ce800/fonts/${NOTOEMOJIFONT_PACKAGE}
 NOTOCJKBASE_URL=https://github.com/googlei18n/noto-cjk/raw/f36eda03dfa5582a6d49abbfb5c83d0209584158
diff --git a/gitian/versions.nightly b/gitian/versions.nightly
index bf2e2a6..dab84ef 100755
--- a/gitian/versions.nightly
+++ b/gitian/versions.nightly
@@ -68,6 +68,7 @@ PY2EXE_VER=0.6.9
 SETUPTOOLS_VER=1.4
 PARSLEY_VER=1.2
 GO_VER=1.4.2
+NSIS_VER=2.51
 
 ## File names for the source packages
 OPENSSL_PACKAGE=openssl-${OPENSSL_VER}.tar.gz
@@ -90,6 +91,8 @@ PY2EXE_PACKAGE=py2exe-${PY2EXE_VER}.win32-py2.7.exe
 SETUPTOOLS_PACKAGE=setuptools-${SETUPTOOLS_VER}.tar.gz
 PARSLEY_PACKAGE=Parsley-${PARSLEY_VER}.tar.gz
 GO_PACKAGE=go${GO_VER}.src.tar.gz
+NSIS_PACKAGE=nsis-${NSIS_VER}-src.tar.bz2
+NSIS_DEBIAN_PACKAGE=nsis_${NSIS_VER}-1.debian.tar.xz
 STIXMATHFONT_PACKAGE=STIXv1.1.1-latex.zip
 NOTOEMOJIFONT_PACKAGE=NotoEmoji-Regular.ttf
 NOTOJPFONT_PACKAGE=NotoSansJP-Regular.otf
@@ -115,6 +118,8 @@ PY2EXE_HASH=610a8800de3d973ed5ed4ac505ab42ad058add18a68609ac09e6cf3598ef056c
 SETUPTOOLS_HASH=75d288687066ed124311d6ca5f40ffa92a0e81adcd7fff318c6e84082713cf39
 PARSLEY_HASH=50d30cee70770fd44db7cea421cb2fb75af247c3a1cd54885c06b30a7c85dd23
 GO_HASH=299a6fd8f8adfdce15bc06bde926e7b252ae8e24dd5b16b7d8791ed79e7b5e9b
+NSIS_HASH=43d4c9209847e35eb6e2c7cd5a7586e1445374c056c2c7899e40a080e17a1be7
+NSIS_DEBIAN_HASH=1dee6957b4a4b8dfe69bcf28bc7f301a13b96b3fa5a394e36c8926ae781e774a
 GCC_HASH=b7dafdf89cbb0e20333dbf5b5349319ae06e3d1a30bf3515b5488f7e89dca5ad
 STIXMATHFONT_HASH=e3b0f712e2644438eee2d0dcd2b10b2d54f1b972039de95b2f8e800bae1adbd8
 NOTOEMOJIFONT_HASH=415dc6290378574135b64c808dc640c1df7531973290c4970c51fdeb849cb0c5
@@ -143,6 +148,8 @@ PY2EXE_URL=http://liquidtelecom.dl.sourceforge.net/project/py2exe/py2exe/${PY2EX
 SETUPTOOLS_URL=https://pypi.python.org/packages/source/s/setuptools/${SETUPTOOLS_PACKAGE}
 PARSLEY_URL=https://pypi.python.org/packages/source/P/Parsley/${PARSLEY_PACKAGE}
 GO_URL=https://golang.org/dl/${GO_PACKAGE}
+NSIS_URL=http://downloads.sourceforge.net/nsis/${NSIS_PACKAGE}
+NSIS_DEBIAN_URL=http://http.debian.net/debian/pool/main/n/nsis/${NSIS_DEBIAN_PACKAGE}
 STIXMATHFONT_URL=http://iweb.dl.sourceforge.net/project/stixfonts/Current%20Release/${STIXMATHFONT_PACKAGE}
 NOTOEMOJIFONT_URL=https://github.com/googlei18n/noto-emoji/raw/2f1ffdd6fbbd05d6f382138a3d3adcd89c5ce800/fonts/${NOTOEMOJIFONT_PACKAGE}
 NOTOCJKBASE_URL=https://github.com/googlei18n/noto-cjk/raw/f36eda03dfa5582a6d49abbfb5c83d0209584158



More information about the tbb-commits mailing list