[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r18628: {torvm} More build script clean up; support auto install of 7zip MSI (in torvm/trunk/build/win32: . files)



Author: coderman
Date: 2009-02-17 23:39:58 -0500 (Tue, 17 Feb 2009)
New Revision: 18628

Modified:
   torvm/trunk/build/win32/Makefile
   torvm/trunk/build/win32/files/buildall.sh
Log:
More build script clean up; support auto install of 7zip MSI for creating self extracting archives.

Modified: torvm/trunk/build/win32/Makefile
===================================================================
--- torvm/trunk/build/win32/Makefile	2009-02-18 03:23:34 UTC (rev 18627)
+++ torvm/trunk/build/win32/Makefile	2009-02-18 04:39:58 UTC (rev 18628)
@@ -156,11 +156,14 @@
 NSIS_SUM=a1aef12a33f16273ac9109fde28713399f6a8016
 NSIS_TGZ=nsis-2.42.tar.gz
 
-7ZIP_VER=464
-7ZIP_F=7z464.msi
-7ZIP_URL=http://downloads.sourceforge.net/sevenzip/7z464.msi?modtime=1230949842&big_mirror=1
-7ZIP_SUM=19a06e188a83452dc9273290dbef71220686c4c1
-7ZIP_NAME=7zip.msi
+# 7zip is a weird one; use MSI to silently install if needed via install.bat helper
+SEVNZIP_DL=true
+SEVNZIP_INST=true
+SEVNZIP_VER=464
+SEVNZIP_F=7z464.msi
+SEVNZIP_URL=http://downloads.sourceforge.net/sevenzip/7z464.msi?modtime=1230949842&big_mirror=1
+SEVNZIP_SUM=19a06e188a83452dc9273290dbef71220686c4c1
+SEVNZIP_NAME=7zip.msi
 
 SDL_F=SDL-1.2.13.tar.gz
 SDL_URL=http://www.libsdl.org/release/SDL-1.2.13.tar.gz
@@ -232,8 +235,19 @@
 # buildscripts need some dire clean up...
 OK:=echo -n
 
-ALLFILES=$(ZLIB_F) $(GZIP_F) $(BZIP2_F) $(LIBARCH_F) $(BINUTILS_F) $(GCCORE_F) $(GPP_F) $(MINGWRUN_F) $(MINGWUTIL_F) $(MAKE_F) $(W32API_F) $(MSYS_F) $(MSYSCORE_F) $(BASH_F) $(DIFFUTIL_F) $(LIBTOOL_F) $(MINIRES_F) $(MSYSZLIB_F) $(MSYSCRYPT_F) $(M4_F) $(SSL_F) $(SSH_F) $(ZLIBSRC_F) $(PTHREADS_F) $(AMAKE_F) $(ACONF_F) $(PERL_F) $(GROFF_F) $(CMAKE_F) $(QT_F) $(NSIS_F) $(7ZIP_F) $(SSLSRC_F) $(PY2EXE_F) $(WIX_F) $(GNURX_F) $(POLIPO_F) $(SDL_F) $(WPCAPSRC_F) $(QEMU_F) $(OVPN_F)
+ALLFILES=$(ZLIB_F) $(GZIP_F) $(BZIP2_F) $(LIBARCH_F) $(BINUTILS_F) $(GCCORE_F) $(GPP_F) $(MINGWRUN_F) $(MINGWUTIL_F) $(MAKE_F) $(W32API_F) $(MSYS_F) $(MSYSCORE_F) $(BASH_F) $(DIFFUTIL_F) $(LIBTOOL_F) $(MINIRES_F) $(MSYSZLIB_F) $(MSYSCRYPT_F) $(M4_F) $(SSL_F) $(SSH_F) $(ZLIBSRC_F) $(PTHREADS_F) $(AMAKE_F) $(ACONF_F) $(PERL_F) $(GROFF_F) $(CMAKE_F) $(QT_F) $(NSIS_F) $(SSLSRC_F) $(PY2EXE_F) $(WIX_F) $(GNURX_F) $(POLIPO_F) $(SDL_F) $(WPCAPSRC_F) $(QEMU_F) $(OVPN_F)
 
+# adjust if we're dealing with non source, zip or tar archives for a package
+SEVNZIP_OPT_DL=
+SEVNZIP_OPT_PKG=
+ifeq (true,$(SEVNZIP_DL))
+  ALLFILES+=$(SEVNZIP_F)
+  SEVNZIP_OPT_DL=if [ ! -e $(WDLDIR)/$(SEVNZIP_F) ]; then $(DLCMD) "$(SEVNZIP_URL)" $(SEVNZIP_SUM) "$(WDLDIR)/$(SEVNZIP_F)"; fi
+  ifeq (true,$(SEVNZIP_INST))
+    SEVNZIP_OPT_PKG=dl/$(SEVNZIP_F)
+  endif
+endif
+
 default all: downloads extract buildiso runinstall
 
 downloads: Makefile
@@ -269,7 +283,6 @@
 	@if [ ! -e $(WDLDIR)/$(CMAKE_F) ]; then $(DLCMD) "$(CMAKE_URL)" $(CMAKE_SUM) "$(WDLDIR)/$(CMAKE_F)"; fi
 	@if [ ! -e $(WDLDIR)/$(QT_F) ]; then $(DLCMD) "$(QT_URL)" $(QT_SUM) "$(WDLDIR)/$(QT_F)"; fi
 	@if [ ! -e $(WDLDIR)/$(NSIS_F) ]; then $(DLCMD) "$(NSIS_URL)" $(NSIS_SUM) "$(WDLDIR)/$(NSIS_F)"; fi
-	@if [ ! -e $(WDLDIR)/$(7ZIP_F) ]; then $(DLCMD) "$(7ZIP_URL)" $(7ZIP_SUM) "$(WDLDIR)/$(7ZIP_F)"; fi
 	@if [ ! -e $(WDLDIR)/$(SSLSRC_F) ]; then $(DLCMD) "$(SSLSRC_URL)" $(SSLSRC_SUM) "$(WDLDIR)/$(SSLSRC_F)"; fi
 	@if [ ! -e $(WDLDIR)/$(PY2EXE_F) ]; then $(DLCMD) "$(PY2EXE_URL)" $(PY2EXE_SUM) "$(WDLDIR)/$(PY2EXE_F)"; fi
 	@if [ ! -e $(WDLDIR)/$(WIX_F) ]; then $(DLCMD) "$(WIX_URL)" $(WIX_SUM) "$(WDLDIR)/$(WIX_F)"; fi
@@ -279,6 +292,7 @@
 	@if [ ! -e $(WDLDIR)/$(WPCAPSRC_F) ]; then $(DLCMD) "$(WPCAPSRC_URL)" $(WPCAPSRC_SUM) "$(WDLDIR)/$(WPCAPSRC_F)"; fi
 	@if [ ! -e $(WDLDIR)/$(OVPN_F) ]; then $(DLCMD) "$(OVPN_URL)" $(OVPN_SUM) "$(WDLDIR)/$(OVPN_F)"; fi
 	@if [ ! -e $(WDLDIR)/$(QEMU_F) ]; then $(DLCMD) "$(QEMU_URL)" $(QEMU_SUM) "$(WDLDIR)/$(QEMU_F)"; fi
+	@$(SEVNZIP_OPT_DL); $(OK)
 	@( export ddir=`pwd`/iso; if [ ! -f $ddir ]; then export ddir="$(ISODIR)"; fi; cd $(SDLDIR); if [ -d $(TORSVN_NAME) ]; then cd $(TORSVN_NAME); $(SVNCMD) up; $(OK); else $(SVNCMD) co "$(TORSVN_SVN)$(TORSVN_BR)" $(TORSVN_NAME) ; fi )
 	@( cd $(SDLDIR); if [ -d $(TORBUTTON_NAME) ]; then cd $(TORBUTTON_NAME); $(SVNCMD) up; $(OK); else $(SVNCMD) co "$(TORBUTTON_SVN)$(TORBUTTON_BR)" $(TORBUTTON_NAME) ; fi )
 	@( cd $(SDLDIR); if [ -d $(VIDALIA_NAME) ]; then cd $(VIDALIA_NAME); $(SVNCMD) up; $(OK); else $(SVNCMD) co "$(VIDALIA_SVN)$(VIDALIA_BR)" $(VIDALIA_NAME) ; fi )
@@ -311,6 +325,8 @@
 	if [[ "$(DEBUG_NO_STRIP)" != "" ]]; then \
 		echo "export DEBUG_NO_STRIP=$(DEBUG_NO_STRIP)" >> $(ISODIR)/bldopts; \
 	fi; \
+	echo "export SEVNZIP_INST=$(SEVNZIP_INST)" >> $(ISODIR)/bldopts; \
+	echo "export SEVNZIP_PKG=$(SEVNZIP_OPT_PKG)" >> $(ISODIR)/bldopts; \
 	echo "--- Copying packages for ISO image file system ..."; \
 	cp files/autorun.inf files/install.bat $(ISODIR)/; \
 	cp files/hdd.img.gz $(ISODIR)/add/; \

Modified: torvm/trunk/build/win32/files/buildall.sh
===================================================================
--- torvm/trunk/build/win32/files/buildall.sh	2009-02-18 03:23:34 UTC (rev 18627)
+++ torvm/trunk/build/win32/files/buildall.sh	2009-02-18 04:39:58 UTC (rev 18628)
@@ -1,15 +1,26 @@
 #!/bin/bash
-export PATH=.:/usr/local/bin:/usr/bin:/bin:/mingw/bin:/wix:/lib:/usr/local/lib:/usr/libexec:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem
+export PATH=.:/usr/local/bin:/usr/bin:/bin:/mingw/bin:/wix:/lib:/usr/local/lib:/usr/libexec
 export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib:/mingw/lib
 
-# set ddir and brootdir in parent env if needed.
+# set sysdrive, ddir, and brootdir in parent env if needed.
+if [[ "$sysdrive" == "" ]]; then
+  sysdrive=`echo $SYSTEMDRIVE | sed 's/:.*//'`
+  if [ ! -d /$sysdrive ]; then
+    # msys not happy about whatever odd location windows installed into...
+    sysdrive=c
+  fi
+fi
+export sysdrive
 if [[ "$ddir" == "" ]]; then
-  export ddir=/c/Tor_VM
+  export ddir=/$sysdrive/Tor_VM
 fi
 if [[ "$brootdir" == "" ]]; then
-  export brootdir=/c/Tor_Win32
+  export brootdir=/$sysdrive/Tor_Win32
 fi
 
+# make sure some default windows paths are available too
+export PATH=$PATH:/$sysdrive/WINDOWS/system32:/$sysdrive/WINDOWS:/$sysdrive/WINDOWS/System32/Wbem
+
 # the build state file is solely used to toggle targets on or off
 # intended to be used when developing or automated via buildbot, etc.
 if [[ "$bstatefile" == "" ]]; then
@@ -33,6 +44,14 @@
 export thandir=$broot/Thandy
 export bundledir=$broot/Bundle
 
+if [[ "$SEVNZIP_INST_DIR" == "" ]]; then
+  SEVNZIP_INST_DIR=
+fi
+SEVNZIP_DEF_INSTPATH="/$sysdrive/Program Files\7-Zip"
+if [ -d "$SEVNZIP_DEF_INSTPATH" ]; then
+  export PATH="$PATH:${SEVNZIP_DEF_INSTPATH}"
+fi
+
 export ZLIB_VER="1.2.3"
 export ZLIB_DIR="zlib-${ZLIB_VER}"
 export ZLIB_FILE="zlib-${ZLIB_VER}.tar.gz"
@@ -59,19 +78,19 @@
 export CMAKE_VER="2.6.2"
 export CMAKE_DIR="cmake-${CMAKE_VER}"
 export CMAKE_FILE="cmake-${CMAKE_VER}.tar.gz"
-export CMAKEBIN="/c/Program\ Files/CMake/bin"
+export CMAKEBIN="/$sysdrive/Program\ Files/CMake/bin"
 export PATH="${PATH}:${CMAKEBIN}:/src/$CMAKE_DIR/bin"
 
 export QT_VER="4.4.3"
 export QT_DIR="qt-${QT_VER}"
 export QT_FILE="qt-${QT_VER}.tgz"
-export QT_ROOT="/c/Qt/${QT_VER}"
+export QT_ROOT="/$sysdrive/Qt/${QT_VER}"
 export QT_BIN="${QT_ROOT}/bin"
-export QTDIR="C:\Qt\4.4.3"
+export QTDIR="${sysdrive}:\Qt\4.4.3"
 export QMAKESPEC=win32-g++
 export PATH="$PATH:$QT_BIN:$QTDIR\bin"
 
-export PYTHON_ROOT=/c/Python26
+export PYTHON_ROOT=/$sysdrive/Python26
 export PATH=$PATH:$PYTHON_ROOT
 
 export VIDALIA_FILE=vidalia-latest.tar.gz
@@ -86,8 +105,7 @@
 export TORBUTTON_FILE=torbutton-1.2.0.xpi
 
 export NSIS_DIR=nsis-2.42
-export SEVENZIP_DIR=7-Zip
-export PATH="${PATH}:/${NSIS_DIR}/Bin:/${NSIS_DIR}:/${NSIS_DIR}/bin:/${SEVENZIP_DIR}"
+export PATH="${PATH}:/${NSIS_DIR}/Bin:/${NSIS_DIR}:/${NSIS_DIR}/bin"
 
 if [ -d "$VS80COMNTOOLS" ]; then
   export VSTOOLSDIR="$VS80COMNTOOLS"
@@ -192,6 +210,24 @@
   pkgbuilt MSYS_SETUP
 fi
 
+if [[ "$PKGS_INSTALLED" != "yes" ]]; then
+  anyfail=0
+  echo "Checking for any packages to install..."
+  if [[ "$SEVNZIP_INST" == "true" ]]; then
+    if [ ! -f "/${SEVNZIP_PKG}" ]; then
+      echo "ERROR: Unable to locate expected 7zip package for install at location: /${SEVNZIP_PKG}"
+      anyfail=1
+    fi
+    else
+      $COMSPEC /k "msiexec /i ${MSYSROOT}\${SEVNZIP_PKG} /qn" < /dev/null
+      # XXX need to check for failure to install properly via exit code and package status.
+    fi
+  fi
+  if (( $anyfail == 0 )); then
+    pkgbuilt PKGS_INSTALLED
+  fi
+fi
+
 if [[ "$IGNORE_DDK" != "yes" ]]; then
   echo "Locating Windows Driver Development Kit ..."
   # there has to be a better way to do this .... ugg
@@ -342,7 +378,7 @@
   echo "cd \"$BPATH\"" >> dobuild.bat
   echo "build -cef" >> dobuild.bat
   echo "exit" >> dobuild.bat
-  cmd.exe /k dobuild.bat
+  $COMSPEC /k dobuild.bat
   TAPDRVN=tortap91
   if [ ! -f i386/${TAPDRVN}.sys ]; then
     echo "ERROR: openvpn tap-win32 driver build failed." >&2
@@ -369,7 +405,7 @@
   echo "cd \"$BPATH\"" >> dobuild.bat
   echo "call CompileDriver" >> dobuild.bat
   echo "exit" >> dobuild.bat
-  cmd.exe /k dobuild.bat
+  $COMSPEC /k dobuild.bat
   if [ ! -f driver/bin/2k/i386/npf.sys ]; then
     echo "ERROR: WinPcap NPF.sys driver build failed." >&2
     exit 1
@@ -610,10 +646,10 @@
 if [[ "$QT_BUILT" != "yes" ]]; then
   echo "Building Qt ..."
   cd /usr/src
-  mkdir /c/Qt
+  mkdir /$sysdrive/Qt
   tar zxvf $QT_FILE
-  mv $QT_DIR /c/Qt/$QT_VER
-  cd /c/Qt/$QT_VER
+  mv $QT_DIR /$sysdrive/Qt/$QT_VER
+  cd /$sysdrive/Qt/$QT_VER
   if [ -f /src/qt-mingwssl.patch ]; then
     patch -p1 < /src/qt-mingwssl.patch
   fi 
@@ -734,7 +770,7 @@
     ls -l src/vidalia/vidalia.exe
     mkdir bin
     for FILE in QtCore4.dll QtGui4.dll QtNetwork4.dll QtXml4.dll QtSvg4.dll; do
-      cp /c/Qt/$QT_VER/bin/$FILE bin/
+      cp /$sysdrive/Qt/$QT_VER/bin/$FILE bin/
     done
     cp /bin/mingwm10.dll bin/
     cp /src/$OPENSSL_DIR/ssleay32-0.9.8.dll bin/