mini_portile2 2.5.3 → 2.6.1

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
  SHA256:
3
- metadata.gz: b4913fc9a77207eb01b12c960a04125fd6517d57d727423af306689b5d5fc833
4
- data.tar.gz: bc4a0a28a469ce473217fd176094b4e7238064a4f38040f39d7f514544a34842
3
+ metadata.gz: 1cce9a4c5c119fbab9f241aae304d9aec171a69873a168688132d55e4010ee49
4
+ data.tar.gz: eb61f44c46b6822aae38027d6c4aecb3c16d6b8d6e7caf008d90110da98c1d69
5
5
  SHA512:
6
- metadata.gz: 19b7cff7f935399f4b1162240bf0999e4db1a9af53edd0b462174dfcec32a38813afcca1901e95d7a539d4773dc1618e99349075b55181f300f43a1126936802
7
- data.tar.gz: d872cbd565306b31f8a612fa03fcf1d7fbe2c35307806c8ae7c1099679aac729452567b5970bf7e121bcba05c504b235367acf159b950bebf08a0bd942063b07
6
+ metadata.gz: c943d0ce63b54f9199426af7658f200054a87d151ff30b66183a5afa10096955733bab9a7ccaa167a9052e3826243d779e0579ded63ed1ea2522d35ab5940512
7
+ data.tar.gz: 476d783710ca21b2893256f39a34f4f958a289ece0230eb7e364f4b1c0714e39f85c74f5f84783279685953ac179fc899959c0fb7302f41856720ceefdb33436
@@ -1,14 +1,19 @@
1
1
  name: Continuous Integration
2
2
 
3
3
  on:
4
+ workflow_dispatch:
4
5
  push:
5
- branches: [main]
6
+ branches:
7
+ - main
8
+ - v*.*.x
9
+ tags:
10
+ - v*.*.*
6
11
  pull_request:
7
12
  types: [opened, synchronize]
8
- branches: [main]
13
+ branches:
14
+ - "*"
9
15
  schedule:
10
16
  - cron: "0 8 * * 5" # At 08:00 on Friday # https://crontab.guru/#0_8_*_*_5
11
- workflow_dispatch:
12
17
 
13
18
  jobs:
14
19
  test-unit:
data/CHANGELOG.md CHANGED
@@ -1,10 +1,28 @@
1
1
  ## mini_portile changelog
2
2
 
3
+ ### 2.6.1 / 2021-05-31
4
+
5
+ #### Dependencies
6
+
7
+ Make `net-ftp` an optional dependency, since requiring it as a hard dependency in v2.5.2 caused warnings to be emitted by Ruby 2.7 and earlier. A warning message is emitted if FTP functionality is called and `net-ftp` isn't available; this should only happen in Ruby 3.1 and later.
8
+
9
+
3
10
  ### 2.5.3 / 2021-05-31
4
11
 
12
+ #### Dependencies
13
+
5
14
  Make `net-ftp` an optional dependency, since requiring it as a hard dependency in v2.5.2 caused warnings to be emitted by Ruby 2.7 and earlier. A warning message is emitted if FTP functionality is called and `net-ftp` isn't available; this should only happen in Ruby 3.1 and later.
6
15
 
7
16
 
17
+ ### 2.6.0 / 2021-05-31
18
+
19
+ ### Added
20
+
21
+ Recipes may build against a local directory by specifying `source_directory` instead of `files`. In
22
+ particular, this may be useful for debugging problems with the upstream dependency (e.g., use `git
23
+ bisect` in a local clone) or for continuous integration with upstream HEAD.
24
+
25
+
8
26
  ### 2.5.2 / 2021-05-28
9
27
 
10
28
  #### Dependencies
data/README.md CHANGED
@@ -89,6 +89,18 @@ system-wide installation.
89
89
  Same as above, but instead of `MiniPortile.new`, call `MiniPortileCMake.new`.
90
90
 
91
91
 
92
+ ### Local source directories
93
+
94
+ Instead of downloading a remote file, you can also point mini_portile2 at a local source
95
+ directory. In particular, this may be useful for testing or debugging:
96
+
97
+ ``` ruby
98
+ gem "mini_portile2", "~> 2.0.0" # NECESSARY if used in extconf.rb. see below.
99
+ require "mini_portile2"
100
+ recipe = MiniPortile.new("libiconv", "1.13.1")
101
+ recipe.source_directory = "/path/to/local/source/for/library-1.2.3"
102
+ ```
103
+
92
104
  ### Directory Structure Conventions
93
105
 
