Browse Source

Prepare for beta release

Antialize 15 years ago
parent
commit
307a74b73f
6 changed files with 98 additions and 98 deletions
  1. 19 13
      scripts/release.sh
  2. 68 78
      scripts/static-build.sh
  3. 5 2
      src/docparts.cc
  4. 2 1
      static_qt_conf_base
  5. 1 1
      static_qt_conf_linux
  6. 3 3
      static_qt_conf_win

+ 19 - 13
scripts/release.sh

@@ -1,31 +1,37 @@
 #!/bin/bash
 
-#git status
+git status
 if [[ $1 == "" ]] || [[ $2 == "" ]] || [[ $3 == "" ]]; then
 	echo "Bad version"
 	exit 1
 fi
-v="$1.$2.$3"
+v="$1.$2.$3_$4"
+
 echo "About to release $v" 
 read -p "Are you sure you are ready: " N
 [ "$N" != "YES" ] && exit
 
-sed -ri "s/MAJOR_VERSION=[0-9]+ MINOR_VERSION=[0-9]+ PATCH_VERSION=[0-9]+/MAJOR_VERSION=$1 MINOR_VERSION=$2 PATCH_VERSION=$3/" wkhtmltopdf.pro
+sed -ri "s/MAJOR_VERSION=[0-9]+ MINOR_VERSION=[0-9]+ PATCH_VERSION=[0-9]+ BUILD=\"[^#*]\"/MAJOR_VERSION=$1 MINOR_VERSION=$2 PATCH_VERSION=$3 BUILD=\"$4\"/" wkhtmltopdf.pro || exit 1
 
-./scripts/static-build.sh linux || (echo Build failed; exit 1)
+rm -rf wkhtmltopdf-i386 wkhtmltopdf-amd64 wkhtmltopdf.exe
+./scripts/static-build.sh linux-i386 || (echo Build failed; exit 1)
+mv wkhtmltopdf-i386 wkhtmltopdf
 if ! ./scripts/test.sh; then
 	echo "Test failed"
 	exit 1
 fi
-./scripts/static-build.sh win || (echo Build failed; exit 1)
 
-git commit -m "Making ready for version $v" wkhtmltopdf.pro
-git tag "$v"
+./wkhtmltopdf-i386 --readme > README
+./scripts/static-build.sh linux-amd64 || (echo Build failed; exit 1)
+./scripts/static-build.sh windows || (echo Build failed; exit 1)
 
-rm -rf release-$v
-mkdir release-$v
-git checkout-index --prefix=./release-$v/wkhtmltopdf-$v/ -a
-tar -cjvf release-$v/wkhtmltopdf-$v.tar.bz2 -C release-$v wkhtmltopdf-$v
-cp wkhtmltopdf.exe release-$v/wkhtmltopdf-$v.exe
-tar -cjvf release-$v/wkhtmltopdf-$v-static.tar.bz2 wkhtmltopdf
+git commit -m "Making ready for version $v" wkhtmltopdf.pro README
+git tag "$v"
 
+rm -rf "release-$v"
+mkdir "release-$v"
+git checkout-index --prefix="./release-$v/wkhtmltopdf-$v/" -a
+tar -cjvf "release-$v/wkhtmltopdf-$v.tar.bz2" -C "release-$v" "wkhtmltopdf-$v"
+cp wkhtmltopdf.exe "release-$v/wkhtmltopdf-$v.exe"
+tar -cjvf "release-$v/wkhtmltopdf-$v-static-i386.tar.bz2" wkhtmltopdf-i386
+tar -cjvf "release-$v/wkhtmltopdf-$v-static-amd64.tar.bz2" wkhtmltopdf-amd64

+ 68 - 78
scripts/static-build.sh

@@ -21,9 +21,6 @@
 
 QT=qt-all-opensource-src-4.5.1
 MIRROR=kent
-#MINGWFILES="
-#gcc-g++-3.4.5-20060117-3.tar.gz gcc-core-3.4.5-20060117-3.tar.gz  \
-#mingwrt-3.15.2-mingw32-dev.tar.gz mingwrt-3.15.2-mingw32-dll.tar.gz"
 MINGWFILES="binutils-2.19.1-mingw32-bin.tar.gz \
 mingw32-make-3.81-20090910.tar.gz \
 gcc-full-4.4.0-mingw32-bin-2.tar.lzma \
@@ -31,7 +28,11 @@ w32api-3.13-mingw32-dev.tar.gz \
 mingwrt-3.16-mingw32-dev.tar.gz \
 mingwrt-3.16-mingw32-dll.tar.gz"
 
