mini_portile 0.6.2 → 0.7.0.rc1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8bb1f4555b185687edb331802be1e4783b39716
4
- data.tar.gz: 4de819ec5c11062cb206751a0245380e503b37e1
3
+ metadata.gz: bdb0513b385a424c53b4671b7b4d2f05dd5ea3bf
4
+ data.tar.gz: 2af3bdbf45700b4c2285f7b486e2f88515095118
5
5
  SHA512:
6
- metadata.gz: 8a1ed772f09c079a4bc2582507e92cc661703b6702c1da0e02da6ffc63664d39d06ee04635fc36c863d7e7b3c2fcc2c3afa26ffaf7b31bc6b4d2682185e71cc4
7
- data.tar.gz: eda4c7c81eb1e275829a122ea7ce1f438df33a88dc490929aae0637064c809be625180c961f18aa8d4dc070354525f15dd36feb1335e92d57e5a4a3fe263f918
6
+ metadata.gz: 27dee570e1241cffc7c77c329b58ea2d6d4688fae10cb3692c92b4eaa0f9ffb62547209a1dba4a0e1f1ed7f3cd37e1cd708608ece3aabd9e8d87bc6e10b3135c
7
+ data.tar.gz: 07462c1c96fe025fdcf005cb50ca9e3fb829c4432a37657caee9f695671b1359ba0b50a92335d5600da622545ec75a7e124ddffcb968debd8bb54ccd3bd3855e
@@ -0,0 +1,3 @@
1
+ pkg
2
+ tmp
3
+ Gemfile.lock
@@ -0,0 +1,15 @@
1
+ ---
2
+ language: ruby
3
+ sudo: false
4
+ rvm:
5
+ - 1.9.3
6
+ - 2.0
7
+ - 2.1
8
+ - 2.2
9
+ - ruby-head
10
+ - jruby-1.7.22
11
+ - jruby-9.0.0.0
12
+
13
+ matrix:
14
+ allow_failures:
15
+ - rvm: jruby-9.0.0.0
@@ -1,15 +1,37 @@
1
- === 0.6.2 / 2014-12-30
1
+ ### 0.7.0.rc1 / 2015-08-24
2
+
3
+ Many thanks to @larskanis, @knu, and @kirikak2, who all contributed
4
+ code, ideas, or both to this release.
5
+
6
+ #### Enhancements
7
+
8
+ * In patch task, use git(1) or patch(1), whichever is available.
9
+ * Append outputs to patch.log instead of clobbering it for every patch command.
10
+ * Take `configure_options` literally without running a subshell.
11
+ This changes allows for embedded spaces in a path, among other things.
12
+ Please unescape `configure_options` where you have been doing it yourself.
13
+ * Print last 20 lines of the given log file, for convenience.
14
+ * Allow SHA1, SHA256 and MD5 hash verification of downloads
15
+
16
+
17
+ #### Bugfixes
18
+
19
+ * Fix issue when proxy username/password use escaped characters.
20
+ * Fix use of https and ftp proxy.
21
+
22
+
23
+ ### 0.6.2 / 2014-12-30
2
24
 
3
25
  * Updated gemspec, license and README to reflect new maintainer.
4
26
 
5
27
 
6
- === 0.6.1 / 2014-08-03
28
+ ### 0.6.1 / 2014-08-03
7
29
 
8
30
  * Enhancements:
9
31
  * Expand path to logfile to easier debugging on failures.
10
32
  Pull #33 [marvin2k]
11
33
 
12
- === 0.6.0 / 2014-04-18
34
+ ### 0.6.0 / 2014-04-18
13
35
 
14
36
  * Enhancements:
15
37
  * Add default cert store and custom certs from `SSL_CERT_FILE` if present.
@@ -22,7 +44,7 @@
22
44
  * Internal:
23
45
  * Improve examples and use them as test harness.
24
46
 
25
- === 0.5.3 / 2014-03-24
47
+ ### 0.5.3 / 2014-03-24
26
48
 
27
49
  * Bugfixes:
28
50
  * Shell escape paths in tar command. Pull #29. [quickshiftin]
@@ -30,7 +52,7 @@
30
52
  the compression type. Pull #27. Closes #21. [b-dean]
31
53
  * Try RbConfig's CC before fall back to 'gcc'. Ref #28.
32
54
 
33
- === 0.5.2 / 2013-10-23
55
+ ### 0.5.2 / 2013-10-23
34
56
 
