]> granicus.if.org Git - graphviz/commitdiff
automated builds of Windows packages on MinGW (at least)
authorglenlow <devnull@localhost>
Thu, 3 Apr 2008 13:08:10 +0000 (13:08 +0000)
committerglenlow <devnull@localhost>
Thu, 3 Apr 2008 13:08:10 +0000 (13:08 +0000)
Makefile.am
winbuild [new file with mode: 0755]

index 897a0b974b2dd9f74289b84078f394b2721678c3..517059587938caade0e5b9b751c47b9e474cd989 100644 (file)
@@ -36,7 +36,7 @@ EXTRA_DIST = $(txt) $(html) graphviz.spec.in graphviz.spec \
        makearch features awk windows \
        config/config_perl.pl config/config_python.py \
        config/config_ruby.rb config/config_tcl.tcl dot.demo \
-       macbuild macosx
+       macbuild macosx winbuild
 
 .PHONY: rpm
 rpm: dist
diff --git a/winbuild b/winbuild
new file mode 100755 (executable)
index 0000000..38aadc6
--- /dev/null
+++ b/winbuild
@@ -0,0 +1,141 @@
+#!/bin/sh
+
+MSBUILD="$WINDIR\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe"
+PLATFORMSDK="$PROGRAMFILES\Microsoft Visual Studio 8\VC\PlatformSDK"
+PLATFORMSDKINCLUDE="$PLATFORMSDK\Include"
+PLATFORMSDKLIB="$PLATFORMSDK\Lib"
+
+GRAPHVIZ_BUILDING=
+PACKAGE=
+
+# first pass -- getting + prepping
+
+for ARG
+do
+       PREP=
+       BUILD=
+       case $ARG in
+               --help )
+                       cat <<EOF
+Usage: winbuild [options]
+
+    --help          display this help and exit
+
+Choose one of the following for each project to build:
+    --prep=TARBALL  prep the TARBALL, build and package
+    --build=DIR     build the DIR and package
+       
+Then optionally choose one of the following for the output:
+    --package=PACK  output a Windows Installer package at PACK
+       
+EOF
+                       exit 0
+                       ;;
+               --prep=* )
+                       PREP=${ARG#*=}
+                       ;;
+               --build=* )
+                       BUILD=${ARG#*=}
+                       ;;
+               --package=* )
+                       PACKAGE=${ARG#*=}
+                       ;;
+       esac
+
+       # prep the tarball
+       if [[ $PREP != "" ]]
+       then
+               echo
+               echo "PREPPING $PREP ..."
+               echo
+               
+               BUILD=`tar -tzf "$PREP" | head -1`
+               BUILD=${BUILD%/}
+               # rm -rf "$BUILD"
+               tar -xzf "$PREP"
+       fi
+       
+       # record the build location for now
+       if [[ $BUILD != "" ]]
+       then
+               pushd "$BUILD"
+               if [[ `expr "${PWD##*/}" : '.*\(graphviz\)'` ]]
+               then
+                       GRAPHVIZ_BUILDING=$PWD
+               fi
+               BUILDINGS[${#BUILDINGS[@]}]=$BUILD
+               popd
+       fi
+done
+
+if [[ $GRAPHVIZ_BUILDING == "" ]]
+then
+       echo
+       echo "Need to specify graphviz tarball or directory for building. Use --prep or --build first."
+       exit 1
+fi
+
+# second pass -- building
+
+for BUILDING in ${BUILDINGS[@]}
+do
+       pushd "$BUILDING"
+       if [[ `expr "${PWD##*/}" : '.*\(graphviz\)'` ]]
+       then
+               echo
+               echo "CONFIGURING $BUILDING ..."
+               echo
+               
+               ./configure --disable-swig --without-x --without-tclsh --with-ipsepcola --with-gdiplus --with-platformsdkincludedir="$PLATFORMSDKINCLUDE" --with-platformsdklibdir="$PLATFORMSDKLIB" CFLAGS="-I$GRAPHVIZ_BUILDING/windows/build/usr/local/include" LDFLAGS="-L$GRAPHVIZ_BUILDING/windows/build/usr/local/lib"
+               
+               echo
+               echo "MAKING $BUILDING ..."
+               echo
+               
+               make
+               
+               echo
+               echo "MSBUILDING $BUILDING ..."
+               echo
+               
+               $MSBUILD "windows\graphviz.csproj" -p:Configuration=Release -p:Platform=x86
+               
+               echo
+               echo "INSTALLING $BUILDING ..."
+               echo
+               
+               make DESTDIR="$GRAPHVIZ_BUILDING/windows/build" install-strip
+       else
+               echo
+               echo "CONFIGURING $BUILDING ..."
+               echo
+               
+               ./configure CFLAGS="-I$GRAPHVIZ_BUILDING/windows/build/usr/local/include" LDFLAGS="-L$GRAPHVIZ_BUILDING/windows/build/usr/local/lib"
+               
+               echo
+               echo "MAKING $BUILDING ..."
+               echo
+               
+               make
+               
+               echo
+               echo "INSTALLING $BUILDING ..."
+               echo
+               
+               make DESTDIR="$GRAPHVIZ_BUILDING/windows/build" install-strip
+       fi
+       popd
+done
+
+# third pass -- package everything up and ship if necessary
+
+if [[ $PACKAGE == "" ]]
+then
+       PACKAGE="${GRAPHVIZ_BUILDING##*/}.msi"
+fi
+
+echo
+echo "PACKAGING $PACKAGE ..."
+echo
+
+make --directory "$GRAPHVIZ_BUILDING/windows" --makefile=graphviz.msi.make TARGET="../$PACKAGE"