lyp-win 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +83 -65
- data/bin/install_release.sh +1 -1
- data/lib/lyp/cli.rb +7 -6
- data/lib/lyp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a7a4bedc96bd3f827d3d176633d2b60cb3a0999
|
4
|
+
data.tar.gz: b0e77559e40e9c485863a4695774892aa01a2941
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0ff4b631c3c9bbba1221022e9032d5e2a87655fe70a44918a294176415ef7e917b846d06899085010bcf3533480aa05aaae98c8d9d9c1dfb0725554e9a976a3
|
7
|
+
data.tar.gz: 2d07b484694dd7fd1a062c45a33e19ed988dcbff93a0a2d3eee638e9bb421dd8e13a0524131162707361afa276c7669e89b05d57c5d716935d2cee086c8780e0
|
data/README.md
CHANGED
@@ -5,13 +5,13 @@
|
|
5
5
|
<a href="https://github.com/lyp-packages/index#readme">The lyp package index</a>
|
6
6
|
</p>
|
7
7
|
|
8
|
-
# lyp - a package manager for
|
8
|
+
# lyp - a package manager for Lilypond
|
9
9
|
|
10
|
-
Use lyp to install and manage packages for
|
10
|
+
Use lyp to install and manage packages for Lilypond, and install and manage multiple versions of Lilypond on your machine.
|
11
11
|
|
12
|
-
__Code reuse__: lyp lets you install packages that act as
|
12
|
+
__Code reuse__: lyp lets you install packages that act as Lilypond code libraries and can be used to enhance your Lilypond files with additional functionality. Packages can depend on other packages. Lyp resolves both direct and transitive package dependencies, and automatically selects the correct version to use for each package.
|
13
13
|
|
14
|
-
__No hassle Lilypond installation__: With lyp you can also install any version of
|
14
|
+
__No hassle Lilypond installation__: With lyp you can also install any version of Lilypond on your machine with a single command, without having to visit the Lilypond website, clicking a link and then copying files around. In addition, lyp lets you switch between multiple versions of Lilypond and always keep your machine up to date with the latest version.
|
15
15
|
|
16
16
|
## Table of contents
|
17
17
|
|
@@ -23,7 +23,7 @@ __No hassle Lilypond installation__: With lyp you can also install any version o
|
|
23
23
|
- [Uninstalling lyp](#uninstalling-lyp)
|
24
24
|
- [How lyp works](#how-lyp-works)
|
25
25
|
- [Working with packages](#working-with-packages)
|
26
|
-
- [What
|
26
|
+
- [What is a package?](#what-is-a-package)
|
27
27
|
- [Installing packages](#installing-packages)
|
28
28
|
- [Automatic package installation](#automatic-package-installation)
|
29
29
|
- [Package references](#package-references)
|
@@ -38,11 +38,11 @@ __No hassle Lilypond installation__: With lyp you can also install any version o
|
|
38
38
|
- [Testing packages](#testing-packages)
|
39
39
|
- [Publishing packages](#publishing-packages)
|
40
40
|
- [Installing and Using Lilypond](#installing-and-using-lilypond)
|
41
|
-
- [Installing/uninstalling a version of
|
42
|
-
- [Showing the list of installed
|
43
|
-
- [Showing available
|
44
|
-
- [Switching between
|
45
|
-
- [Running
|
41
|
+
- [Installing/uninstalling a version of Lilypond](#installing-uninstalling a version of lilypond)
|
42
|
+
- [Showing the list of installed Lilypond versions](#showing-the-list-of-installed-lilypond-versions)
|
43
|
+
- [Showing available Lilypond versions](#Showing-available-lilypond-versions)
|
44
|
+
- [Switching between Lilypond versions](#switching-between-lilypond-versions)
|
45
|
+
- [Running Lilypond](#running-lilypond)
|
46
46
|
- [Contributing](#contributing)
|
47
47
|
|
48
48
|
## Installation
|
@@ -119,27 +119,29 @@ $ rm -rf ~/.lyp
|
|
119
119
|
|
120
120
|
## How lyp works
|
121
121
|
|
122
|
-
Lyp sets up a working directory in `~/.lyp` where it keeps its binaries, installed packages, and installed versions of
|
122
|
+
Lyp sets up a working directory in `~/.lyp` where it keeps its binaries, installed packages, and installed versions of Lilypond. Lyp provides a wrapper script for Lilypond, which does the following:
|
123
123
|
|
124
|
-
- Select the correct version of
|
125
|
-
- Scan the given
|
124
|
+
- Select the correct version of Lilypond to use (see [below](#installing-and-using-lilypond)).
|
125
|
+
- Scan the given Lilypond file for any dependencies (specified using `\require`), and also recursively scan any include files for dependencies
|
126
126
|
- Resolve the dependency tree and calculate the correct versions to use for each required package.
|
127
|
-
- Create a wrapper
|
128
|
-
- Invoke the selected version of
|
127
|
+
- Create a wrapper Lilypond file that loads the packages.
|
128
|
+
- Invoke the selected version of Lilypond.
|
129
129
|
|
130
|
-
For more information on running
|
130
|
+
For more information on running Lilypond see the section on [Running Lilypond](#running-lilypond).
|
131
131
|
|
132
132
|
## Working with Packages
|
133
133
|
|
134
|
-
A package is a library of
|
134
|
+
A package is a library of Lilypond code, containing one or more Lilypond files, that provide commonly-used functionality for users. A package can be a library of scheme code to extend Lilypond, as in [OpenLilyLib](https://github.com/openlilylib/); or a stylesheet which contains music fonts and additional Lilypond code to change the look of the music: font, spacing, line widths, sizes, etc.
|
135
135
|
|
136
|
-
The difference between merely copying and including a
|
136
|
+
The difference between merely copying and including a Lilypond file in your music, and using a Lilypond package is that you can easily share your music file with anyone and let them compile your music without having to download and copy additional code. lyp takes care of installing and resolving any dependencies in your Lilypond files, so that you can compile your Lilypond files anywhere without schlepping around a bunch of include files. Also, because packages are versioned, repeatable compilation using external code becomes trivial.
|
137
137
|
|
138
|
-
### What
|
138
|
+
### What is a package?
|
139
139
|
|
140
|
-
In lyp, a package should contain at least a single
|
140
|
+
In lyp, a package is a directory that should contain at least a single Lilypond file named `package.ly` in its root directory. A package could contain additional Lilypond and scheme files referenced in the main package file (using relative `\include`s). A package could also depend on other packages by using the `\require` command (see [below](#using-packages)).
|
141
141
|
|
142
|
-
|
142
|
+
Lyp packages are expected to be published as git repositories. The package is then versioned using git tags. A package can be referenced either using its git URL, a registered canonical name (if it's registered in the [lyp package index](https://github.com/lyp-packages/index)), or alternatively as a local path (which is really meant for package development more than anything else).
|
143
|
+
|
144
|
+
Packages can also include test files, examples that demonstrate proper usage, ruby source code for enhancing lyp itself, or alternative font files for creating a custom look for Lilypond scores.
|
143
145
|
|
144
146
|
### Installing packages
|
145
147
|
|
@@ -191,7 +193,7 @@ lyp search stylesheet
|
|
191
193
|
|
192
194
|
### Automatic package installation
|
193
195
|
|
194
|
-
An easier way to install packages is by using the `lyp resolve` command, which installs all packages required for a given input file. Suppose a
|
196
|
+
An easier way to install packages is by using the `lyp resolve` command, which installs all packages required for a given input file. Suppose a Lilypond called `test.ly` with the following content:
|
195
197
|
|
196
198
|
```lilypond
|
197
199
|
\version "2.19.35"
|
@@ -205,7 +207,7 @@ To install the `assert` package required in the file we run:
|
|
205
207
|
|
206
208
|
```bash
|
207
209
|
$ lyp resolve test.ly
|
208
|
-
|
210
|
+
|
209
211
|
Cloning https://github.com/lyp-packages/assert.git...
|
210
212
|
|
211
213
|
Installed assert@0.2.0
|
@@ -215,7 +217,7 @@ Package dependencies for a given input file can be shown using the `lyp deps` co
|
|
215
217
|
|
216
218
|
```bash
|
217
219
|
$ lyp deps test.ly
|
218
|
-
|
220
|
+
|
219
221
|
assert => 0.2.0
|
220
222
|
```
|
221
223
|
|
@@ -261,7 +263,7 @@ Version constraints specify a range of versions to use. Lyp currently supports t
|
|
261
263
|
- Optimistic constraint: `package>=0.1.0`, which means any version equal to or higher than 0.1.0.
|
262
264
|
- Pessimistic constraint: `package~>0.1.0`, which means any version equal or higher than 0.1.0, and lower than 0.2.0. This type of constraint is useful for packages which follow the semantic versioning standard.
|
263
265
|
|
264
|
-
Version specifiers could be used when installing, listing and requiring packages, and also for specifying versions of
|
266
|
+
Version specifiers could be used when installing, listing and requiring packages, and also for specifying versions of Lilypond (see [below](#installing-and-using-lilypond)). For example:
|
265
267
|
|
266
268
|
```bash
|
267
269
|
$ lyp install "dummy~>0.2.0"
|
@@ -269,28 +271,28 @@ $ lyp install "dummy~>0.2.0"
|
|
269
271
|
|
270
272
|
**Note**: when using version constraints you should put the package specifier in quotes for bash properly parse the command.
|
271
273
|
|
272
|
-
###
|
274
|
+
### Using packages
|
273
275
|
|
274
|
-
To include a package in your
|
276
|
+
To include a package in your Lilypond code, use the `\require` command:
|
275
277
|
|
276
278
|
```lilypond
|
277
279
|
\require "dummy"
|
278
280
|
\require "github.com/lulu/mypack>=0.4.0"
|
279
281
|
```
|
280
282
|
|
281
|
-
**Note**: once you use `\require` in your code, you will have to compile it using the
|
283
|
+
**Note**: once you use `\require` in your code, you will have to compile it using the Lilypond wrapper provided by lyp. It will not pass compilation using plain Lilypond.
|
282
284
|
|
283
285
|
Once the package requirements are defined, you can either install packages manually using [`lyp install`](#installing-packages), or automatically using [`lyp resolve`](#automatic-package-installation) as described above.
|
284
286
|
|
285
287
|
## Developing packages
|
286
288
|
|
287
|
-
To create a
|
289
|
+
To create a Lilypond package:
|
288
290
|
|
289
291
|
- Create a git repository.
|
290
292
|
- Add a `package.ly` file, which is the main entry point for your package.
|
291
|
-
- Optionally add additional
|
292
|
-
- Test & debug your code (see below).
|
293
|
-
- Publish your package (see below).
|
293
|
+
- Optionally add additional Lilypond files or package dependencies.
|
294
|
+
- Test & debug your code (see [below](#testing-packages)).
|
295
|
+
- Publish your package (see [below](#publishing-packages)).
|
294
296
|
|
295
297
|
To test your package with an actual input file, you can install it from a local path (for more on testing see [below](#testing-packages)). Suppose your package is at ~/repo/mypack:
|
296
298
|
|
@@ -346,13 +348,13 @@ Files can also be included conditionally by evaluating a scheme expression using
|
|
346
348
|
|
347
349
|
### Scheme interface
|
348
350
|
|
349
|
-
Lyp provides to loaded packages a small API to facilitate handling relative paths and loading of
|
351
|
+
Lyp provides to loaded packages a small API to facilitate handling relative paths and loading of Lilypond include files and scheme files. The API is documented on the [lyp wiki](https://github.com/noteflakes/lyp/wiki/Package-Scheme-Interface).
|
350
352
|
|
351
353
|
### Including fonts
|
352
354
|
|
353
|
-
Lyp also supports automatic installation of fonts, based on work by [Abraham Lee](https://github.com/tisimst). When a package is installed, lyp will copy any font files residing in the `fonts` directory into the corresponding `otf` and `svg` directories of all installed versions of
|
355
|
+
Lyp also supports automatic installation of fonts, based on work by [Abraham Lee](https://github.com/tisimst). When a package is installed, lyp will copy any font files residing in the `fonts` directory into the corresponding `otf` and `svg` directories of all installed versions of Lilypond.
|
354
356
|
|
355
|
-
**Note**: fonts will be only installed in versions of
|
357
|
+
**Note**: fonts will be only installed in versions of Lilypond starting from than 2.18.2. Lyp automatically patches any version newer than 2.19.12 in order to support custom fonts.
|
356
358
|
|
357
359
|
### Extending lyp
|
358
360
|
|
@@ -387,9 +389,9 @@ $ cd mypack
|
|
387
389
|
$ lyp test .
|
388
390
|
```
|
389
391
|
|
390
|
-
A test file can either be a simple
|
392
|
+
A test file can either be a simple Lilypond file which includes the package files and results in a Lilypond score, or a Lilypond file that performs unit tests on scheme code.
|
391
393
|
|
392
|
-
For more information on testing, see the [lyp-assert](https://github.com/lyp-packages/assert) package, which is meant to be used for unit testing
|
394
|
+
For more information on testing, see the [lyp-assert](https://github.com/lyp-packages/assert) package, which is meant to be used for unit testing Lilypond code, and serves as an example of how to test a package.
|
393
395
|
|
394
396
|
### Publishing packages
|
395
397
|
|
@@ -399,9 +401,9 @@ You can also add your package to the lyp [public package index](https://github.c
|
|
399
401
|
|
400
402
|
## Installing and Using Lilypond
|
401
403
|
|
402
|
-
### Installing/uninstalling a version of
|
404
|
+
### Installing/uninstalling a version of Lilypond
|
403
405
|
|
404
|
-
When installing
|
406
|
+
When installing Lilypond, the specific version to download can be specified in different ways:
|
405
407
|
|
406
408
|
```bash
|
407
409
|
# latest stable version
|
@@ -426,15 +428,15 @@ $ lyp install "lilypond>=2.19.27"
|
|
426
428
|
$ lyp install "lilypond~>2.18.1"
|
427
429
|
```
|
428
430
|
|
429
|
-
To uninstall a version
|
431
|
+
To uninstall a version Lilypond use `lyp uninstall`
|
430
432
|
|
431
433
|
```bash
|
432
434
|
$ lyp uninstall lilypond@2.18.2
|
433
435
|
```
|
434
436
|
|
435
|
-
### Showing the list of installed
|
437
|
+
### Showing the list of installed Lilypond versions
|
436
438
|
|
437
|
-
To display all installed versions of
|
439
|
+
To display all installed versions of Lilypond, use the `list` command:
|
438
440
|
|
439
441
|
```bash
|
440
442
|
$ lyp list lilypond
|
@@ -454,16 +456,16 @@ Lilypond versions:
|
|
454
456
|
# * - default
|
455
457
|
```
|
456
458
|
|
457
|
-
(For current, default settings see below)
|
459
|
+
(For current, default settings see [below](#switching-between-lilypond-versions))
|
458
460
|
|
459
|
-
This will also list any versions of
|
461
|
+
This will also list any versions of Lilypond found on the user's `$PATH` outside of the `~/.lyp` directory (these versions will be marked as 'system' versions).
|
460
462
|
|
461
|
-
### Showing available
|
463
|
+
### Showing available Lilypond versions
|
462
464
|
|
463
|
-
You can also list available versions of
|
465
|
+
You can also list available versions of Lilypond by using the `search` command:
|
464
466
|
|
465
467
|
```bash
|
466
|
-
# display all available versions of
|
468
|
+
# display all available versions of Lilypond
|
467
469
|
$ lyp search lilypond
|
468
470
|
|
469
471
|
# display all available versions higher than 2.19
|
@@ -495,7 +497,7 @@ Available versions of lilypond@stable:
|
|
495
497
|
* Currently installed
|
496
498
|
```
|
497
499
|
|
498
|
-
### Switching between
|
500
|
+
### Switching between Lilypond versions
|
499
501
|
|
500
502
|
To switch between versions use the `lyp use`. The same version specifiers could be used as for the `lyp install` command:
|
501
503
|
|
@@ -507,37 +509,30 @@ $ lyp use stable
|
|
507
509
|
$ lyp use unstable
|
508
510
|
```
|
509
511
|
|
510
|
-
**Note**: The setting of the current
|
512
|
+
**Note**: The setting of the current Lilypond version to use will be maintained for the current shell session.
|
511
513
|
|
512
|
-
In order to switch the default version of
|
514
|
+
In order to switch the default version of Lilypond to use, add the `--default` switch:
|
513
515
|
|
514
516
|
```bash
|
515
517
|
$ lyp use --default 2.19.35
|
516
518
|
```
|
517
519
|
|
518
|
-
The version used can be further controlled using the `--use` and `--env` options passed to `lilypond` (see below).
|
520
|
+
The version used can be further controlled using the `--use` and `--env` options passed to `lilypond` (see [below](#running-lilypond)).
|
519
521
|
|
520
522
|
As discussed [above](#showing-the-list-of-installed-lilypond-versions), the `lyp list lilypond` command displays the current and default settings. You can also display the path to the currently selected version by running `lyp which lilypond`:
|
521
523
|
|
522
524
|
```bash
|
523
525
|
$ lyp which lilypond
|
524
|
-
|
526
|
+
/Users/sharon/.lyp/lilyponds/2.18.2/bin/lilypond
|
525
527
|
```
|
526
528
|
|
527
|
-
### Running
|
529
|
+
### Running Lilypond
|
528
530
|
|
529
|
-
Once one or more versions of
|
531
|
+
Once one or more versions of Lilypond are installed, the Lilypond command may be used normally to compile Lilypond files. Lyp adds a few extra options:
|
530
532
|
|
531
|
-
- `--
|
532
|
-
|
533
|
-
```bash
|
534
|
-
$ lilypond --use=2.19.12 ...
|
533
|
+
- `--auto-install-deps`, `-A` - automatically install any missing dependencies.
|
535
534
|
|
536
|
-
|
537
|
-
$ lilypond --use=">=2.19.12" ...
|
538
|
-
$ lilypond --use=stable ...
|
539
|
-
$ lilypond --use=latest ...
|
540
|
-
```
|
535
|
+
- `--cropped`, `-c` - produce a cropped score (requires setting margins to 0).
|
541
536
|
|
542
537
|
- `--env`, `-E` - use a version set by the `$LILYPOND_VERSION` environment variable:
|
543
538
|
|
@@ -545,18 +540,41 @@ Once one or more versions of lilypond are installed, the lilypond command may be
|
|
545
540
|
$ LILYPOND_VERSION=2.18.2 lilypond --env ...
|
546
541
|
```
|
547
542
|
|
548
|
-
- `--
|
543
|
+
- `--force-version`, `-F` - use the Lilypond version specified in the user file.
|
544
|
+
|
545
|
+
- `--install`, `-n` - install the specified version of Lilypond if not present. This option works only in conjunction with `--env` or `--use`:
|
549
546
|
|
550
547
|
```bash
|
551
548
|
$ lilypond -u2.19.35 -n ...
|
552
549
|
```
|
553
550
|
|
554
|
-
- `--
|
551
|
+
- `--open`, `-O` - open target file after compilation.
|
552
|
+
|
553
|
+
- `--raw`, `-R` - do not pre-process input file (no scanning for dependencies, no wrapping).
|
555
554
|
|
556
555
|
```bash
|
557
556
|
$ lilypond --raw ...
|
558
557
|
```
|
559
558
|
|
559
|
+
- `--require`, `--r` - require a package:
|
560
|
+
|
561
|
+
```bash
|
562
|
+
$ lilypond -rassert mytest.ly
|
563
|
+
```
|
564
|
+
|
565
|
+
- `--snippet`, `-S` - produce a cropped PNG image at 600dpi
|
566
|
+
|
567
|
+
- `--use`, `-u` - use a specific version of Lilypond:
|
568
|
+
|
569
|
+
```bash
|
570
|
+
$ lilypond --use=2.19.12 myfile.ly
|
571
|
+
|
572
|
+
# version constraints can also be used:
|
573
|
+
$ lilypond --use=">=2.19.12" myfile.ly
|
574
|
+
$ lilypond --ustable myfile.ly
|
575
|
+
$ lilypond --ulatest myfile.ly
|
576
|
+
```
|
577
|
+
|
560
578
|
## Contributing
|
561
579
|
|
562
580
|
Lyp is written in Ruby, and its code is [available on github](https://github.com/noteflakes/lyp). To hack on it, simply clone the repository. To run the specs:
|
data/bin/install_release.sh
CHANGED
data/lib/lyp/cli.rb
CHANGED
@@ -123,20 +123,21 @@ class Lyp::CLI < Thor
|
|
123
123
|
method_option :use, aliases: '-u', type: :string, desc: 'Use specified version'
|
124
124
|
def test(*args)
|
125
125
|
$cmd_options = options
|
126
|
+
test_opts = options.dup
|
126
127
|
|
127
|
-
if
|
128
|
+
if test_opts[:env]
|
128
129
|
unless ENV['LILYPOND_VERSION']
|
129
130
|
STDERR.puts "$LILYPOND_VERSION not set"
|
130
131
|
exit 1
|
131
132
|
end
|
132
|
-
|
133
|
+
test_opts[:use] = ENV['LILYPOND_VERSION']
|
133
134
|
end
|
134
135
|
|
135
|
-
if
|
136
|
-
if
|
137
|
-
Lyp::Lilypond.install_if_missing(
|
136
|
+
if test_opts[:use]
|
137
|
+
if test_opts[:install]
|
138
|
+
Lyp::Lilypond.install_if_missing(test_opts[:use], no_version_test: true)
|
138
139
|
end
|
139
|
-
Lyp::Lilypond.force_version!(
|
140
|
+
Lyp::Lilypond.force_version!(test_opts[:use])
|
140
141
|
end
|
141
142
|
|
142
143
|
# check lilypond default / current settings
|
data/lib/lyp/version.rb
CHANGED