-OPENSSL=openssl-0.9.8h-1-lib.zip
+GNUWIN32FILES="openssl-0.9.8h-1-lib.zip \
+openssl-0.9.8h-1-bin.zip "
+#freetype-2.3.5-1-bin.zip \
+#freetype-2.3.5-1-lib.zip "
+
 if file /bin/true | grep -q 64-bit; then
     UPX=upx-3.03-amd64_linux
 else
@@ -44,7 +45,7 @@ function get() {
     [ -f $2.download ] || (rm -rf $2; wget $1 -O $2 && touch $2.download)
 }
 function unpack() {
-    [ -f $1.unpack ] || (echo "unpacking $1"; (tar -xf $1 || unzip $1) && touch $1.unpack)
+    [ -f $1.unpack ] || (echo "unpacking $1"; (tar -xf $1 || unzip -o $1) && touch $1.unpack)
 }
 
 function usage() {
@@ -58,7 +59,7 @@ BUILD=${BASE}/static-build
 VERSION=$2
 
 function checkout() {
-#Create static build directory
+    #Create static build directory
     mkdir -p $BUILD
 
     cd ${BUILD}
@@ -76,10 +77,6 @@ function checkout() {
     unpack ${UPX}.tar.bz2 || exit 1
 }
 
-#cat static_qt_conf_base static_qt_conf_win | sed -re 's/#.*//' | sed -re '/^[ \t]*$/d' | sort -u > $BUILD/conf_win
-#cat static_qt_conf_base static_qt_conf_linux | sed -re 's/#.*//' | sed -re '/^[ \t]*$/d' | sort -u > $BUILD/conf_linux
-
-
 function setup_build() {
     echo "Updating QT"
 
@@ -104,6 +101,7 @@ function setup_build() {
 	git checkout "$VERSION" || exit 1
     fi
     cd ..
+    [ "$1" == "win" ] && return 
     cat > build.sh <<EOF
 unset LANG
 unset LC_ALL
@@ -112,16 +110,9 @@ HERE="\${PWD}"
 mkdir -p qt/lib
 
 cd qts
-for lib in libssl.a libcrypt.a; do
-  rm -rf lib/\${lib} ../qt/lib/\${lib}
-  path=\$(g++ -print-file-name=\${lib})
-  ln -s \$(g++ -print-file-name=\${lib}) lib/  || exit 1
-  ln -s \$(g++ -print-file-name=\${lib}) ../qt/lib/  || exit 1
-done
 
 if ! cmp conf conf_new; then
    echo "Configuring QT"
-   export OPENSSL_LIBS='-L../qt/lib ../qt/lib/libssl.a ../qt/lib/libcrypt.a -lssl -lcrypto'
    (yes yes | ./configure \`cat conf_new\` -prefix "\${HERE}/qt" && cp conf_new conf) || exit 1
 fi
     
@@ -140,10 +131,6 @@ EOF
     chmod +x build.sh
 }
 
-function build_linux_actual() {
-    sleep 0
-}
-
 function build_linux_local() {
     cd ${BUILD}
     mkdir -p linux-local
@@ -186,28 +173,69 @@ function build_linux_chroot() {
     ${BUILD}/${UPX}/upx --best ${BUILD}/linux-$1/build/wkhtmltopdf/wkhtmltopdf -o ${BASE}/wkhtmltopdf-$1 || exit 1
 }
 
-# if [[ "$1" == "all" ]] ||; then
-# 	cd ${BUILD}
-# 	mkdir -p linux
-# 	cd linux
-# 	echo "Updating linux qt"
+function build_windows() {
+    cd ${BUILD}
+ 
+    export WINEPREFIX=${BUILD}/windows
+    if [ ! -f ${BUILD}/windows/create ]; then
+	    cat > tmp <<EOF 
+REGEDIT4
+
+[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]
+"PATH"="C:\\\\windows;C:\\\\windows\\\\system32;C:\\\\mingw\\\\bin"
+"INCLUDE"="C:\\\\mingw\\\\include;C:\\\\mingw\\\\include\\\\c++\\\\3.4.5"
+"LIB"="C:\\\\mingw\\\\lib"
+EOF
+	    wine regedit tmp || exit 1
+	    touch ${BUILD}/windows/create
+    fi
+#http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/fontconfig-2.4.2-tml-20071015.zip
+    mkdir -p windows/drive_c/mingw
+    cd windows/drive_c/mingw
+    for file in ${MINGWFILES}; do
+ 	get http://${MIRROR}.dl.sourceforge.net/sourceforge/mingw/${file} ${file} || exit 1
+ 	unpack ${file} || exit 1
+    done
+    for file in ${GNUWIN32FILES}; do
+	get http://downloads.sourceforge.net/gnuwin32/${file} ${file} || exit 1
+	unpack ${file} || exit 1
+    done
+
+
+    cd ..
+    setup_build win
+    
+    unset CPLUS_INCLUDE_PATH
+    unset C_INCLUDE_PATH
+    export CPLUS_INCLUDE_PATH=
+    export C_INCLUDE_PATH=C:\qts\include
+
+    mkdir -p qt
+    cp -r qts/mkspecs qt
+    cd qts
+    if ! cmp conf conf_new; then
+	QTDIR=. bin/syncqt || exit 1
+	(yes | wine configure.exe -I "C:\qts\include" -I "C:\mingw32\include\freetype2" `cat conf_new` -prefix "C:\qt" --help  && cp conf_new conf) || exit 1
+    fi
+    if ! wine mingw32-make -j3 -q; then
+	wine mingw32-make -j3 || exit 1
+	wine mingw32-make install || exit 1
+    fi
+
+    cd ../wkhtmltopdf
+    wine ../qt/bin/qmake.exe wkhtmltopdf.pro -o Makefile -spec win32-g++ || exit 1
+    wine mingw32-make -j3 || exit 1
+    wine strip.exe release/wkhtmltopdf.exe || exit 1
+    rm -rf ${BASE}/wkhtmltopdf.exe
+    ${BUILD}/${UPX}/upx --best release/wkhtmltopdf.exe -o ${BASE}/wkhtmltopdf.exe || exit 1
+}
+    
 
-        
-# 	rm -rf ${BASE}/wkhtmltopdf
-# 	${BUILD}/${UPX}/upx --best wkhtmltopdf -o ${BASE}/wkhtmltopdf || exit 1
 # fi
 # if [[ "$1" == "all" ]] || [[ "$1" == "win" ]]; then 
-# 	export WINEPREFIX=`pwd`/mingw
-#     #Setup configuration for mingw
+# 	
+#       #Setup configuration for mingw
 # 	ln -s / "mingw/dosdevices/z:"
-# 	cat <<EOF > tmp
-# REGEDIT4
-
-# [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]
-# "PATH"="C:\\\\windows;C:\\\\windows\\\\system32;C:\\\\mingw\\\\bin"
-# "INCLUDE"="C:\\\\mingw\\\\include;C:\\\\mingw\\\\include\\\\c++\\\\3.4.5"
-# "LIB"="C:\\\\mingw\\\\lib"
-# EOF
 # 	wine regedit tmp || exit 1
 # 	rm -f tmp
 
@@ -216,43 +244,10 @@ function build_linux_chroot() {
 
 # 	echo "Building windows vertion of qt"
 # 	#Install mingw
-# 	mkdir -p mingw/drive_c/mingw
-# 	cd mingw/drive_c/mingw
-# 	for file in ${MINGWFILES}; do
-# 		get http://${MIRROR}.dl.sourceforge.net/sourceforge/mingw/${file} ${file} || exit 1
-# 		unpack ${file} || exit 1
-# 	done
-# 	get http://downloads.sourceforge.net/gnuwin32/${OPENSSL} ${OPENSSL} || exit 1
-# 	unpack ${OPENSSL} || exit 1
 
 # 	#Unpack, configure and build windows qt
-# 	unset CPLUS_INCLUDE_PATH
-# 	unset C_INCLUDE_PATH
-# 	cd ${BUILD}/mingw/drive_c
 
-# 	[ -d qts ] || git clone ${BUILD}/qt qts || (rm -rf qts && exit 1)
-# 	cd qts
-# 	git checkout staging || exit 1
-# 	git pull || exit 1
-# 	if ! [ -z "$2" ] ; then
-# 	    git checkout wkhtmltopdf-$2 || exit 1
-# 	fi
-# 	cd ..
-
-# 	export CPLUS_INCLUDE_PATH=
-# 	export C_INCLUDE_PATH=C:\qts\include
-
-# 	mkdir -p qt
-# 	cp -r qts/mkspecs qt
-# 	cd qts
-# 	if ! cmp ${BUILD}/conf_win conf_win; then
-# 	    QTDIR=. bin/syncqt
-# 	    (yes | wine configure.exe -I "C:\qts\include" `cat ${BUILD}/conf_win` -prefix "C:\qt"  && cp ${BUILD}/conf_win conf_win) || exit 1
-# 	fi
-# 	if ! wine mingw32-make -j3 -q; then
-# 		wine mingw32-make -j3 || exit 1
-# 		wine mingw32-make install || exit 1
-# 	fi
+#	cd qts
 # 	cd ..
 
 #         [ -d wkhtmltopdf ] || git clone ${BASE} wkhtmltopdf || (rm -rf wkhtmltopdf && exit 1)
@@ -263,11 +258,6 @@ function build_linux_chroot() {
 # 	    git checkout $2 || exit 1
 # 	fi
 
-# 	wine ../qt/bin/qmake.exe wkhtmltopdf.pro -o Makefile -spec win32-g++ || exit 1
-# 	wine mingw32-make -j5 || exit 1
-# 	wine strip.exe release/wkhtmltopdf.exe || exit 1
-# 	rm -rf ${BASE}/wkhtmltopdf.exe
-# 	${BUILD}/${UPX}/upx --best release/wkhtmltopdf.exe -o ${BASE}/wkhtmltopdf.exe || exit 1
 # fi
 
 

+ 5 - 2
src/docparts.cc

@@ -15,6 +15,9 @@
 // along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
 #include "commandlineparser_p.hh"
 #include <QWebFrame>
+
+#define STRINGIZE(x) #x
+
 /*!
   Output the name and version of the program, and also whether we are using a patched qt
   \param o The outputter to output to
@@ -22,7 +25,7 @@
 void CommandLineParserPrivate::outputName(Outputter * o) const {
 	o->beginSection("Name");
 	o->beginParagraph();
-	o->text(QString("wkhtmltopdf ")+QString::number(MAJOR_VERSION)+"."+QString::number(MINOR_VERSION)+"."+QString::number(PATCH_VERSION));;
+	o->text(QString("wkhtmltopdf ")+QString::number(MAJOR_VERSION)+"."+QString::number(MINOR_VERSION)+"."+QString::number(PATCH_VERSION)+(QString(STRINGIZE(BUILD)).isEmpty()?" ":"")+STRINGIZE(BUILD));
 	o->text(", ");
 #ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__
 	o->text("using wkhtmltopdf patched qt.");
@@ -255,7 +258,7 @@ void CommandLineParserPrivate::outputContact(Outputter * o) const {
   \param o The outputter to output to
 */
 void CommandLineParserPrivate::outputDocStart(Outputter * o) const {
-	o->beginSection("wkhtmltopdf Manual");
+	o->beginSection(QString("wkhtmltopdf ")+QString::number(MAJOR_VERSION)+"."+QString::number(MINOR_VERSION)+"."+QString::number(PATCH_VERSION)+(QString(STRINGIZE(BUILD)).isEmpty()?" ":"")+STRINGIZE(BUILD) + "Manual");
 	o->paragraph("This file documents wkhtmltopdf, a program capable of converting html "
 				 "documents into PDF documents.");
 	o->endSection();

+ 2 - 1
static_qt_conf_base

@@ -50,4 +50,5 @@
 -no-opengl
 -no-dbus
 -no-multimedia
--fast
+-fast
+-openssl

+ 1 - 1
static_qt_conf_linux

@@ -36,4 +36,4 @@
 -no-xsync
 -no-javascript-jit
 -no-svg
--openssl-linked
+

+ 3 - 3
static_qt_conf_win

@@ -12,11 +12,11 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with wkhtmltopdf.  If not, see <http:#www.gnu.org/licenses/>.
--no-style-windows
+-qt-style-windows    #Required for cleanlooks
+-qt-style-cleanlooks
 -no-style-windowsxp
 -no-style-windowsvista
 -no-style-plastique
 -no-style-motif
 -no-style-cde
--qt-style-cleanlooks
--openssl
+