94
106
  `mini_portile2` follows the principle of **convention over configuration** and
@@ -30,7 +30,7 @@ end
30
30
  class MiniPortile
31
31
  attr_reader :name, :version, :original_host
32
32
  attr_writer :configure_options
33
- attr_accessor :host, :files, :patch_files, :target, :logger
33
+ attr_accessor :host, :files, :patch_files, :target, :logger, :source_directory
34
34
 
35
35
  def self.windows?
36
36
  RbConfig::CONFIG['target_os'] =~ /mswin|mingw/
@@ -54,10 +54,22 @@ class MiniPortile
54
54
  @patch_files = []
55
55
  @log_files = {}
56
56
  @logger = STDOUT
57
+ @source_directory = nil
57
58
 
58
59
  @original_host = @host = detect_host
59
60
  end
60
61
 
62
+ def source_directory=(path)
63
+ @source_directory = File.expand_path(path)
64
+ end
65
+
66
+ def prepare_build_directory
67
+ raise "source_directory is not set" if source_directory.nil?
68
+ output "Building #{@name} #{@version} from source at '#{source_directory}'"
69
+ FileUtils.mkdir_p(File.join(tmp_path, [name, version].join("-")))
70
+ FileUtils.rm_rf(port_path) # make sure we always re-install
71
+ end
72
+
61
73
  def download
62
74
  files_hashs.each do |file|
63
75
  download_file(file[:url], file[:local_path])
@@ -109,15 +121,16 @@ class MiniPortile
109
121
  def configure
110
122
  return if configured?
111
123
 
124
+ FileUtils.mkdir_p(tmp_path)
112
125
  cache_file = File.join(tmp_path, 'configure.options_cache')
113
126
  File.open(cache_file, "w") { |f| f.write computed_options.to_s }
114
127
 
128
+ command = Array(File.join((source_directory || "."), "configure"))
115
129
  if RUBY_PLATFORM=~/mingw|mswin/
116
130
  # Windows doesn't recognize the shebang.
117
- execute('configure', %w(sh ./configure) + computed_options)
118
- else
119
- execute('configure', %w(./configure) + computed_options)
131
+ command.unshift("sh")
120
132
  end
133
+ execute('configure', command + computed_options)
121
134
  end
122
135
 
123
136
  def compile
@@ -138,7 +151,7 @@ class MiniPortile
138
151
  end
139
152
 
140
153
  def configured?
141
- configure = File.join(work_path, 'configure')
154
+ configure = File.join((source_directory || work_path), 'configure')
142
155
  makefile = File.join(work_path, 'Makefile')
143
156
  cache_file = File.join(tmp_path, 'configure.options_cache')
144
157
 
@@ -156,9 +169,13 @@ class MiniPortile
156
169
  end
157
170
 
158
171
  def cook
159
- download unless downloaded?
160
- extract
161
- patch
172
+ if source_directory
173
+ prepare_build_directory
174
+ else
175
+ download unless downloaded?
176
+ extract
177
+ patch
178
+ end
162
179
  configure unless configured?
163
180
  compile
164
181
  install unless installed?
@@ -1,3 +1,3 @@
1
1
  class MiniPortile
2
- VERSION = "2.5.3"
2
+ VERSION = "2.6.1"
3
3
  end
data/test/test_cook.rb CHANGED
@@ -113,3 +113,32 @@ class TestCookWithBrokenGitDir < TestCase
113
113
  end
114
114
  end
115
115
  end
116
+
117
+ class TestCookAgainstSourceDirectory < TestCase
118
+ attr_accessor :recipe
119
+
120
+ def setup
121
+ super
122
+
123
+ @recipe ||= MiniPortile.new("test mini portile", "1.0.0").tap do |recipe|
124
+ recipe.source_directory = File.expand_path("../assets/test mini portile-1.0.0", __FILE__)
125
+ end
126
+ end
127
+
128
+ def test_source_directory
129
+ recipe.cook
130
+
131
+ path = File.join(work_dir, "configure.txt")
132
+ assert(File.exist?(path))
133
+ assert_equal((recipe.configure_options + ["--prefix=#{recipe.path}"]).inspect,
134
+ File.read(path).chomp);
135
+
136
+ path = File.join(work_dir, "compile.txt")
137
+ assert(File.exist?(path))
138
+ assert_equal("[\"all\"]", File.read(path).chomp);
139
+
140
+ path = File.join(work_dir, "install.txt")
141
+ assert(File.exist?(path))
142
+ assert_equal("[\"install\"]", File.read(path).chomp);
143
+ end
144
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_portile2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.3
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Lavena