35
57
  * Bugfixes:
36
58
  * Change tar detection order to support NetBSD 'gtar'. Closes #24
@@ -39,27 +61,27 @@
39
61
  * Respect ENV's CC variable before fallback to 'gcc'.
40
62
  * Avoid non-ASCII output of GCC cause host detection issues. Closes #22
41
63
 
42
- === 0.5.1 / 2013-07-07
64
+ ### 0.5.1 / 2013-07-07
43
65
 
44
66
  * Bugfixes:
45
67
  * Detect tar executable without shelling out. [jtimberman]
46
68
 
47
- === 0.5.0 / 2012-11-17
69
+ ### 0.5.0 / 2012-11-17
48
70
 
49
71
  * Enhancements:
50
72
  * Allow patching extracted files using `git apply`. [metaskills]
51
73
 
52
- === 0.4.1 / 2012-10-24
74
+ ### 0.4.1 / 2012-10-24
53
75
 
54
76
  * Bugfixes:
55
77
  * Syntax to process FTp binary chunks differs between Ruby 1.8.7 and 1.9.x
56
78
 
57
- === 0.4.0 / 2012-10-24
79
+ ### 0.4.0 / 2012-10-24
58
80
 
59
81
  * Enhancements:
60
82
  * Allow fetching of FTP URLs along HTTP ones. [metaskills]
61
83
 
62
- === 0.3.0 / 2012-03-23
84
+ ### 0.3.0 / 2012-03-23
63
85
 
64
86
  * Enhancements:
65
87
  * Use `gcc -v` to determine original host (platform) instead of Ruby one.
@@ -67,7 +89,7 @@
67
89
  * Deprecations:
68
90
  * Dropped support for Rubies older than 1.8.7
69
91
 
70
- === 0.2.2 / 2011-04-11
92
+ ### 0.2.2 / 2011-04-11
71
93
 
72
94
  * Minor enhancements:
73
95
  * Use LDFLAGS when activating recipes for cross-compilation. Closes #6
@@ -75,12 +97,12 @@
75
97
  * Bugfixes:
76
98
  * Remove memoization of *_path helpers. Closes #7
77
99
 
78
- === 0.2.1 / 2011-04-06
100
+ ### 0.2.1 / 2011-04-06
79
101
 
80
102
  * Minor enhancements:
81
103
  * Provide MiniPortile#path to obtain full path to installation directory. Closes GH-5
82
104
 
83
- === 0.2.0 / 2011-04-05
105
+ ### 0.2.0 / 2011-04-05
84
106
 
85
107
  * Enhancements:
86
108
  * Improve tar detection
@@ -92,6 +114,6 @@
92
114
  * MiniPortile#target can be changed now. Closes GH-2
93
115
  * Always redirect tar output properly
94
116
 
95
- === 0.1.0 / 2011-03-08
117
+ ### 0.1.0 / 2011-03-08
96
118
 
