Various install.sh improvements:

* Use $GNUCASH_DIR\\{repos,build,inst,dist} as directories for the
  source, build, installation and packaging
* `mkdir -p' cannot handle backslashes, use unix paths
* Downgrade to ORBit2-2.13.3
* Print command to create /etc/profile.d if needed


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15246 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/gobject-engine-dev
Andreas Köhler 20 years ago
parent 49470adf27
commit cef6ed4b1f

@ -6,9 +6,11 @@ GLOBAL_DIR=c:\\soft
TMP_DIR=$GLOBAL_DIR\\tmp
DOWNLOAD_DIR=$GLOBAL_DIR\\downloads
REPOS_URL="http://svn.gnucash.org/repo/gnucash/trunk"
REPOS_DIR=$GLOBAL_DIR\\repos
GNUCASH_DIR=$GLOBAL_DIR\\gnucash
REPOS_URL="http://svn.gnucash.org/repo/gnucash/trunk"
REPOS_DIR=$GNUCASH_DIR\\repos
BUILD_DIR=$GNUCASH_DIR\\build
INSTALL_DIR=$GNUCASH_DIR\\inst
####
cross_compile="no"
@ -112,8 +114,8 @@ LIBART_LGPL_DEV_URL="$GNOME_WIN32_URL/libart_lgpl/2.3/libart_lgpl-dev-2.3.17.zip
GTK_URL="$GNOME_WIN32_URL/gtk+/2.10/gtk+-2.10.6.zip"
GTK_DEV_URL="$GNOME_WIN32_URL/gtk+/2.10/gtk+-dev-2.10.6.zip"
INTLTOOL_URL="$GNOME_WIN32_URL/intltool/0.35/intltool-0.35.0.zip"
ORBIT2_URL="$GNOME_WIN32_URL/ORBit2/2.14/ORBit2-2.14.2.zip"
ORBIT2_DEV_URL="$GNOME_WIN32_URL/ORBit2/2.14/ORBit2-dev-2.14.2.zip"
ORBIT2_URL="$GNOME_WIN32_URL/ORBit2/2.13/ORBit2-2.13.3.zip"
ORBIT2_DEV_URL="$GNOME_WIN32_URL/ORBit2/2.13/ORBit2-dev-2.13.3.zip"
GAIL_URL="$GNOME_WIN32_URL/gail/1.9/gail-1.9.3.zip"
GAIL_DEV_URL="$GNOME_WIN32_URL/gail/1.9/gail-dev-1.9.3.zip"
POPT_URL="$GNOME_WIN32_DEPS_URL/popt-1.10.2-tml-20050828.zip"

@ -13,7 +13,8 @@ qpushd "$(dirname $(unix_path "$0"))"
register_env_var PATH ":"
function prepare() {
DIST_DIR=${GNUCASH_DIR}\\dist
# this directory is hardcoded in gnucash.iss.in
DIST_DIR=${INSTALL_DIR}\\..\\dist
DIST_UDIR=`unix_path $DIST_DIR`
DIST_WFSDIR=`win_fs_path $DIST_DIR`
TMP_UDIR=`unix_path $TMP_DIR`
@ -29,6 +30,8 @@ function prepare() {
_LIBGSF_UDIR=`unix_path $LIBGSF_DIR`
_GOFFICE_UDIR=`unix_path $GOFFICE_DIR`
_GNUCASH_UDIR=`unix_path $GNUCASH_DIR`
_BUILD_UDIR=`unix_path $BUILD_DIR`
_INSTALL_UDIR=`unix_path $INSTALL_DIR`
_INNO_UDIR=`unix_path $INNO_DIR`
add_to_env $_UNZIP_UDIR/bin PATH # unzip
add_to_env $_GNOME_UDIR/bin PATH # gconftool-2
@ -126,17 +129,18 @@ function dist_goffice() {
function dist_gnucash() {
setup GnuCash
mkdir -p $DIST_UDIR/bin
cp $_GNUCASH_UDIR/bin/* $DIST_UDIR/bin
cp $_INSTALL_UDIR/bin/* $DIST_UDIR/bin
mkdir -p $DIST_UDIR/etc/gconf/schemas
cp $_GNUCASH_UDIR/etc/gconf/schemas/* $DIST_UDIR/etc/gconf/schemas
cp $_INSTALL_UDIR/etc/gconf/schemas/* $DIST_UDIR/etc/gconf/schemas
mkdir -p $DIST_UDIR/lib
cp -r $_GNUCASH_UDIR/lib/{bin,locale} $DIST_UDIR/lib
cp $_GNUCASH_UDIR/lib/lib*.{dll,la} $DIST_UDIR/lib
cp -r $_INSTALL_UDIR/lib/{bin,locale} $DIST_UDIR/lib
cp $_INSTALL_UDIR/lib/lib*.{dll,la} $DIST_UDIR/lib
mkdir -p $DIST_UDIR/lib/gnucash
cp $_GNUCASH_UDIR/lib/gnucash/lib*.{dll,la} $DIST_UDIR/lib/gnucash
cp -r $_GNUCASH_UDIR/libexec $DIST_UDIR
cp $_INSTALL_UDIR/lib/gnucash/lib*.{dll,la} $DIST_UDIR/lib/gnucash
cp -r $_INSTALL_UDIR/libexec $DIST_UDIR
mkdir -p $DIST_UDIR/share
cp -r $_GNUCASH_UDIR/share/{gnucash,pixmaps,xml} $DIST_UDIR/share
cp -r $_INSTALL_UDIR/share/{gnucash,pixmaps,xml} $DIST_UDIR/share
cp $_BUILD_UDIR/packaging/win32/gnucash.iss $_GNUCASH_UDIR
}
function finish() {
@ -149,7 +153,7 @@ function finish() {
done
echo "You can now run the Inno Setup Compiler for creating the setup.exe:"
echo ${_INNO_UDIR}/iscc ${_GNUCASH_UDIR}/packaging/win32/gnucash.iss
echo ${_INNO_UDIR}/iscc ${_GNUCASH_UDIR}/gnucash.iss
}
prepare

@ -15,12 +15,12 @@ AppSupportURL=http://www.gnucash.org
AppUpdatesURL=http://www.gnucash.org
DefaultDirName={pf}\@PACKAGE@
DefaultGroupName=GnuCash
LicenseFile=@prefix@\dist\share\@PACKAGE@\doc\COPYING
LicenseFile=@prefix@\..\dist\share\@PACKAGE@\doc\COPYING
Compression=lzma
OutputDir=.
OutputBaseFilename=@PACKAGE@-@VERSION@-setup
UninstallFilesDir={app}\uninstall\@PACKAGE@
InfoAfterFile=@prefix@\dist\share\@PACKAGE@\doc\README
InfoAfterFile=@prefix@\..\dist\share\@PACKAGE@\doc\README
[Types]
Name: "full"; Description: "{cm:FullInstall}"
@ -49,26 +49,26 @@ Filename: "{app}\bin\gnucash.bat"; Description: "{cm:RunPrg}"; WorkingDir: "{app
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Files]
; The main executables and DLLs
Source: "@prefix@\dist\bin\*"; DestDir: "{app}\bin"; Flags: recursesubdirs; Components: main; AfterInstall: MyAfterInstallConfig(ExpandConstant('{app}\bin\gnucash.bat'))
Source: "@prefix@\..\dist\bin\*"; DestDir: "{app}\bin"; Flags: recursesubdirs; Components: main; AfterInstall: MyAfterInstallConfig(ExpandConstant('{app}\bin\gnucash.bat'))
; Note: The above AfterInstall function will create the
; gnucash.bat file on-the-fly by the Pascal script below.
Source: "@prefix@\dist\etc\*"; DestDir: "{app}\etc"; Flags: recursesubdirs; Components: main
Source: "@prefix@\dist\lib\*"; DestDir: "{app}\lib"; Flags: recursesubdirs; Components: main
Source: "@prefix@\dist\libexec\*"; DestDir: "{app}\libexec"; Flags: recursesubdirs; Components: main
Source: "@prefix@\dist\share\*"; DestDir: "{app}\share"; Flags: recursesubdirs; Components: main
Source: "@prefix@\..\dist\etc\*"; DestDir: "{app}\etc"; Flags: recursesubdirs; Components: main
Source: "@prefix@\..\dist\lib\*"; DestDir: "{app}\lib"; Flags: recursesubdirs; Components: main
Source: "@prefix@\..\dist\libexec\*"; DestDir: "{app}\libexec"; Flags: recursesubdirs; Components: main
Source: "@prefix@\..\dist\share\*"; DestDir: "{app}\share"; Flags: recursesubdirs; Components: main
;; The translations (no idea why mingw installs them in prefix/lib/locale)
;Source: "@prefix@\dist\lib\locale\*"; DestDir: "{app}\lib\locale"; Flags: recursesubdirs; Components: translations
;Source: "@prefix@\..\dist\lib\locale\*"; DestDir: "{app}\lib\locale"; Flags: recursesubdirs; Components: translations
;
;; The account templates
;Source: "@prefix@\dist\share\gnucash\accounts\*"; DestDir: "{app}\share\gnucash\accounts"; Flags: recursesubdirs; Components: templates
;Source: "@prefix@\..\dist\share\gnucash\accounts\*"; DestDir: "{app}\share\gnucash\accounts"; Flags: recursesubdirs; Components: templates
; And all the documentation
Source: "@prefix@\dist\share\@PACKAGE@\doc\README"; DestDir: "{app}\doc\@PACKAGE@"; Components: main
Source: "@prefix@\dist\share\@PACKAGE@\doc\COPYING"; DestDir: "{app}\doc\@PACKAGE@"; Flags: ignoreversion; Components: main
Source: "@prefix@\dist\share\@PACKAGE@\doc\AUTHORS"; DestDir: "{app}\doc\@PACKAGE@"; Components: main
Source: "@prefix@\dist\share\@PACKAGE@\doc\ChangeLog"; DestDir: "{app}\doc\@PACKAGE@"; Components: main
Source: "@prefix@\..\dist\share\@PACKAGE@\doc\README"; DestDir: "{app}\doc\@PACKAGE@"; Components: main
Source: "@prefix@\..\dist\share\@PACKAGE@\doc\COPYING"; DestDir: "{app}\doc\@PACKAGE@"; Flags: ignoreversion; Components: main
Source: "@prefix@\..\dist\share\@PACKAGE@\doc\AUTHORS"; DestDir: "{app}\doc\@PACKAGE@"; Components: main
Source: "@prefix@\..\dist\share\@PACKAGE@\doc\ChangeLog"; DestDir: "{app}\doc\@PACKAGE@"; Components: main
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

@ -55,10 +55,10 @@ function prepare() {
qpopd
fi
mkdir -p $TMP_DIR
mkdir -p $DOWNLOAD_DIR
DOWNLOAD_UDIR=`unix_path $DOWNLOAD_DIR`
TMP_UDIR=`unix_path $TMP_DIR`
mkdir -p $TMP_UDIR
mkdir -p $DOWNLOAD_UDIR
}
function inst_wget() {
@ -68,7 +68,7 @@ function inst_wget() {
then
echo "already installed. skipping."
else
mkdir -p $WGET_DIR
mkdir -p $_WGET_UDIR
tar -xjpf $DOWNLOAD_UDIR/wget*.tar.bz2 -C $WGET_DIR
cp $_WGET_UDIR/*/*/wget.exe $WGET_DIR
fi
@ -140,7 +140,7 @@ function inst_regex() {
then
echo "regex already installed. skipping."
else
mkdir -p $REGEX_DIR
mkdir -p $_REGEX_UDIR
wget_unpacked $REGEX_BIN_URL $DOWNLOAD_DIR $REGEX_DIR
wget_unpacked $REGEX_LIB_URL $DOWNLOAD_DIR $REGEX_DIR
fi
@ -157,7 +157,7 @@ function inst_readline() {
then
echo "readline already installed. skipping."
else
mkdir -p $READLINE_DIR
mkdir -p $_READLINE_UDIR
wget_unpacked $READLINE_BIN_URL $DOWNLOAD_DIR $READLINE_DIR
wget_unpacked $READLINE_LIB_URL $DOWNLOAD_DIR $READLINE_DIR
fi
@ -172,7 +172,7 @@ function inst_indent() {
then
echo "indent already installed. skipping."
else
mkdir -p $INDENT_DIR
mkdir -p $_INDENT_UDIR
wget_unpacked $INDENT_BIN_URL $DOWNLOAD_DIR $INDENT_DIR
fi
quiet which indent || die "indent unavailable"
@ -296,7 +296,7 @@ function inst_guile() {
qpopd
_GUILE_MAJOR=`echo $_GUILE_UDIR/share/guile/1.* | sed 's,.*/,,'`
_SLIB_DIR=$GUILE_DIR\\share\\guile\\$_GUILE_MAJOR
mkdir -p $_SLIB_DIR
mkdir $_SLIB_DIR
unzip $_SLIB_BALL -d $_SLIB_DIR
qpushd $_SLIB_DIR/slib
cp guile.init guile.init.bak
@ -305,7 +305,7 @@ function inst_guile() {
qpopd
fi
if test x$cross_compile = xyes ; then
qpushd $GUILE_DIR/bin
qpushd $_GUILE_UDIR/bin
# The cross-compiling guile expects these program names
# for the build-time guile
ln -sf /usr/bin/guile-config mingw32-guile-config
@ -404,7 +404,7 @@ function inst_gnome() {
then
echo "gnome packages installed. skipping."
else
mkdir -p $GNOME_DIR
mkdir -p $_GNOME_UDIR
wget_unpacked $GETTEXT_URL $DOWNLOAD_DIR $GNOME_DIR
wget_unpacked $GETTEXT_DEV_URL $DOWNLOAD_DIR $GNOME_DIR
wget_unpacked $LIBICONV_URL $DOWNLOAD_DIR $GNOME_DIR
@ -494,13 +494,13 @@ EOF
qpopd
fi
if test x$cross_compile = xyes ; then
qpushd $GNOME_DIR/lib/pkgconfig
qpushd $_GNOME_UDIR/lib/pkgconfig
perl -pi.bak -e"s!^prefix=.*\$!prefix=$GNOME_DIR!" *.pc
#perl -pi.bak -e's!^Libs: !Libs: -L\${prefix}/bin !' *.pc
qpopd
# Latest gnome-dev packages don't ship with *.la files
# anymore. What do we do...?
#qpushd $GNOME_DIR/bin
#qpushd $_GNOME_UDIR/bin
# for A in *-0.dll; do ln -sf $A `echo $A|sed 's/\(.*\)-0.dll/\1.dll/'`; done
#qpopd
fi
@ -631,7 +631,7 @@ function inst_svn() {
}
function svn_up() {
mkdir -p $REPOS_DIR
mkdir -p $_REPOS_UDIR
qpushd $REPOS_DIR
# latest revision that should compile, use HEAD or vwxyz
SVN_REV="HEAD"
@ -647,72 +647,77 @@ function svn_up() {
function inst_gnucash() {
setup GnuCash
_GNUCASH_WFSDIR=`win_fs_path $GNUCASH_DIR`
_GNUCASH_UDIR=`unix_path $GNUCASH_DIR`
_INSTALL_WFSDIR=`win_fs_path $INSTALL_DIR`
_INSTALL_UDIR=`unix_path $INSTALL_DIR`
_BUILD_UDIR=`unix_path $BUILD_DIR`
mkdir -p $_BUILD_UDIR
qpushd $REPOS_DIR
if test "x$cross_compile" = xyes ; then
# Set these variables manually because of cross-compiling
export GUILE_LIBS="${GUILE_LDFLAGS} -lguile -lguile-ltdl"
export GUILE_INCS="${GUILE_CPPFLAGS}"
export BUILD_GUILE=yes
export name_build_guile=/usr/bin/guile-config
fi
./autogen.sh
./configure ${HOST_XCOMPILE} ${TARGET_XCOMPILE} \
--prefix=$_GNUCASH_WFSDIR \
--enable-debug \
--enable-schemas-install=no \
--enable-binreloc \
CPPFLAGS="${AUTOTOOLS_CPPFLAGS} ${REGEX_CPPFLAGS} ${GNOME_CPPFLAGS} ${GUILE_CPPFLAGS} -D_WIN32" \
LDFLAGS="${AUTOTOOLS_LDFLAGS} ${REGEX_LDFLAGS} ${GNOME_LDFLAGS} ${GUILE_LDFLAGS}" \
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
# Windows DLLs don't need relinking
grep -v "need_relink=yes" ltmain.sh > ltmain.sh.new ; mv ltmain.sh.new ltmain.sh
grep -v "need_relink=yes" libtool > libtool.new ; mv libtool.new libtool
# Exclude (for now) the test subdirectories from the build
# because executable linking is so painfully slow on mingw
perl -pi.instbak -e's#^(SUBDIRS.* )test( .*)?$#\1\2#' `find src -name Makefile`
find src -name Makefile.instbak -exec rm {} \;
make
# Try to fix the paths in the "gnucash" script
qpushd src/bin
rm gnucash
make PATH_SEPARATOR=";" \
bindir="${_GNUCASH_UDIR}/bin:${_GNUCASH_UDIR}/lib/bin:${_GOFFICE_UDIR}/bin:${_LIBGSF_UDIR}/bin:${_GNOME_UDIR}/bin:${_LIBXML2_UDIR}/bin:${_GUILE_UDIR}/bin:${_REGEX_UDIR}/bin:${_AUTOTOOLS_UDIR}/bin" \
gnucash
if test "x$cross_compile" = xyes ; then
# Set these variables manually because of cross-compiling
export GUILE_LIBS="${GUILE_LDFLAGS} -lguile -lguile-ltdl"
export GUILE_INCS="${GUILE_CPPFLAGS}"
export BUILD_GUILE=yes
export name_build_guile=/usr/bin/guile-config
fi
./autogen.sh
# Windows DLLs don't need relinking
grep -v "need_relink=yes" ltmain.sh > ltmain.sh.new ; mv ltmain.sh.new ltmain.sh
qpopd
make install
qpushd $BUILD_DIR
$_REPOS_UDIR/configure ${HOST_XCOMPILE} ${TARGET_XCOMPILE} \
--prefix=$_INSTALL_WFSDIR \
--enable-debug \
--enable-schemas-install=no \
--enable-binreloc \
CPPFLAGS="${AUTOTOOLS_CPPFLAGS} ${REGEX_CPPFLAGS} ${GNOME_CPPFLAGS} ${GUILE_CPPFLAGS} -D_WIN32" \
LDFLAGS="${AUTOTOOLS_LDFLAGS} ${REGEX_LDFLAGS} ${GNOME_LDFLAGS} ${GUILE_LDFLAGS}" \
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
# Windows DLLs don't need relinking
grep -v "need_relink=yes" libtool > libtool.new ; mv libtool.new libtool
# Exclude (for now) the test subdirectories from the build
# because executable linking is so painfully slow on mingw
perl -pi.instbak -e's#^(SUBDIRS.* )test( .*)?$#\1\2#' `find src -name Makefile`
find src -name Makefile.instbak -exec rm {} \;
make
# Try to fix the paths in the "gnucash" script
qpushd src/bin
rm gnucash
make PATH_SEPARATOR=";" \
bindir="${_INSTALL_UDIR}/bin:${_INSTALL_UDIR}/lib/bin:${_GOFFICE_UDIR}/bin:${_LIBGSF_UDIR}/bin:${_GNOME_UDIR}/bin:${_LIBXML2_UDIR}/bin:${_GUILE_UDIR}/bin:${_REGEX_UDIR}/bin:${_AUTOTOOLS_UDIR}/bin" \
gnucash
qpopd
make install
qpopd
qpushd ${_GNUCASH_WFSDIR}/lib/gnucash
# Remove the dependency_libs line from the installed .la files
# because otherwise loading the modules literally takes hours.
for A in *.la; do grep -v dependency_libs $A > tmp ; mv tmp $A; done
qpushd $_INSTALL_UDIR/lib/gnucash
# Remove the dependency_libs line from the installed .la files
# because otherwise loading the modules literally takes hours.
for A in *.la; do grep -v dependency_libs $A > tmp ; mv tmp $A; done
qpopd
qpushd ${_GNUCASH_WFSDIR}/etc/gconf/schemas
for file in *.schemas; do
gconftool-2 \
--config-source=xml:merged:${_GNUCASH_WFSDIR}/etc/gconf/gconf.xml.defaults \
--install-schema-file $file
done
gconftool-2 --shutdown
qpushd $_INSTALL_UDIR/etc/gconf/schemas
for file in *.schemas; do
gconftool-2 \
--config-source=xml:merged:${_INSTALL_WFSDIR}/etc/gconf/gconf.xml.defaults \
--install-schema-file $file
done
gconftool-2 --shutdown
qpopd
# Create a startup script that works without the msys shell
qpushd ${_GNUCASH_WFSDIR}/bin
echo "set PATH=${GNUCASH_DIR}\\bin;${GNUCASH_DIR}\\lib\\bin;${GOFFICE_DIR}\\bin;${LIBGSF_DIR}\\bin;${GNOME_DIR}\\bin;${LIBXML2_DIR}\\bin;${GUILE_DIR}\\bin;${REGEX_DIR}\\bin;${AUTOTOOLS_DIR}\\bin;%PATH%" > gnucash.bat
echo "set GUILE_WARN_DEPRECATED=no" >> gnucash.bat
echo "set GNC_MODULE_PATH=${GNUCASH_DIR}\\lib\\gnucash" >> gnucash.bat
echo "set GUILE_LOAD_PATH=${GNUCASH_DIR}\\share\\gnucash\\guile-modules;${GNUCASH_DIR}\\share\\gnucash\\scm;%GUILE_LOAD_PATH%" >> gnucash.bat
# Really sure we don't need this?
#echo "set SCHEME_LIBRARY_PATH=${GUILE_DIR}\\share\\guile\\site\\slib\\" >> gnucash.bat
echo "set LTDL_LIBRARY_PATH=${GNUCASH_DIR}\\lib" >> gnucash.bat
echo "start gnucash-bin" >> gnucash.bat
qpushd $_INSTALL_UDIR}/bin
echo "set PATH=${INSTALL_DIR}\\bin;${INSTALL_DIR}\\lib\\bin;${GOFFICE_DIR}\\bin;${LIBGSF_DIR}\\bin;${GNOME_DIR}\\bin;${LIBXML2_DIR}\\bin;${GUILE_DIR}\\bin;${REGEX_DIR}\\bin;${AUTOTOOLS_DIR}\\bin;%PATH%" > gnucash.bat
echo "set GUILE_WARN_DEPRECATED=no" >> gnucash.bat
echo "set GNC_MODULE_PATH=${INSTALL_DIR}\\lib\\gnucash" >> gnucash.bat
echo "set GUILE_LOAD_PATH=${INSTALL_DIR}\\share\\gnucash\\guile-modules;${INSTALL_DIR}\\share\\gnucash\\scm;%GUILE_LOAD_PATH%" >> gnucash.bat
echo "set LTDL_LIBRARY_PATH=${INSTALL_DIR}\\lib" >> gnucash.bat
echo "start gnucash-bin" >> gnucash.bat
qpopd
}
@ -726,6 +731,7 @@ function finish() {
echo
echo "Environment variables changed, please do the following"
echo
[ -d /etc/profile.d ] || echo "mkdir -p /etc/profile.d"
_NEW=
fi
_VAL=`eval echo '"$'"${_ENV}_BASE"'"'`

Loading…
Cancel
Save