lyp-win 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +35 -19
- data/bin/install_release.sh +1 -1
- data/lib/lyp.rb +11 -38
- data/lib/lyp/base.rb +5 -0
- data/lib/lyp/lilypond.rb +4 -4
- data/lib/lyp/package.rb +1 -1
- data/lib/lyp/system.rb +31 -1
- data/lib/lyp/templates/deps_wrapper.rb +1 -1
- data/lib/lyp/version.rb +1 -1
- data/lib/lyp/wrapper.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e98a618ed6bc2fd2168aa288e5ab0f0228b04de9
|
4
|
+
data.tar.gz: ce18add67cbbe485000918a16f97ab843d3aa46c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9b35eb5a49c493c8b198b1f1bcf202dd037b1ef4ae0c41c10d8d61bb7c1bb911b7a737e50211bdcdac034251360b4bfc5252b2c8e5ec38cf086d0de156b249d
|
7
|
+
data.tar.gz: 5a490c2c2234b969f38a55206560a2c6283ca31070e03b8dbf052efa3f6603ecfefe30772b61d7105d278bf8022ac8cdc9957e914440429b7deda7dfd9ac7781
|
data/README.md
CHANGED
@@ -11,8 +11,11 @@ __No hassle Lilypond installation__: With lyp you can also install any version o
|
|
11
11
|
## Table of contents
|
12
12
|
|
13
13
|
- [Installation](#installation)
|
14
|
-
- [
|
15
|
-
- [
|
14
|
+
- [System requirements](#system-requirements)
|
15
|
+
- [Installing lyp as a Ruby gem](#installing-lyp-as-a-ruby-gem)
|
16
|
+
- [Installing lyp as a standalone release](#installing-lyp-as-a-standalone-release)
|
17
|
+
- [Uninstalling lyp](#uninstalling-lyp)
|
18
|
+
- [How lyp works](#how-lyp-works)
|
16
19
|
- [Working with packages](#working-with-packages)
|
17
20
|
- [What constitutes a package?](#what-constitutes-a-package)
|
18
21
|
- [Installing packages](#installing-packages)
|
@@ -36,20 +39,33 @@ __No hassle Lilypond installation__: With lyp you can also install any version o
|
|
36
39
|
|
37
40
|
## Installation
|
38
41
|
|
39
|
-
|
42
|
+
### System requirements
|
40
43
|
|
41
|
-
|
44
|
+
Lyp is tested to work on Linux, Mac OSX and Windows 7+.
|
42
45
|
|
43
|
-
|
46
|
+
**Note**: Windows users will currently need to install lyp as a Ruby gem, and will also need to have git installed in order to be able to install packages.
|
47
|
+
|
48
|
+
### Installing lyp as a Ruby gem
|
49
|
+
|
50
|
+
If you have a recent (>=1.9.3) version of Ruby on your machine, you can install lyp as a gem.
|
44
51
|
|
45
52
|
```bash
|
53
|
+
# Linux/OSX only
|
46
54
|
$ gem install lyp
|
47
55
|
$ lyp install self
|
48
56
|
```
|
49
57
|
|
50
58
|
The `lyp install self` command is needed in order to setup the `~/.lyp` working directory and add the lyp binaries directory to your `PATH` (see below), by adding a line of code to your shell profile file.
|
51
59
|
|
52
|
-
|
60
|
+
Windows users should install the lyp-win gem:
|
61
|
+
|
62
|
+
```bash
|
63
|
+
> gem install lyp-win
|
64
|
+
```
|
65
|
+
|
66
|
+
On Windows, there's no need to run the `lyp install self` command.
|
67
|
+
|
68
|
+
### Installing lyp as a standalone release
|
53
69
|
|
54
70
|
If you don't have Ruby on your machine you can install lyp as a stand alone package using the install script ([view source](https://git.io/getlyp)):
|
55
71
|
|
@@ -76,19 +92,7 @@ https://github.com/noteflakes/lyp/releases/download/v0.2.1/lyp-0.2.1-linux-x86_6
|
|
76
92
|
|
77
93
|
**Note**: using the standalone release of lyp requires having git on your machine.
|
78
94
|
|
79
|
-
###
|
80
|
-
|
81
|
-
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:
|
82
|
-
|
83
|
-
- Select the correct version of lilypond to use (see below).
|
84
|
-
- Scan the given lilypond file for any dependencies (specified using `\require`), and also recursively scan any include files for dependencies
|
85
|
-
- Resolve the dependency tree and calculate the correct versions to use for each required package.
|
86
|
-
- Create a wrapper lilypond file that loads the packages.
|
87
|
-
- Invoke the selected version of lilypond.
|
88
|
-
|
89
|
-
For more information on running lilypond see the section on [Running lilypond](#running-lilypond).
|
90
|
-
|
91
|
-
### Uninstalling
|
95
|
+
### Uninstalling lyp
|
92
96
|
|
93
97
|
In order to remove lyp from your system use the `uninstall self` command:
|
94
98
|
|
@@ -104,6 +108,18 @@ In order to completely remove all files in `~/.lyp` you can simply delete the di
|
|
104
108
|
$ rm -rf ~/.lyp
|
105
109
|
```
|
106
110
|
|
111
|
+
## How lyp works
|
112
|
+
|
113
|
+
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:
|
114
|
+
|
115
|
+
- Select the correct version of lilypond to use (see below).
|
116
|
+
- Scan the given lilypond file for any dependencies (specified using `\require`), and also recursively scan any include files for dependencies
|
117
|
+
- Resolve the dependency tree and calculate the correct versions to use for each required package.
|
118
|
+
- Create a wrapper lilypond file that loads the packages.
|
119
|
+
- Invoke the selected version of lilypond.
|
120
|
+
|
121
|
+
For more information on running lilypond see the section on [Running lilypond](#running-lilypond).
|
122
|
+
|
107
123
|
## Working with Packages
|
108
124
|
|
109
125
|
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; or a stylesheet which contains music fonts and additional lilypond code to change the look of the music: font, spacing, line widths, sizes, etc.
|
data/bin/install_release.sh
CHANGED
data/lib/lyp.rb
CHANGED
@@ -1,42 +1,15 @@
|
|
1
|
-
|
1
|
+
def req(f); require File.expand_path("lyp/#{f}", File.dirname(__FILE__)); end
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
require 'rugged'
|
7
|
-
rescue Exception
|
8
|
-
nil
|
9
|
-
end
|
3
|
+
req 'base'
|
4
|
+
req 'system'
|
5
|
+
req 'settings'
|
10
6
|
|
11
|
-
|
7
|
+
Lyp::System.test_rugged_gem!
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
req 'template'
|
10
|
+
req 'resolver'
|
11
|
+
req 'wrapper'
|
12
|
+
req 'package'
|
13
|
+
req 'lilypond'
|
16
14
|
|
17
|
-
|
18
|
-
require 'lyp/git_based_rugged'
|
19
|
-
end
|
20
|
-
|
21
|
-
require 'tmpdir'
|
22
|
-
require 'fileutils'
|
23
|
-
$TMP_DIR = $WINDOWS ? "#{Dir.home}/AppData/Local/Temp" : "/tmp"
|
24
|
-
$TMP_ROOT = "#{$TMP_DIR}/lyp"
|
25
|
-
FileUtils.mkdir_p($TMP_ROOT)
|
26
|
-
|
27
|
-
%w{
|
28
|
-
base
|
29
|
-
system
|
30
|
-
settings
|
31
|
-
|
32
|
-
template
|
33
|
-
resolver
|
34
|
-
wrapper
|
35
|
-
|
36
|
-
package
|
37
|
-
lilypond
|
38
|
-
}.each do |f|
|
39
|
-
require File.expand_path("lyp/#{f}", File.dirname(__FILE__))
|
40
|
-
end
|
41
|
-
|
42
|
-
require File.expand_path("lyp/windows", File.dirname(__FILE__)) if $WINDOWS
|
15
|
+
req 'windows' if Lyp::WINDOWS
|
data/lib/lyp/base.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
|
3
3
|
module Lyp
|
4
|
+
WINDOWS = Gem.win_platform?
|
5
|
+
TMP_DIR = WINDOWS ? "#{Dir.home}/AppData/Local/Temp" : "/tmp"
|
6
|
+
TMP_ROOT = "#{TMP_DIR}/lyp"
|
7
|
+
FileUtils.mkdir_p(TMP_ROOT)
|
8
|
+
|
4
9
|
# A package specifier is of the form <package>@<version specifier>, where
|
5
10
|
# the version specifier can be simply a version number, or include an operator
|
6
11
|
# before the version number.
|
data/lib/lyp/lilypond.rb
CHANGED
@@ -110,7 +110,7 @@ module Lyp::Lilypond
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def session_settings_filename
|
113
|
-
"#{
|
113
|
+
"#{Lyp::TMP_ROOT}/session.#{Process.getsid}.yml"
|
114
114
|
end
|
115
115
|
|
116
116
|
CMP_VERSION = proc do |x, y|
|
@@ -336,7 +336,7 @@ module Lyp::Lilypond
|
|
336
336
|
|
337
337
|
def temp_install_filename(url)
|
338
338
|
u = URI(url)
|
339
|
-
"#{
|
339
|
+
"#{Lyp::TMP_ROOT}/#{File.basename(u.path)}"
|
340
340
|
end
|
341
341
|
|
342
342
|
def download_lilypond(url, fn, opts)
|
@@ -365,7 +365,7 @@ module Lyp::Lilypond
|
|
365
365
|
end
|
366
366
|
|
367
367
|
def install_lilypond_files(fn, platform, version, opts)
|
368
|
-
tmp_target = "#{
|
368
|
+
tmp_target = "#{Lyp::TMP_ROOT}/lilypond-#{version}"
|
369
369
|
FileUtils.mkdir_p(tmp_target)
|
370
370
|
|
371
371
|
case platform
|
@@ -394,7 +394,7 @@ module Lyp::Lilypond
|
|
394
394
|
STDERR.puts "Extracting..." unless opts[:silent]
|
395
395
|
|
396
396
|
# create temp directory in which to extract .sh file
|
397
|
-
tmp_dir = "#{
|
397
|
+
tmp_dir = "#{Lyp::TMP_ROOT}/#{Time.now.to_f}"
|
398
398
|
FileUtils.mkdir_p(tmp_dir)
|
399
399
|
|
400
400
|
FileUtils.cd(tmp_dir) do
|
data/lib/lyp/package.rb
CHANGED
data/lib/lyp/system.rb
CHANGED
@@ -2,6 +2,36 @@ require 'fileutils'
|
|
2
2
|
|
3
3
|
module Lyp::System
|
4
4
|
class << self
|
5
|
+
RUGGED_REQ = Gem::Requirement.new('>=0.23.0')
|
6
|
+
|
7
|
+
def test_rugged_gem!
|
8
|
+
return if find_rugged_gem || use_git_based_rugged_gem
|
9
|
+
|
10
|
+
STDERR.puts "Lyp needs git in order to be able to install packages. Please install git and then try again."
|
11
|
+
exit 1
|
12
|
+
end
|
13
|
+
|
14
|
+
def find_rugged_gem
|
15
|
+
found = Gem::Specification.find_all_by_name('rugged').find do |s|
|
16
|
+
RUGGED_REQ =~ s.version
|
17
|
+
end
|
18
|
+
|
19
|
+
require_rugged_gem if found
|
20
|
+
found
|
21
|
+
end
|
22
|
+
|
23
|
+
def require_rugged_gem
|
24
|
+
gem 'rugged', RUGGED_REQ.to_s
|
25
|
+
require 'rugged'
|
26
|
+
end
|
27
|
+
|
28
|
+
def use_git_based_rugged_gem
|
29
|
+
git_available = `git --version` rescue nil
|
30
|
+
return false unless git_available
|
31
|
+
|
32
|
+
require File.expand_path('git_based_rugged', File.dirname(__FILE__))
|
33
|
+
end
|
34
|
+
|
5
35
|
INSTALL_MSG = <<EOF
|
6
36
|
|
7
37
|
Warning! Lyp is not yet properly installed in your home directory.
|
@@ -17,7 +47,7 @@ EOF
|
|
17
47
|
|
18
48
|
def test_installed_status!
|
19
49
|
unless installed?
|
20
|
-
puts INSTALL_MSG
|
50
|
+
STDERR.puts INSTALL_MSG
|
21
51
|
end
|
22
52
|
end
|
23
53
|
|
data/lib/lyp/version.rb
CHANGED
data/lib/lyp/wrapper.rb
CHANGED
@@ -12,8 +12,8 @@ module Lyp
|
|
12
12
|
r[:current_package_dir] = opts[:current_package_dir]
|
13
13
|
|
14
14
|
if !r[:package_dirs].empty? || opts[:force_wrap]
|
15
|
-
FileUtils.mkdir_p("#{
|
16
|
-
fn = "#{
|
15
|
+
FileUtils.mkdir_p("#{Lyp::TMP_ROOT}/wrappers")
|
16
|
+
fn = "#{Lyp::TMP_ROOT}/wrappers/#{File.basename(fn)}"
|
17
17
|
|
18
18
|
File.open(fn, 'w+') {|f| f << WRAPPER_TEMPLATE.render(r)}
|
19
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lyp-win
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|