diff --git a/packaging/win32/defaults b/packaging/win32/defaults index 21ba3db400..230d181cc6 100644 --- a/packaging/win32/defaults +++ b/packaging/win32/defaults @@ -38,13 +38,34 @@ set_default GLOBAL_DIR c:\\soft set_default TMP_DIR $GLOBAL_DIR\\tmp set_default DOWNLOAD_DIR $GLOBAL_DIR\\downloads -set_default GNUCASH_DIR $GLOBAL_DIR\\gnucash -set_default REPOS_URL "http://svn.gnucash.org/repo/gnucash/trunk" -set_default REPOS_DIR $GNUCASH_DIR\\repos -# keep this pointing from BUILD_DIR to REPOS_DIR -set_default REL_REPOS_DIR ..\\repos -set_default BUILD_DIR $GNUCASH_DIR\\build -set_default INSTALL_DIR $GNUCASH_DIR\\inst +if [ -z "$BUILD_FROM_TARBALL" ]; then + if [ -f "../../src/swig-runtime.h" ]; then + BUILD_FROM_TARBALL=yes + else + BUILD_FROM_TARBALL=no + fi +fi + +if [ "$BUILD_FROM_TARBALL" = "yes" ]; then + UPDATE_SOURCES=no + set_default GNUCASH_DIR "$(wpwd ..\\..)" + set_default REPOS_DIR $GNUCASH_DIR + # keep this pointing from BUILD_DIR to REPOS_DIR + set_default REL_REPOS_DIR .. + set_default BUILD_DIR $GNUCASH_DIR\\build + set_default INSTALL_DIR $GNUCASH_DIR\\inst +else + # change this to "no" if you are using install.sh from the same repository checkout + set_default UPDATE_SOURCES yes + set_default GNUCASH_DIR $GLOBAL_DIR\\gnucash + set_default REPOS_URL "http://svn.gnucash.org/repo/gnucash/trunk" + set_default REPOS_DIR $GNUCASH_DIR\\repos + # keep this pointing from BUILD_DIR to REPOS_DIR + set_default REL_REPOS_DIR ..\\repos + set_default BUILD_DIR $GNUCASH_DIR\\build + set_default INSTALL_DIR $GNUCASH_DIR\\inst +fi + #### # For cross-compiling, change this to "yes" @@ -277,8 +298,10 @@ if test x$cross_compile != xyes ; then add_step inst_inno add_step inst_hh fi -add_step inst_svn -add_step svn_up +if test x$UPDATE_SOURCES = xyes ; then + add_step inst_svn + add_step svn_up +fi add_step inst_gnucash add_step inst_docs diff --git a/packaging/win32/dist.sh b/packaging/win32/dist.sh index 36b8484d33..49efafe897 100644 --- a/packaging/win32/dist.sh +++ b/packaging/win32/dist.sh @@ -211,14 +211,17 @@ function finish() { echo "Now running the Inno Setup Compiler for creating the setup.exe" ${_INNO_UDIR}/iscc ${_GNUCASH_UDIR}/gnucash.iss - # And changing output filename - SVN_REV=`grep GNUCASH_SVN_REV ${_BUILD_UDIR}/src/gnome-utils/gnc-svninfo.h | cut -d" " -f3 | cut -d\" -f2 ` - SETUP_FILENAME="gnucash-2.0.99-svn-r${SVN_REV}-setup.exe" - qpushd ${_GNUCASH_UDIR} - mv gnucash-2.0.99-setup.exe ${SETUP_FILENAME} - qpopd - echo "Final resulting Setup program is:" - echo ${_GNUCASH_UDIR}/${SETUP_FILENAME} + if [ "$BUILD_FROM_TARBALL" = "no" ]; then + # And changing output filename + PKG_VERSION=`grep PACKAGE_VERSION ${_BUILD_UDIR}/config.h | cut -d" " -f3 | cut -d\" -f2 ` + SVN_REV=`grep GNUCASH_SVN_REV ${_BUILD_UDIR}/src/gnome-utils/gnc-svninfo.h | cut -d" " -f3 | cut -d\" -f2 ` + SETUP_FILENAME="gnucash-${PKG_VERSION}-svn-r${SVN_REV}-setup.exe" + qpushd ${_GNUCASH_UDIR} + mv gnucash-${PKG_VERSION}-setup.exe ${SETUP_FILENAME} + qpopd + echo "Final resulting Setup program is:" + echo ${_GNUCASH_UDIR}/${SETUP_FILENAME} + fi } prepare diff --git a/packaging/win32/functions b/packaging/win32/functions index e485f5fc93..e5ab573f02 100644 --- a/packaging/win32/functions +++ b/packaging/win32/functions @@ -38,6 +38,14 @@ function quiet() { "$@" &>/dev/null; } # c:/dir/sub function win_fs_path() { echo "$*" | sed 's,\\,/,g'; } +# usage: wpwd [rel] +# rel can be any relative path +function wpwd() { + qpushd `unix_path "${1:-.}"` + pwd -W + qpopd +} + # usage: smart_wget URL DESTDIR function smart_wget() { _FILE=`basename $1` diff --git a/packaging/win32/install.sh b/packaging/win32/install.sh index dcae3b6753..4a2465647a 100644 --- a/packaging/win32/install.sh +++ b/packaging/win32/install.sh @@ -913,7 +913,9 @@ function inst_gnucash() { export BUILD_GUILE=yes export name_build_guile=/usr/bin/guile-config fi - ./autogen.sh + if [ "$BUILD_FROM_TARBALL" != "yes" ]; then + ./autogen.sh + fi # Windows DLLs don't need relinking grep -v "need_relink=yes" ltmain.sh > ltmain.sh.new ; mv ltmain.sh.new ltmain.sh qpopd