(lilypond-main): Redirect to gui-main if 'gui is set.
Backportme.
* scripts/midi2ly.py (datadir): Add libdir iso datadir to path,
for alternative installations kludging s/share/lib/g
LILYPONDPREFIX. Backportme.
* SConstruct (libdir_package_version): Define.
* python/SConscript:
* python/GNUmakefile (INSTALLATION_OUT_DIR): Install binary .so
module in libdir. Backportme.
+2005-10-23 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * scm/lily.scm: Remove horrendous running-from-gui? kludge.
+ (lilypond-main): Redirect to gui-main if 'gui is set.
+ Backportme.
+
+ * scripts/midi2ly.py (datadir): Add libdir iso datadir to path,
+ for alternative installations kludging s/share/lib/g
+ LILYPONDPREFIX. Backportme.
+
+ * SConstruct (libdir_package_version): Define.
+
+ * python/SConscript:
+ * python/GNUmakefile (INSTALLATION_OUT_DIR): Install binary .so
+ module in libdir. Backportme.
+
2005-10-22 Han-Wen Nienhuys <hanwen@xs4all.nl>
* lily/main.cc: clarify --safe.
bindir = os.path.join (prefix, 'bin')
sharedir = os.path.join (prefix, 'share')
libdir = os.path.join (prefix, 'lib')
+libdir_package = os.path.join (libdir, package.name)
+lidbir_package_version = os.path.join (libdir_package, version)
localedir = os.path.join (sharedir, 'locale')
sharedir_doc_package = os.path.join (sharedir, 'doc', package.name)
sharedir_package = os.path.join (sharedir, package.name)
#include <unistd.h>
+#include "file-name-map.hh"
#include "file-name.hh"
#include "file-path.hh"
-#include "main.hh"
-#include "lily-parser.hh"
-#include "warn.hh"
-#include "source.hh"
#include "lily-lexer.hh"
+#include "lily-parser.hh"
#include "ly-module.hh"
-#include "file-name-map.hh"
+#include "main.hh"
+#include "program-option.hh"
+#include "source.hh"
+#include "warn.hh"
/* Do not append `!' suffix, since 1st argument is not modified. */
LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click",
/* When running from gui, generate output in .ly source directory. */
if (output_name_global.is_empty ()
- && scm_call_0 (ly_lily_module_constant ("running-from-gui?")) == SCM_BOOL_T)
+ && ly_get_option (ly_symbol2scm ("gui")) == SCM_BOOL_T)
{
File_name f (file);
f.base_ = "";
INSTALLATION_OUT_SUFFIXES=1
INSTALLATION_OUT_FILES=$(OUT_SO_MODULES)
-INSTALLATION_OUT_DIR=$(local_lilypond_datadir)/python
+INSTALLATION_OUT_DIR=$(local_lilypond_libdir)/python
INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/python
INSTALLATION_OUT_FILES1=$(OUT_PY_MODULES) $(OUT_PYC_MODULES)
cm
install (cm + pym, env['sharedir_package_version'] + '/python')
+install (cm, env['libdir_package_version'] + '/python')
(define (no-files-handler)
(ly:usage)
(exit 2))
-
+
+ (if (ly:get-option 'gui)
+ (gui-main files))
(if (null? files)
(no-files-handler))
(use-modules (scm editor))
-(define-public (running-from-gui?)
- (let ((have-tty? (isatty? (current-input-port))))
- ;; If no TTY and not using safe, assume running from GUI.
- (cond
- ((eq? PLATFORM 'windows)
- ;; Always write to .log file.
- (if DOS #t
- ;; This only works for i586-mingw32msvc-gcc -mwindows
- (not (string-match "standard input"
- (format #f "~S" (current-input-port))))))
- ;; FIXME: using -dgui would be nice, but it does not work
- ((eq? PLATFORM 'foo-windows)
- (ly:get-option 'gui))
- ((eq? PLATFORM 'darwin) #f)
- (else
- (not have-tty?)))))
-
(define-public (gui-main files)
(if (null? files)
(gui-no-files-handler))
(let* ((base (basename (car files) ".ly"))
(log-name (string-append base ".log")))
- (if (not (running-from-gui?))
+ (if (not (ly:get-option 'gui))
(ly:message (_ "Redirecting output to ~a...") log-name))
(ly:stderr-redirect log-name "w")
(ly:message "# -*-compilation-*-")
(ly:message (_ "Invoking `~a'...") cmd)
(system cmd)
(exit 1)))
-
-(or (not (running-from-gui?))
- (ly:get-option 'safe)
- (define lilypond-main gui-main))
################################################################
# Users of python modules should include this snippet.
#
-# This soon to be removed for: import lilypond.lilylib as ly
libdir = '@local_lilypond_libdir@'
if not os.path.isdir (libdir):
libdir = '@lilypond_libdir@'
-sys.path.insert (0, os.path.join (libdir, 'python'))
+# ugh
+if os.environ.has_key ('LILYPONDPREFIX'):
+ datadir = os.environ['LILYPONDPREFIX']
+ while datadir[-1] == os.sep:
+ datadir= datadir[:-1]
+ libdir = datadir.replace ('/share/', '/lib/')
+
+sys.path.insert (0, os.path.join (libdir, 'python'))
################################################################