From ac4c65dd51c011863bf7cd9c829775fc0e706784 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Tue, 6 Apr 2010 11:03:23 +0000 Subject: [PATCH] Revive gnucash-setup-env on OSX/Quartz. This fixes the OSX issues caused by the introduction of the environment config file. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19000 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/bin/Makefile.am | 28 ++++++++++++++++++---- src/bin/environment-osx.in | 31 +++++++++++++----------- src/bin/gnucash-setup-env-osx.in | 41 ++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 18 deletions(-) create mode 100644 src/bin/gnucash-setup-env-osx.in diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 65643717cd..7bcfa29854 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -38,10 +38,11 @@ configdir = ${GNC_CONFIGDIR} config_DATA = environment if PLATFORM_OSX_QUARTZ -PRE_RUN = if test -z \"\$$DBUS_SESSION_BUS_ADDRESS\"; then\n\ - eval \`dbus-launch --sh-syntax --exit-with-session --config-file=${PREFIX}/etc/dbus-1/session.conf\`\nfi\n +PRE_RUN = '. @-BIN_DIR-@/gnucash_setup_env' +PLATFORM_FILES = gnucash-setup-env else PRE_RUN = +PLATFORM_FILES = endif gnucash: gnucash.in ${top_builddir}/config.status Makefile @@ -72,6 +73,24 @@ gnucash-valgrind: gnucash-valgrind.in ${top_builddir}/config.status Makefile mv $@.tmp $@ chmod u+x $@ +if PLATFORM_OSX_QUARTZ +gnucash-setup-env: gnucash-setup-env-osx.in ${top_builddir}/config.status Makefile + rm -f $@.tmp + sed < $< > $@.tmp \ + -e 's#@-BIN_DIR-@#${bindir}#g' \ + -e 's#@-GNC_DBD_DIR-@#${GNC_DBD_DIR}#g' \ + -e 's#@-GNC_STANDARD_REPORTS_DIR-@#${GNC_SHAREDIR}/guile-modules/gnucash/report/standard-reports#g' \ + -e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \ + -e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \ + -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \ + -e 's#@-GNC_PKGLIB_INSTALLDIR-@#${pkglibdir}#g' \ + -e "s#@-TOP_SRC_DIR-@#`pwd`/${top_srcdir}#g" \ + -e 's#@-PATH_SEPARATOR-@#${PATH_SEPARATOR}#g' \ + -e 's#@-PREFIX-@#${prefix}#g' + mv $@.tmp $@ + chmod u+x $@ +endif + environment: ${GNUCASH_ENVIRONMENT}.in ${top_builddir}/config.status Makefile rm -f $@.tmp sed < $< > $@.tmp \ @@ -92,7 +111,7 @@ endif mv $@.tmp $@ chmod u+x $@ -CLEANFILES = $(BUILT_SOURCES) gnucash gnucash-valgrind gnucash-gdb environment +CLEANFILES = $(BUILT_SOURCES) gnucash gnucash-valgrind gnucash-gdb environment ${PLATFORM_FILES} # We handle gnucash scripts in a somewhat unexpected way, but we do # this so that a user who doesn't necessarily have the right @@ -129,7 +148,8 @@ EXTRA_DIST = \ gnucash-gdb.in \ environment.in \ environment-win32.in \ - environment-osx.in + environment-osx.in \ + ${PLATFORM_FILES} ## Gnucash scripts -- real code is in overrides, these just get you there. ${gnc_common_scripts}: generate-gnc-script ${top_builddir}/config.status diff --git a/src/bin/environment-osx.in b/src/bin/environment-osx.in index 84e95749bf..68064b0d41 100644 --- a/src/bin/environment-osx.in +++ b/src/bin/environment-osx.in @@ -11,21 +11,24 @@ # - packaging/win32/install.sh [Variables] -GUILE_WARN_DEPRECATED=no -XDG_CONFIG_DIRS=@-PREFIX-@/etc/xdg -XDG_DATA_DIRS=@-PREFIX-@/share +# All settings are commented out for now. This requires more testing +# on the interaction with the OSX bundle launcher script. +# Until then these parameters remain set via gnucash-setup-env +#GUILE_WARN_DEPRECATED=no +#XDG_CONFIG_DIRS=@-PREFIX-@/etc/xdg +#XDG_DATA_DIRS=@-PREFIX-@/share -PATH=@-BIN_DIR-@;{PATH} -GNC_MODULE_PATH=@-GNC_PKGLIB_INSTALLDIR-@;{GNC_MODULE_PATH} +#PATH=@-BIN_DIR-@;{PATH} +#GNC_MODULE_PATH=@-GNC_PKGLIB_INSTALLDIR-@;{GNC_MODULE_PATH} -EXTRA_PATH={EXTRA_PATH};@-GNC_GUILE_MODULE_DIR-@;@-GNC_SCM_INSTALL_DIR-@ -GUILE_LOAD_PATH={EXTRA_PATH};{GUILE_LOAD_PATH} +#EXTRA_PATH={EXTRA_PATH};@-GNC_GUILE_MODULE_DIR-@;@-GNC_SCM_INSTALL_DIR-@ +#GUILE_LOAD_PATH={EXTRA_PATH};{GUILE_LOAD_PATH} -EXTRA_LIBS={GNC_MODULE_PATH};/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/ -EXTRA_LIBS={EXTRA_LIBS};@-GNC_LIB_INSTALLDIR-@;@-GNC_PKGLIB_INSTALLDIR-@ -LD_LIBRARY_PATH={EXTRA_LIBS};${LD_LIBRARY_PATH} -DYLD_LIBRARY_PATH={EXTRA_LIBS};${DYLD_LIBRARY_PATH} +#EXTRA_LIBS={GNC_MODULE_PATH};/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/ +#EXTRA_LIBS={EXTRA_LIBS};@-GNC_LIB_INSTALLDIR-@;@-GNC_PKGLIB_INSTALLDIR-@ +#LD_LIBRARY_PATH={EXTRA_LIBS};${LD_LIBRARY_PATH} +#DYLD_LIBRARY_PATH={EXTRA_LIBS};${DYLD_LIBRARY_PATH} -GNC_DBD_DIR=@-GNC_DBD_DIR-@ -GNC_STANDARD_REPORTS_DIR=@-GNC_STANDARD_REPORTS_DIR-@ -GNC_DOT_DIR={HOME}/Library/Application Support/Gnucash \ No newline at end of file +#GNC_DBD_DIR=@-GNC_DBD_DIR-@ +#GNC_STANDARD_REPORTS_DIR=@-GNC_STANDARD_REPORTS_DIR-@ +#GNC_DOT_DIR={HOME}/Library/Application Support/Gnucash \ No newline at end of file diff --git a/src/bin/gnucash-setup-env-osx.in b/src/bin/gnucash-setup-env-osx.in new file mode 100644 index 0000000000..f366542c3c --- /dev/null +++ b/src/bin/gnucash-setup-env-osx.in @@ -0,0 +1,41 @@ +# If you make any changes here, you should probably also change the equivalent sections +# in packaging/win32/gnucash.iss.in, packaging/win32/install.sh and src/bin/gnucash-setup-env.in + +PATH="@-BIN_DIR-@:${PATH}" +export PATH +XDG_CONFIG_DIRS=@-PREFIX-@/etc/xdg +export XDG_CONFIG_DIRS +XDG_DATA_DIRS=@-PREFIX-@/share +export XDG_DATA_DIRS + + +GUILE_WARN_DEPRECATED="no" +export GUILE_WARN_DEPRECATED + +GNC_MODULE_PATH="@-GNC_PKGLIB_INSTALLDIR-@:${GNC_MODULE_PATH}" + +EXTRA_PATH="${EXTRA_PATH}:@-GNC_GUILE_MODULE_DIR-@" +EXTRA_PATH="${EXTRA_PATH}:@-GNC_SCM_INSTALL_DIR-@" +GUILE_LOAD_PATH="${EXTRA_PATH}:${GUILE_LOAD_PATH}" + +EXTRA_LIBS="${GNC_MODULE_PATH}" +EXTRA_LIBS="${EXTRA_LIBS}:/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/" +EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_LIB_INSTALLDIR-@" +EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_PKGLIB_INSTALLDIR-@" + +LD_LIBRARY_PATH="${EXTRA_LIBS}:${LD_LIBRARY_PATH}" +DYLD_LIBRARY_PATH="${EXTRA_LIBS}:${DYLD_LIBRARY_PATH}" +GNC_DBD_DIR="@-GNC_DBD_DIR-@" +GNC_STANDARD_REPORTS_DIR="@-GNC_STANDARD_REPORTS_DIR-@" + +export GNC_MODULE_PATH +export GUILE_LOAD_PATH +export LD_LIBRARY_PATH +export DYLD_LIBRARY_PATH +export GNC_DBD_DIR +export GNC_STANDARD_REPORTS_DIR +export GNC_DOT_DIR="$HOME/Library/Application Support/Gnucash" + +if test -z "$DBUS_SESSION_BUS_ADDRESS"; then + eval `dbus-launch --sh-syntax --exit-with-session --config-file=@-PREFIX-@/etc/dbus-1/session.conf` +fi