-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathpackage.ily
67 lines (63 loc) · 3.82 KB
/
package.ily
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% This file is part of openLilyLib, %
% =========== %
% the community library project for GNU LilyPond %
% (https://github.com/openlilylib) %
% ----------- %
% %
% Library: oll-core %
% ======== %
% %
% openLilyLib is free software: you can redistribute it and/or modify %
% it under the terms of the GNU General Public License as published by %
% the Free Software Foundation, either version 3 of the License, or %
% (at your option) any later version. %
% %
% openLilyLib is distributed in the hope that it will be useful, %
% but WITHOUT ANY WARRANTY; without even the implied warranty of %
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %
% GNU General Public License for more details. %
% %
% You should have received a copy of the GNU General Public License %
% along with openLilyLib. If not, see <http://www.gnu.org/licenses/>. %
% %
% openLilyLib is maintained by Urs Liska, [email protected] %
% and others. %
% Copyright Urs Liska, 2016 %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is the main entry file for openLilyLib.
% To use openLilyLib this file has to be in LilyPond's include path.
% including this file with
% \include "openlilylib.ily"
% will initialize openLilyLib and make the library management available
% as well as significant utility functionality.
%
% This does several things:
% - defines a global variable 'openlilylib-root
% which is the absolute path to the root of openLilyLib
% (the parent of the folder this file is located in)
% - adds openlilylib-root to Scheme's module path
% - adds library/module handling support
% - adds option handling
% - adds logging tools
% - adds miscellaneous helper functionality (e.g. version predicates)
% We won't support 2.18 anymore as there are simply too many
% substantial improvements in the 2.19 branch starting from 2.19.22.
\version "2.24.0"
#(ly:set-option 'relative-includes #t)
% Initialize oll-core *once*
#(if (null? (ly:parser-lookup 'openlilylib-root))
(let*
((this (car (ly:input-file-line-char-column (*location*))))
(path (string-split this #\/))
(oll-root (list-head path (- (length path) 2)))
(scheme-path (append oll-root '("oll-core" "scheme")))
)
;; Add openLilyLib root to Guile path
;; (enable packages to load Scheme modules through <package-name>)
(set! %load-path `(,(string-join oll-root "/") ,@%load-path))
;; store root path as a marker that oll-core has been loaded
(ly:parser-define! 'openlilylib-root oll-root)
(ly:parser-include-string "\\include \"oll-core/internal/init.ily\"")))