97
119
  * Initial release. Welcome to this world!
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in mini_portile.gemspec
4
+ gemspec
@@ -0,0 +1,185 @@
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/rjji6y9uteaw4oua/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_portile` 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_portile` 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
+ require "mini_portile"
59
+ recipe = MiniPortile.new("libiconv", "1.13.1")
60
+ recipe.files = ["http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz"]
61
+ recipe.cook
62
+ recipe.activate
63
+ ```
64
+
65
+ That's all. `#cook` will download, extract, patch, configure and
66
+ compile the library into a namespaced structure. `#activate` ensures
67
+ GCC will find this library and prefer it over a system-wide
68
+ installation.
69
+
70
+
71
+ ### Directory Structure Conventions
72
+
73
+ `MiniPortile` follows the principle of **convention over configuration** and
74
+ established a folder structure where is going to place files and perform work.
75
+
76
+ Take the above example, and let's draw some picture:
77
+
78
+ ```
79
+ mylib
80
+ |-- ports
81
+ | |-- archives
82
+ | | `-- libiconv-1.13.1.tar.gz
83
+ | `-- <platform>
84
+ | `-- libiconv
85
+ | `-- 1.13.1
86
+ | |-- bin
87
+ | |-- include
88
+ | `-- lib
89
+ `-- tmp
90
+ `-- <platform>
91
+ `-- ports
92
+ ```
93
+
94
+ In above structure, `<platform>` refers to the architecture that
95
+ represents the operating system you're using (e.g. i686-linux,
96
+ i386-mingw32, etc).
97
+
98
+ Inside the platform folder, `MiniPortile` will store the artifacts
99
+ that result from the compilation process. The library is versioned so
100
+ you can keep multiple versions around on disk without clobbering
101
+ anything.
102
+
103
+ `archives` is where downloaded source files are cached. It is
104
+ recommended you avoid trashing that folder to avoid downloading the
105
+ same file multiple times (save bandwidth, save the world).
106
+
107
+ `tmp` is where compilation is performed and can be safely discarded.
108
+
109
+ Use the recipe's `#path` to obtain the full path to the installation
110
+ directory:
111
+
112
+ ```ruby
113
+ recipe.cook
114
+ recipe.path # => /home/luis/projects/myapp/ports/i686-linux/libiconv/1.13.1
115
+ ```
116
+
117
+ ### How can I combine this with my compilation task?
118
+
119
+ In the simplest case, your rake `compile` task will depend on
120
+ `MiniPortile` compilation and most important, activation.
121
+
122
+ Example:
123
+
124
+ ```ruby
125
+ task :libiconv do
126
+ recipe = MiniPortile.new("libiconv", "1.13.1")
127
+ recipe.files << {
128
+ url: "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz"],
129
+ md5: "7ab33ebd26687c744a37264a330bbe9a"
130
+ }
131
+ checkpoint = ".#{recipe.name}-#{recipe.version}.installed"
132
+
133
+ unless File.exist?(checkpoint)
134
+ recipe.cook
135
+ touch checkpoint
136
+ end
137
+
138
+ recipe.activate
139
+ end
140
+
141
+ task :compile => [:libiconv] do
142
+ # ... your library's compilation task ...
143
+ end
144
+ ```
145
+
146
+ The above example will:
147
+
148
+ * **download** and verify integrity the sources only once
149
+ * **compile** the library only once (using a timestamp file)
150
+ * ensure compiled library is **activated**
151
+ * make the compile task depend upon compiled library activation
152
+
153
+ As an exercise for the reader, you could specify the libiconv version
154
+ in an environment variable or a configuration file.
155
+
156
+
157
+ ### Native and/or Cross Compilation
158
+
159
+ The above example covers the normal use case: compiling dependencies
160
+ natively.
161
+
162
+ `MiniPortile` also covers another use case, which is the
163
+ cross-compilation of the dependencies to be used as part of a binary
164
+ gem compilation.
165
+
166
+ It is the perfect complementary tool for
167
+ [`rake-compiler`](https://github.com/rake-compiler/rake-compiler) and
168
+ its `cross` rake task.
169
+
170
+ Depending on your usage of `rake-compiler`, you will need to use
171
+ `host` to match the installed cross-compiler toolchain.
172
+
173
+ Please refer to the examples directory for simplified and practical usage.
174
+
175
+
176
+ ### Supported Scenarios
177
+
178
+ As mentioned before, `MiniPortile` requires a GCC compiler
179
+ toolchain. This has been tested against Ubuntu, OSX and even Windows
180
+ (RubyInstaller with DevKit)
181
+
182
+
183
+ ## License
184
+
185
+ This library is licensed under MIT license. Please see LICENSE.txt for details.
data/Rakefile CHANGED
@@ -1,53 +1,25 @@
1
1
  require "rake/clean"
2
- require "rubygems/package_task"
2
+ require 'bundler/gem_tasks'
3
3
 
4
- GEM_SPEC = Gem::Specification.new do |s|
5
- # basic information
6
- s.name = "mini_portile"
7
- s.version = "0.6.2"
8
- s.platform = Gem::Platform::RUBY
9
-
10
- # description and details
11
- s.summary = "Simplistic port-like solution for developers"
12
- s.description = "Simplistic port-like solution for developers. It provides a standard and simplified way to compile against dependency libraries without messing up your system."
13
-
14
- # requirements
15
- s.required_ruby_version = ">= 1.8.7"
16
- s.required_rubygems_version = ">= 1.3.5"
17
-
18
- # dependencies (add_dependency)
19
- # development dependencies (add_development_dependency)
20
-
21
- # components, files and paths
22
- s.files = FileList["examples/Rakefile", "lib/**/*.rb", "Rakefile", "*.{rdoc,txt}"]
23
-
24
- s.require_path = 'lib'
25
-
26
- # documentation
27
- s.has_rdoc = true
28
- s.rdoc_options << '--main' << 'README.rdoc' << '--title' << 'MiniPortile -- Documentation'
29
-
30
- s.extra_rdoc_files = %w(README.rdoc History.txt LICENSE.txt)
31
-
32
- # project information
33
- s.homepage = 'http://github.com/flavorjones/mini_portile'
34
- s.licenses = ['MIT']
4
+ namespace :test do
5
+ desc "Test MiniPortile by running unit tests"
6
+ task :unit do
7
+ sh "ruby -w -W2 -I. -e \"#{Dir["test/test_*.rb"].map{|f| "require '#{f}';"}.join}\" -- -v"
8
+ end
35
9
 
36
- # author and contributors
37
- s.authors = ['Luis Lavena', 'Mike Dalessio']
38
- s.email = 'mike.dalessio@gmail.com'
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
39
16
  end
40
17
 
41
- Gem::PackageTask.new(GEM_SPEC) do |pkg|
42
- pkg.need_tar = false
43
- pkg.need_zip = false
18
+ task :clean do
19
+ FileUtils.rm_rf ["examples/ports", "examples/tmp"], :verbose => true
44
20
  end
45
21
 
46
- desc "Test MiniPortile by compiling examples"
47
- task :test do
48
- Dir.chdir("examples") do
49
- sh "rake ports:all"
50
- end
51
- end
22
+ desc "Run all tests"
23
+ task :test => ["test:unit", "test:examples"]
52
24
 
53
25
  task :default => [:test]
@@ -0,0 +1,21 @@
1
+ ---
2
+ version: "{build}"
3
+ clone_depth: 10
4
+ install:
5
+ - ps: ((New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt', "$env:TMP\ca-bundle.crt"))
6
+ - SET SSL_CERT_FILE=%TMP%\ca-bundle.crt
7
+ - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
8
+ - ruby --version
9
+ - gem --version
10
+ - bundle install
11
+ build: off
12
+ test_script:
13
+ - bundle exec rake -rdevkit test
14
+
15
+ environment:
16
+ matrix:
17
+ - ruby_version: "193"
18
+ # - ruby_version: "200"
19
+ # - ruby_version: "200-x64"
20
+ # - ruby_version: "21"
21
+ - ruby_version: "21-x64"
@@ -0,0 +1,2 @@
1
+ ports
2
+ tmp
@@ -1,10 +1,20 @@
1
- require File.expand_path("mini_portile", File.join(File.dirname(__FILE__), "../lib"))
1
+ require 'rbconfig'
2
+
3
+ $: << File.expand_path(File.join(File.dirname(__FILE__), "../lib"))
4
+ require "mini_portile"
2
5
 
3
6
  recipes = []
4
7
 
8
+ def windows?
9
+ RbConfig::CONFIG['target_os'] =~ /mswin|mingw32/
10
+ end
11
+
5
12
  # libiconv
6
13
  libiconv = MiniPortile.new "libiconv", "1.14"
7
14
  libiconv.files << "ftp://ftp.gnu.org/pub/gnu/#{libiconv.name}/#{libiconv.name}-#{libiconv.version}.tar.gz"
15
+ unless windows?
16
+ libiconv.patch_files = Dir["libiconv-patches/*.patch"].map { |dir| File.expand_path dir }
17
+ end
8
18
 
9
19
  recipes.push libiconv
10
20
 
@@ -16,7 +26,7 @@ recipes.push sqlite3
16
26
 
17
27
  # c-ares
18
28
  c_ares = MiniPortile.new "c-ares", "1.7.5"
19
- c_ares.files << "https://distfiles.openknapsack.org/#{c_ares.name}/#{c_ares.name}-#{c_ares.version}.tar.gz"
29
+ c_ares.files << "http://distfiles.openknapsack.org/#{c_ares.name}/#{c_ares.name}-#{c_ares.version}.tar.gz"
20
30
 
21
31
  recipes.push c_ares
22
32
 
@@ -73,7 +83,11 @@ class ZlibRecipe < MiniPortile
73
83
  end
74
84
 
75
85
  zlib = ZlibRecipe.new "zlib", "1.2.8"
76
- zlib.files << "http://zlib.net/#{zlib.name}-#{zlib.version}.tar.gz"
86
+ zlib.files << {
87
+ url: "http://zlib.net/#{zlib.name}-#{zlib.version}.tar.gz",
88
+ md5: "44d667c142d7cda120332623eab69f40",
89
+ }
90
+
77
91
 
78
92
  recipes.push zlib
79
93