]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/lily.scm: Remove horrendous running-from-gui? kludge.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 23 Oct 2005 18:54:34 +0000 (18:54 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 23 Oct 2005 18:54:34 +0000 (18:54 +0000)
(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.

ChangeLog
SConstruct
lily/lily-parser-scheme.cc
python/GNUmakefile
python/SConscript
scm/lily.scm
scripts/midi2ly.py

index 76129c13007242adafca8bdcb1f34ff97efdcf3b..b3f04a4727aef8cc52dd26bf96f0a8eb62b0aeda 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+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.
index c12ee970bed03a74c7d9fc97e2a3c1022a5b2870..9e7c40b1034e86f96d75b518ae791e7633fe1164 100644 (file)
@@ -248,6 +248,8 @@ prefix = env['prefix']
 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)
index ab5de834100b4d936a0b949846f6e539f9b7db53..501eb2023c0f000f904fe2c9c37927ee5335e220 100644 (file)
@@ -8,15 +8,16 @@
 
 #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",
@@ -52,7 +53,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
 
   /* 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_ = "";
index 8c0791d7b1d7eb911131cb8462f7947e81c0c54a..b8a8a913a229a619157b962b00fca08915cbd0d0 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_LDFLAGS=
 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)
index a621d146d0ad5844cd27ddeec3d43c253a0bb40c..d0c94df0cf496371b4031ec9f7e4b52493a7651c 100644 (file)
@@ -11,3 +11,4 @@ pym
 cm
 
 install (cm + pym, env['sharedir_package_version'] + '/python')
+install (cm, env['libdir_package_version'] + '/python')
index 9b93992e24ea720a6327139c620957e1339fe2f9..197936b3e4945c4179bc3f5753453ab47d47e13b 100644 (file)
@@ -356,7 +356,9 @@ The syntax is the same as `define*-public'."
   (define (no-files-handler)
     (ly:usage)
     (exit 2))
-  
+
+  (if (ly:get-option 'gui)
+      (gui-main files))
 
   (if (null? files)
       (no-files-handler))
@@ -392,29 +394,12 @@ The syntax is the same as `define*-public'."
 
 (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-*-")
@@ -437,7 +422,3 @@ The syntax is the same as `define*-public'."
     (ly:message (_ "Invoking `~a'...") cmd)
     (system cmd)
     (exit 1)))
-
-(or (not (running-from-gui?))
-    (ly:get-option 'safe)
-    (define lilypond-main gui-main))
index 8726c8d59f8231ac148ba1691e2b07e2af2f0186..369e6df4cb0482bf2ec9d9228a6694ca00b48ad7 100644 (file)
@@ -30,12 +30,18 @@ import sys
 ################################################################
 # 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'))
 
 ################################################################