mini_portile2 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +4 -0
- data.tar.gz.sig +2 -0
- data/.gitignore +3 -0
- data/.travis.yml +11 -0
- data/CHANGELOG.md +169 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +20 -0
- data/README.md +188 -0
- data/Rakefile +25 -0
- data/appveyor.yml +24 -0
- data/examples/.gitignore +2 -0
- data/examples/Rakefile +127 -0
- data/examples/libiconv-patches/1-avoid-gets-error.patch +16 -0
- data/lib/mini_portile2.rb +2 -0
- data/lib/mini_portile2/mini_portile.rb +495 -0
- data/lib/mini_portile2/version.rb +3 -0
- data/mini_portile2.gemspec +30 -0
- data/test/assets/patch 1.diff +7 -0
- data/test/assets/test mini portile-1.0.0/configure +11 -0
- data/test/helper.rb +49 -0
- data/test/test_cook.rb +68 -0
- data/test/test_digest.rb +72 -0
- data/test/test_proxy.rb +121 -0
- metadata +154 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ffdb112c00549882ba376a5021ec0831ab979917
|
4
|
+
data.tar.gz: c83b40eaf3df06487450f3c87f83dee8597d5cf5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 714e9705d3d7b41fe128a11ee130d20173d26b764ecd32d93f93fd415aa93f8c99ada4396580e006065bb9c5b399ea70a56c8ea7899f59f2ee12e87a1b15602f
|
7
|
+
data.tar.gz: 662ab91d245f4c116c2aca2879607eb64bc5b64c491bf0a9730bad5fd053297874dc2ab97fcfc0c1a038f7562d24faae145d0d81423cb135bf12ad8e5fc285ac
|
checksums.yaml.gz.sig
ADDED
data.tar.gz.sig
ADDED
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,169 @@
|
|
1
|
+
### 2.0.0.rc1 / unreleased
|
2
|
+
|
3
|
+
Many thanks to @larskanis, @knu, and @kirikak2, who all contributed
|
4
|
+
code, ideas, or both to this release.
|
5
|
+
|
6
|
+
Note that the 0.7.0.rc* series was not released as 0.7.0 final, and
|
7
|
+
instead became 2.0.0 due to backwards-incompatible behavioral changes
|
8
|
+
which can appear because rubygems doesn't enforce loading the declared
|
9
|
+
dependency version at installation-time (only run-time).
|
10
|
+
|
11
|
+
If you use MiniPortile in an `extconf.rb` file, please make sure you're
|
12
|
+
setting a gem version constraint before `require "mini_portile2"` .
|
13
|
+
|
14
|
+
Note also that 2.0.0 doesn't include the backwards-compatible "escaped
|
15
|
+
string" behavior from 0.7.0.rc3.
|
16
|
+
|
17
|
+
|
18
|
+
#### Enhancements
|
19
|
+
|
20
|
+
* In patch task, use git(1) or patch(1), whichever is available.
|
21
|
+
* Append outputs to patch.log instead of clobbering it for every patch command.
|
22
|
+
* Take `configure_options` literally without running a subshell.
|
23
|
+
This changes allows for embedded spaces in a path, among other things.
|
24
|
+
Please unescape `configure_options` where you have been doing it yourself.
|
25
|
+
* Print last 20 lines of the given log file, for convenience.
|
26
|
+
* Allow SHA1, SHA256 and MD5 hash verification of downloads
|
27
|
+
|
28
|
+
|
29
|
+
#### Bugfixes
|
30
|
+
|
31
|
+
* Fix issue when proxy username/password use escaped characters.
|
32
|
+
* Fix use of https and ftp proxy.
|
33
|
+
|
34
|
+
|
35
|
+
### 0.7.0.rc4 / 2015-08-24
|
36
|
+
|
37
|
+
* Updated tests for Windows. No functional change. Final release candidate?
|
38
|
+
|
39
|
+
|
40
|
+
### 0.7.0.rc3 / 2015-08-24
|
41
|
+
|
42
|
+
* Restore backwards-compatible behavior with respect to escaped strings.
|
43
|
+
|
44
|
+
|
45
|
+
### 0.7.0.rc2 / 2015-08-24
|
46
|
+
|
47
|
+
* Restore support for Ruby 1.9.2
|
48
|
+
* Add Ruby 2.0.0 and Ruby 2.1.x to Appveyor suite
|
49
|
+
|
50
|
+
|
51
|
+
### 0.7.0.rc1 / 2015-08-24
|
52
|
+
|
53
|
+
Many thanks to @larskanis, @knu, and @kirikak2, who all contributed
|
54
|
+
code, ideas, or both to this release.
|
55
|
+
|
56
|
+
#### Enhancements
|
57
|
+
|
58
|
+
* In patch task, use git(1) or patch(1), whichever is available.
|
59
|
+
* Append outputs to patch.log instead of clobbering it for every patch command.
|
60
|
+
* Take `configure_options` literally without running a subshell.
|
61
|
+
This changes allows for embedded spaces in a path, among other things.
|
62
|
+
Please unescape `configure_options` where you have been doing it yourself.
|
63
|
+
* Print last 20 lines of the given log file, for convenience.
|
64
|
+
* Allow SHA1, SHA256 and MD5 hash verification of downloads
|
65
|
+
|
66
|
+
|
67
|
+
#### Bugfixes
|
68
|
+
|
69
|
+
* Fix issue when proxy username/password use escaped characters.
|
70
|
+
* Fix use of https and ftp proxy.
|
71
|
+
|
72
|
+
|
73
|
+
### 0.6.2 / 2014-12-30
|
74
|
+
|
75
|
+
* Updated gemspec, license and README to reflect new maintainer.
|
76
|
+
|
77
|
+
|
78
|
+
### 0.6.1 / 2014-08-03
|
79
|
+
|
80
|
+
* Enhancements:
|
81
|
+
* Expand path to logfile to easier debugging on failures.
|
82
|
+
Pull #33 [marvin2k]
|
83
|
+
|
84
|
+
### 0.6.0 / 2014-04-18
|
85
|
+
|
86
|
+
* Enhancements:
|
87
|
+
* Add default cert store and custom certs from `SSL_CERT_FILE` if present.
|
88
|
+
This increases compatibility with Ruby 1.8.7.
|
89
|
+
|
90
|
+
* Bugfixes:
|
91
|
+
* Specify Accept-Encoding to make sure a raw file content is downloaded.
|
92
|
+
Pull #30. [knu]
|
93
|
+
|
94
|
+
* Internal:
|
95
|
+
* Improve examples and use them as test harness.
|
96
|
+
|
97
|
+
### 0.5.3 / 2014-03-24
|
98
|
+
|
99
|
+
* Bugfixes:
|
100
|
+
* Shell escape paths in tar command. Pull #29. [quickshiftin]
|
101
|
+
* Support older versions of tar that cannot auto-detect
|
102
|
+
the compression type. Pull #27. Closes #21. [b-dean]
|
103
|
+
* Try RbConfig's CC before fall back to 'gcc'. Ref #28.
|
104
|
+
|
105
|
+
### 0.5.2 / 2013-10-23
|
106
|
+
|
107
|
+
* Bugfixes:
|
108
|
+
* Change tar detection order to support NetBSD 'gtar'. Closes #24
|
109
|
+
* Trick 'git-apply' when applying patches on nested Git checkouts. [larskanis]
|
110
|
+
* Respect ENV's MAKE before fallback to 'make'. [larskanis]
|
111
|
+
* Respect ENV's CC variable before fallback to 'gcc'.
|
112
|
+
* Avoid non-ASCII output of GCC cause host detection issues. Closes #22
|
113
|
+
|
114
|
+
### 0.5.1 / 2013-07-07
|
115
|
+
|
116
|
+
* Bugfixes:
|
117
|
+
* Detect tar executable without shelling out. [jtimberman]
|
118
|
+
|
119
|
+
### 0.5.0 / 2012-11-17
|
120
|
+
|
121
|
+
* Enhancements:
|
122
|
+
* Allow patching extracted files using `git apply`. [metaskills]
|
123
|
+
|
124
|
+
### 0.4.1 / 2012-10-24
|
125
|
+
|
126
|
+
* Bugfixes:
|
127
|
+
* Syntax to process FTp binary chunks differs between Ruby 1.8.7 and 1.9.x
|
128
|
+
|
129
|
+
### 0.4.0 / 2012-10-24
|
130
|
+
|
131
|
+
* Enhancements:
|
132
|
+
* Allow fetching of FTP URLs along HTTP ones. [metaskills]
|
133
|
+
|
134
|
+
### 0.3.0 / 2012-03-23
|
135
|
+
|
136
|
+
* Enhancements:
|
137
|
+
* Use `gcc -v` to determine original host (platform) instead of Ruby one.
|
138
|
+
|
139
|
+
* Deprecations:
|
140
|
+
* Dropped support for Rubies older than 1.8.7
|
141
|
+
|
142
|
+
### 0.2.2 / 2011-04-11
|
143
|
+
|
144
|
+
* Minor enhancements:
|
145
|
+
* Use LDFLAGS when activating recipes for cross-compilation. Closes #6
|
146
|
+
|
147
|
+
* Bugfixes:
|
148
|
+
* Remove memoization of *_path helpers. Closes #7
|
149
|
+
|
150
|
+
### 0.2.1 / 2011-04-06
|
151
|
+
|
152
|
+
* Minor enhancements:
|
153
|
+
* Provide MiniPortile#path to obtain full path to installation directory. Closes GH-5
|
154
|
+
|
155
|
+
### 0.2.0 / 2011-04-05
|
156
|
+
|
157
|
+
* Enhancements:
|
158
|
+
* Improve tar detection
|
159
|
+
* Improve and refactor configure_options
|
160
|
+
* Detect configure_options changes. Closes GH-1
|
161
|
+
* Add recipe examples
|
162
|
+
|
163
|
+
* Bugfixes:
|
164
|
+
* MiniPortile#target can be changed now. Closes GH-2
|
165
|
+
* Always redirect tar output properly
|
166
|
+
|
167
|
+
### 0.1.0 / 2011-03-08
|
168
|
+
|
169
|
+
* Initial release. Welcome to this world!
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011-2015 Luis Lavena and Mike Dalessio
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
# MiniPortile
|
2
|
+
|
3
|
+
[![travis status](https://travis-ci.org/flavorjones/mini_portile.svg?branch=master)](https://travis-ci.org/flavorjones/mini_portile?branch=master)
|
4
|
+
[![appveyor status](https://ci.appveyor.com/api/projects/status/509669xx1qlhqqab/branch/master?svg=true)](https://ci.appveyor.com/project/flavorjones/mini-portile/branch/master)
|
5
|
+
|
6
|
+
* Documentation: http://www.rubydoc.info/github/flavorjones/mini_portile
|
7
|
+
* Source Code: https://github.com/flavorjones/mini_portile
|
8
|
+
* Bug Reports: https://github.com/flavorjones/mini_portile/issues
|
9
|
+
|
10
|
+
This project is a minimalistic implementation of a port/recipe system
|
11
|
+
**for developers**.
|
12
|
+
|
13
|
+
Because _"Works on my machine"_ is unacceptable for a library maintainer.
|
14
|
+
|
15
|
+
|
16
|
+
## Not Another Package Management System
|
17
|
+
|
18
|
+
`mini_portile2` is not a general package management system. It is not
|
19
|
+
aimed to replace apt, macports or homebrew.
|
20
|
+
|
21
|
+
It's intended primarily to make sure that you, as the developer of a
|
22
|
+
library, can reproduce a user's dependencies and environment by
|
23
|
+
specifying a specific version of an underlying dependency that you'd
|
24
|
+
like to use.
|
25
|
+
|
26
|
+
So, if a user says, "This bug happens on my system that uses libiconv
|
27
|
+
1.13.1", `mini_portile2` should make it easy for you to download,
|
28
|
+
compile and link against libiconv 1.13.1; and run your test suite
|
29
|
+
against it.
|
30
|
+
|
31
|
+
This scenario might be simplified with something like this:
|
32
|
+
|
33
|
+
```
|
34
|
+
rake compile LIBICONV_VERSION=1.13.1
|
35
|
+
```
|
36
|
+
|
37
|
+
(For your homework, you can make libiconv version be taken from the
|
38
|
+
appropriate `ENV` variables.)
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
## Sounds easy, but where's the catch?
|
43
|
+
|
44
|
+
You got me, there is a catch. At this time (and highly likely will be
|
45
|
+
always) `MiniPortile` is only compatible with **GCC compilers** and
|
46
|
+
**autoconf**- or **configure**-based projects.
|
47
|
+
|
48
|
+
That is, it assumes the library you want to build contains a
|
49
|
+
`configure` script, which all the autoconf-based libraries do.
|
50
|
+
|
51
|
+
|
52
|
+
### How to use
|
53
|
+
|
54
|
+
Now that you know the catch, and you're still reading this, here is a
|
55
|
+
quick example:
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
gem "mini_portile2", "~> 2.0.0" # if used in extconf.rb
|
59
|
+
require "mini_portile2"
|
60
|
+
recipe = MiniPortile.new("libiconv", "1.13.1")
|
61
|
+
recipe.files = ["http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz"]
|
62
|
+
recipe.cook
|
63
|
+
recipe.activate
|
64
|
+
```
|
65
|
+
|
66
|
+
That's all. The gem version constraint makes sure that your extconf.rb
|
67
|
+
is future-proof to possible incompatible changes of MiniPortile.
|
68
|
+
`#cook` will download, extract, patch, configure and
|
69
|
+
compile the library into a namespaced structure. `#activate` ensures
|
70
|
+
GCC will find this library and prefer it over a system-wide
|
71
|
+
installation.
|
72
|
+
|
73
|
+
|
74
|
+
### Directory Structure Conventions
|
75
|
+
|
76
|
+
`MiniPortile` follows the principle of **convention over configuration** and
|
77
|
+
established a folder structure where is going to place files and perform work.
|
78
|
+
|
79
|
+
Take the above example, and let's draw some picture:
|
80
|
+
|
81
|
+
```
|
82
|
+
mylib
|
83
|
+
|-- ports
|
84
|
+
| |-- archives
|
85
|
+
| | `-- libiconv-1.13.1.tar.gz
|
86
|
+
| `-- <platform>
|
87
|
+
| `-- libiconv
|
88
|
+
| `-- 1.13.1
|
89
|
+
| |-- bin
|
90
|
+
| |-- include
|
91
|
+
| `-- lib
|
92
|
+
`-- tmp
|
93
|
+
`-- <platform>
|
94
|
+
`-- ports
|
95
|
+
```
|
96
|
+
|
97
|
+
In above structure, `<platform>` refers to the architecture that
|
98
|
+
represents the operating system you're using (e.g. i686-linux,
|
99
|
+
i386-mingw32, etc).
|
100
|
+
|
101
|
+
Inside the platform folder, `MiniPortile` will store the artifacts
|
102
|
+
that result from the compilation process. The library is versioned so
|
103
|
+
you can keep multiple versions around on disk without clobbering
|
104
|
+
anything.
|
105
|
+
|
106
|
+
`archives` is where downloaded source files are cached. It is
|
107
|
+
recommended you avoid trashing that folder to avoid downloading the
|
108
|
+
same file multiple times (save bandwidth, save the world).
|
109
|
+
|
110
|
+
`tmp` is where compilation is performed and can be safely discarded.
|
111
|
+
|
112
|
+
Use the recipe's `#path` to obtain the full path to the installation
|
113
|
+
directory:
|
114
|
+
|
115
|
+
```ruby
|
116
|
+
recipe.cook
|
117
|
+
recipe.path # => /home/luis/projects/myapp/ports/i686-linux/libiconv/1.13.1
|
118
|
+
```
|
119
|
+
|
120
|
+
### How can I combine this with my compilation task?
|
121
|
+
|
122
|
+
In the simplest case, your rake `compile` task will depend on
|
123
|
+
`MiniPortile` compilation and most important, activation.
|
124
|
+
|
125
|
+
Example:
|
126
|
+
|
127
|
+
```ruby
|
128
|
+
task :libiconv do
|
129
|
+
recipe = MiniPortile.new("libiconv", "1.13.1")
|
130
|
+
recipe.files << {
|
131
|
+
url: "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz"],
|
132
|
+
md5: "7ab33ebd26687c744a37264a330bbe9a"
|
133
|
+
}
|
134
|
+
checkpoint = ".#{recipe.name}-#{recipe.version}.installed"
|
135
|
+
|
136
|
+
unless File.exist?(checkpoint)
|
137
|
+
recipe.cook
|
138
|
+
touch checkpoint
|
139
|
+
end
|
140
|
+
|
141
|
+
recipe.activate
|
142
|
+
end
|
143
|
+
|
144
|
+
task :compile => [:libiconv] do
|
145
|
+
# ... your library's compilation task ...
|
146
|
+
end
|
147
|
+
```
|
148
|
+
|
149
|
+
The above example will:
|
150
|
+
|
151
|
+
* **download** and verify integrity the sources only once
|
152
|
+
* **compile** the library only once (using a timestamp file)
|
153
|
+
* ensure compiled library is **activated**
|
154
|
+
* make the compile task depend upon compiled library activation
|
155
|
+
|
156
|
+
As an exercise for the reader, you could specify the libiconv version
|
157
|
+
in an environment variable or a configuration file.
|
158
|
+
|
159
|
+
|
160
|
+
### Native and/or Cross Compilation
|
161
|
+
|
162
|
+
The above example covers the normal use case: compiling dependencies
|
163
|
+
natively.
|
164
|
+
|
165
|
+
`MiniPortile` also covers another use case, which is the
|
166
|
+
cross-compilation of the dependencies to be used as part of a binary
|
167
|
+
gem compilation.
|
168
|
+
|
169
|
+
It is the perfect complementary tool for
|
170
|
+
[`rake-compiler`](https://github.com/rake-compiler/rake-compiler) and
|
171
|
+
its `cross` rake task.
|
172
|
+
|
173
|
+
Depending on your usage of `rake-compiler`, you will need to use
|
174
|
+
`host` to match the installed cross-compiler toolchain.
|
175
|
+
|
176
|
+
Please refer to the examples directory for simplified and practical usage.
|
177
|
+
|
178
|
+
|
179
|
+
### Supported Scenarios
|
180
|
+
|
181
|
+
As mentioned before, `MiniPortile` requires a GCC compiler
|
182
|
+
toolchain. This has been tested against Ubuntu, OSX and even Windows
|
183
|
+
(RubyInstaller with DevKit)
|
184
|
+
|
185
|
+
|
186
|
+
## License
|
187
|
+
|
188
|
+
This library is licensed under MIT license. Please see LICENSE.txt for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require "rake/clean"
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
|
4
|
+
namespace :test do
|
5
|
+
desc "Test MiniPortile by running unit tests"
|
6
|
+
task :unit do
|
7
|
+
sh "ruby -w -W2 -I.:lib -e \"#{Dir["test/test_*.rb"].map{|f| "require '#{f}';"}.join}\" -- -v"
|
8
|
+
end
|
9
|
+
|
10
|
+
desc "Test MiniPortile by compiling examples"
|
11
|
+
task :examples do
|
12
|
+
Dir.chdir("examples") do
|
13
|
+
sh "rake ports:all"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
task :clean do
|
19
|
+
FileUtils.rm_rf ["examples/ports", "examples/tmp"], :verbose => true
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Run all tests"
|
23
|
+
task :test => ["test:unit", "test:examples"]
|
24
|
+
|
25
|
+
task :default => [:test]
|