mini_portile2 2.1.0 → 2.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b90aadf075467a1583841db365f7bd1aafb26790
4
- data.tar.gz: 7689b3b467a964185225509458770aa60e1214e7
3
+ metadata.gz: 7085b002833202ee7455beb829f9fb787bca8129
4
+ data.tar.gz: 097a89cc3ffe2a742947a3310c284d518ab8a9f6
5
5
  SHA512:
6
- metadata.gz: 7b0296b213f1e3b0edb2238a660489379ae084beef21ae3dc2b6f22a677d8053111ac0a130f5638c097149294c028676d06b199b8473dd1496552ab62b230e80
7
- data.tar.gz: 1a3762db4b474760297a93c9a4a17f29cc96b0999ffca256da2f9124f1fe2a597121ca8d7ef2cb5ace853a569c679a2e6df032d6039741920df3927ec2189ef8
6
+ metadata.gz: 033fb41be5b3c882e6a02eb806695a22db54ce2b8ef2253b9475822f4bb5764157d411cb2a2da143da8c10ca887e65fc85a0dd60c741867d700ce07afa688e20
7
+ data.tar.gz: 6b0df87be823d602b38508a924f85de1d1923840d184484bddb7ccf05542e8d9895919593c6e8870c5515b320ddd640aec5f20470ad1b19dd348ff28f1605fac
@@ -0,0 +1,83 @@
1
+ ---
2
+ resources:
3
+ - name: mini_portile
4
+ type: git
5
+ source:
6
+ uri: https://github.com/flavorjones/mini_portile
7
+ branch: master
8
+ jobs:
9
+ - name: "Minitest"
10
+ plan:
11
+ - get: mini_portile
12
+ - task: With version 1.9.3
13
+ config:
14
+ platform: linux
15
+ image: docker:///ruby#1.9.3
16
+ inputs:
17
+ - name: mini_portile
18
+ run:
19
+ path: bash
20
+ args:
21
+ - "-c"
22
+ - cd mini_portile && bundle install && rake
23
+ privileged: false
24
+ - task: With version 2.0
25
+ config:
26
+ platform: linux
27
+ image: docker:///ruby#2.0
28
+ inputs:
29
+ - name: mini_portile
30
+ run:
31
+ path: bash
32
+ args:
33
+ - "-c"
34
+ - cd mini_portile && bundle install && rake
35
+ privileged: false
36
+ - task: With version 2.1
37
+ config:
38
+ platform: linux
39
+ image: docker:///ruby#2.1
40
+ inputs:
41
+ - name: mini_portile
42
+ run:
43
+ path: bash
44
+ args:
45
+ - "-c"
46
+ - cd mini_portile && bundle install && rake
47
+ privileged: false
48
+ - task: With version 2.2
49
+ config:
50
+ platform: linux
51
+ image: docker:///ruby#2.2
52
+ inputs:
53
+ - name: mini_portile
54
+ run:
55
+ path: bash
56
+ args:
57
+ - "-c"
58
+ - cd mini_portile && bundle install && rake
59
+ privileged: false
60
+ - task: With version jruby-1.7.23
61
+ config:
62
+ platform: linux
63
+ image: docker:///jruby#1.7.23
64
+ inputs:
65
+ - name: mini_portile
66
+ run:
67
+ path: bash
68
+ args:
69
+ - "-c"
70
+ - cd mini_portile && bundle install && rake
71
+ privileged: false
72
+ - task: With version jruby-9.0.4.0
73
+ config:
74
+ platform: linux
75
+ image: docker:///jruby#9.0.4.0
76
+ inputs:
77
+ - name: mini_portile
78
+ run:
79
+ path: bash
80
+ args:
81
+ - "-c"
82
+ - cd mini_portile && bundle install && rake
83
+ privileged: false
@@ -1,4 +1,4 @@
1
- ---
1
+ --
2
2
  language: ruby
3
3
  sudo: false
4
4
  rvm:
@@ -6,6 +6,7 @@ rvm:
6
6
  - 2.0
7
7
  - 2.1
8
8
  - 2.2
9
+ - 2.3.0
9
10
  - ruby-head
10
11
  - jruby-1.7.23
11
12
  - jruby-9.0.4.0
@@ -1,3 +1,10 @@
1
+ ### 2.2.0.rc1 / 2016-03-08
2
+
3
+ #### Enhancements
4
+
5
+ * Add experimental support for cmake-based projects
6
+
7
+
1
8
  ### 2.1.0 / 2016-01-06
2
9
 
3
10
  #### Enhancements
data/README.md CHANGED
@@ -46,15 +46,17 @@ appropriate `ENV` variables.)
46
46
 
47
47
  ## Sounds easy, but where's the catch?
48
48
 
49
- At this time (and highly likely will be always) `mini_portile2` is
50
- only compatible with **GCC compilers** and **autoconf**- or
51
- **configure**-based projects.
49
+ At this time `mini_portile2` only supports **autoconf**- or
50
+ **configure**-based projects. (That is, it assumes the library you
51
+ want to build contains a `configure` script, which all the
52
+ autoconf-based libraries do.)
52
53
 
53
- That is, it assumes the library you want to build contains a
54
- `configure` script, which all the autoconf-based libraries do.
54
+ As of v2.2.0, there is experimental support for **CMake**-based
55
+ projects. We welcome your feedback on this, particularly for Windows
56
+ platforms.
55
57
 
56
58
 
57
- ### How to use
59
+ ### How to use (for autoconf projects)
58
60
 
59
61
  Now that you know the catch, and you're still reading this, here is a
60
62
  quick example:
@@ -82,6 +84,11 @@ library into a namespaced structure.
82
84
  system-wide installation.
83
85
 
84
86
 
87
+ ### How to use (for cmake projects)
88
+
89
+ Same as above, but instead of `MiniPortile.new`, call `MiniPortileCMake.new`.
90
+
91
+
85
92
  ### Directory Structure Conventions
86
93
 
87
94
  `mini_portile2` follows the principle of **convention over configuration** and
@@ -1,2 +1,3 @@
1
1
  require "mini_portile2/version"
2
2
  require "mini_portile2/mini_portile"
3
+ require "mini_portile2/mini_portile_cmake"
@@ -33,6 +33,10 @@ class MiniPortile
33
33
  attr_writer :configure_options
34
34
  attr_accessor :host, :files, :patch_files, :target, :logger
35
35
 
36
+ def self.windows?
37
+ RbConfig::CONFIG['target_os'] =~ /mswin|mingw32/
38
+ end
39
+
36
40
  def initialize(name, version)
37
41
  @name = name
38
42
  @version = version
@@ -0,0 +1,41 @@
1
+ require 'mini_portile2/mini_portile'
2
+
3
+ class MiniPortileCMake < MiniPortile
4
+ def configure_prefix
5
+ "-DCMAKE_INSTALL_PREFIX=#{File.expand_path(port_path)}"
6
+ end
7
+
8
+ def configure_defaults
9
+ if MiniPortile.windows?
10
+ ['-G "NMake Makefiles"']
11
+ else
12
+ []
13
+ end
14
+ end
15
+
16
+ def configure
17
+ return if configured?
18
+
19
+ md5_file = File.join(tmp_path, 'configure.md5')
20
+ digest = Digest::MD5.hexdigest(computed_options.to_s)
21
+ File.open(md5_file, "w") { |f| f.write digest }
22
+
23
+ execute('configure', %w(cmake) + computed_options + ["."])
24
+ end
25
+
26
+ def configured?
27
+ configure = File.join(work_path, 'configure')
28
+ makefile = File.join(work_path, 'CMakefile')
29
+ md5_file = File.join(tmp_path, 'configure.md5')
30
+
31
+ stored_md5 = File.exist?(md5_file) ? File.read(md5_file) : ""
32
+ current_md5 = Digest::MD5.hexdigest(computed_options.to_s)
33
+
34
+ (current_md5 == stored_md5) && newer?(makefile, configure)
35
+ end
36
+
37
+ def make_cmd
38
+ return "nmake" if MiniPortile.windows?
39
+ super
40
+ end
41
+ end
@@ -1,3 +1,3 @@
1
1
  class MiniPortile
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0.rc1"
3
3
  end
@@ -0,0 +1,7 @@
1
+ # CMakeLists files in this project can
2
+ # refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and
3
+ # to the root binary directory of the project as ${HELLO_BINARY_DIR}.
4
+ cmake_minimum_required (VERSION 2.8.7)
5
+ project (HELLO)
6
+ add_executable (hello hello.c)
7
+ install (TARGETS hello DESTINATION bin)
@@ -0,0 +1,4 @@
1
+ int main(int argc, char** argv)
2
+ {
3
+ return 0 ;
4
+ }
@@ -37,11 +37,11 @@ class TestCase < Minitest::Test
37
37
  end
38
38
  end
39
39
 
40
- def create_tar(tar_path, assets_path)
40
+ def create_tar(tar_path, assets_path, directory)
41
41
  FileUtils.mkdir_p(File.dirname(tar_path))
42
42
  Zlib::GzipWriter.open(tar_path) do |fdtgz|
43
43
  Dir.chdir(assets_path) do
44
- Archive::Tar::Minitar.pack("test mini portile-1.0.0", fdtgz)
44
+ Archive::Tar::Minitar.pack(directory, fdtgz)
45
45
  end
46
46
  end
47
47
  end
@@ -49,4 +49,12 @@ class TestCase < Minitest::Test
49
49
  def work_dir(r=recipe)
50
50
  "tmp/#{r.host}/ports/#{r.name}/#{r.version}/#{r.name}-#{r.version}"
51
51
  end
52
+
53
+ def with_custom_git_dir(dir)
54
+ old = ENV['GIT_DIR']
55
+ ENV['GIT_DIR'] = dir
56
+ yield
57
+ ensure
58
+ ENV['GIT_DIR'] = old
59
+ end
52
60
  end
@@ -0,0 +1,64 @@
1
+ require File.expand_path('../helper', __FILE__)
2
+
3
+ class TestCMake < TestCase
4
+ attr_accessor :assets_path, :tar_path, :recipe
5
+
6
+ def before_all
7
+ super
8
+ return if MiniPortile.windows?
9
+
10
+ @assets_path = File.expand_path("../assets", __FILE__)
11
+ @tar_path = File.expand_path("../../tmp/test-cmake-1.0.tar.gz", __FILE__)
12
+
13
+ # remove any previous test files
14
+ FileUtils.rm_rf("tmp")
15
+
16
+ create_tar(@tar_path, @assets_path, "test-cmake-1.0")
17
+ start_webrick(File.dirname(@tar_path))
18
+
19
+ @recipe = MiniPortileCMake.new("test-cmake", "1.0").tap do |recipe|
20
+ recipe.files << "http://localhost:#{HTTP_PORT}/#{ERB::Util.url_encode(File.basename(@tar_path))}"
21
+ recipe.patch_files << File.join(@assets_path, "patch 1.diff")
22
+ recipe.configure_options << "--option=\"path with 'space'\""
23
+ git_dir = File.join(@assets_path, "git")
24
+ with_custom_git_dir(git_dir) do
25
+ recipe.cook
26
+ end
27
+ end
28
+ end
29
+
30
+ def after_all
31
+ super
32
+ return if MiniPortile.windows?
33
+
34
+ stop_webrick
35
+ # leave test files for inspection
36
+ end
37
+
38
+ def test_cmake_inherits_from_base
39
+ assert(MiniPortileCMake <= MiniPortile)
40
+ end
41
+
42
+ def test_configure
43
+ skip if MiniPortile.windows?
44
+
45
+ cmakecache = File.join(work_dir, "CMakeCache.txt")
46
+ assert File.exist?(cmakecache), cmakecache
47
+
48
+ assert_includes(IO.read(cmakecache), "CMAKE_INSTALL_PREFIX:PATH=#{recipe.path}")
49
+ end
50
+
51
+ def test_compile
52
+ skip if MiniPortile.windows?
53
+
54
+ binary = File.join(work_dir, "hello")
55
+ assert File.exist?(binary), binary
56
+ end
57
+
58
+ def test_install
59
+ skip if MiniPortile.windows?
60
+
61
+ binary = File.join(recipe.path, "bin", "hello")
62
+ assert File.exist?(binary), binary
63
+ end
64
+ end
@@ -3,14 +3,6 @@ require File.expand_path('../helper', __FILE__)
3
3
  class TestCook < TestCase
4
4
  attr_accessor :assets_path, :tar_path, :recipe
5
5
 
6
- def with_custom_git_dir(dir)
7
- old = ENV['GIT_DIR']
8
- ENV['GIT_DIR'] = dir
9
- yield
10
- ensure
11
- ENV['GIT_DIR'] = old
12
- end
13
-
14
6
  def before_all
15
7
  super
16
8
  @assets_path = File.expand_path("../assets", __FILE__)
@@ -19,7 +11,7 @@ class TestCook < TestCase
19
11
  # remove any previous test files
20
12
  FileUtils.rm_rf("tmp")
21
13
 
22
- create_tar(@tar_path, @assets_path)
14
+ create_tar(@tar_path, @assets_path, "test mini portile-1.0.0")
23
15
  start_webrick(File.dirname(@tar_path))
24
16
 
25
17
  @recipe = MiniPortile.new("test mini portile", "1.0.0").tap do |recipe|
@@ -11,11 +11,12 @@ class TestDigest < TestCase
11
11
  # remove any previous test files
12
12
  FileUtils.rm_rf("tmp")
13
13
 
14
- create_tar(@tar_path, @assets_path)
14
+ create_tar(@tar_path, @assets_path, "test mini portile-1.0.0")
15
15
  start_webrick(File.dirname(@tar_path))
16
16
  end
17
17
 
18
18
  def after_all
19
+ super
19
20
  stop_webrick
20
21
  # leave test files for inspection
21
22
  end
@@ -1,7 +1,5 @@
1
1
  require File.expand_path('../helper', __FILE__)
2
2
 
3
- cert_name = [['CN', 'localhost', OpenSSL::ASN1::PRINTABLESTRING]]
4
-
5
3
  describe "recipe download" do
6
4
  include Minitest::Hooks
7
5
 
@@ -67,5 +65,5 @@ describe "recipe download" do
67
65
  @recipe.files << "foo://foo"
68
66
  proc { @recipe.download }.must_raise ArgumentError
69
67
  end
70
- end
68
+ end
71
69
  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.1.0
4
+ version: 2.2.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Lavena
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-01-06 00:00:00.000000000 Z
13
+ date: 2016-03-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -90,6 +90,7 @@ executables: []
90
90
  extensions: []
91
91
  extra_rdoc_files: []
92
92
  files:
93
+ - ".concourse.yml"
93
94
  - ".gitignore"
94
95
  - ".travis.yml"
95
96
  - CHANGELOG.md
@@ -100,13 +101,17 @@ files:
100
101
  - appveyor.yml
101
102
  - lib/mini_portile2.rb
102
103
  - lib/mini_portile2/mini_portile.rb
104
+ - lib/mini_portile2/mini_portile_cmake.rb
103
105
  - lib/mini_portile2/version.rb
104
106
  - mini_portile2.gemspec
105
107
  - test/assets/git/config
106
108
  - test/assets/patch 1.diff
107
109
  - test/assets/test mini portile-1.0.0/configure
110
+ - test/assets/test-cmake-1.0/CMakeLists.txt
111
+ - test/assets/test-cmake-1.0/hello.c
108
112
  - test/assets/test-download-archive.tar.gz
109
113
  - test/helper.rb
114
+ - test/test_cmake.rb
110
115
  - test/test_cook.rb
111
116
  - test/test_digest.rb
112
117
  - test/test_download.rb
@@ -126,12 +131,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
131
  version: 1.9.2
127
132
  required_rubygems_version: !ruby/object:Gem::Requirement
128
133
  requirements:
129
- - - ">="
134
+ - - ">"
130
135
  - !ruby/object:Gem::Version
131
- version: '0'
136
+ version: 1.3.1
132
137
  requirements: []
133
138
  rubyforge_project:
134
- rubygems_version: 2.4.8
139
+ rubygems_version: 2.5.1
135
140
  signing_key:
136
141
  specification_version: 4
137
142
  summary: Simplistic port-like solution for developers
@@ -139,8 +144,11 @@ test_files:
139
144
  - test/assets/git/config
140
145
  - test/assets/patch 1.diff
141
146
  - test/assets/test mini portile-1.0.0/configure
147
+ - test/assets/test-cmake-1.0/CMakeLists.txt
148
+ - test/assets/test-cmake-1.0/hello.c
142
149
  - test/assets/test-download-archive.tar.gz
143
150
  - test/helper.rb
151
+ - test/test_cmake.rb
144
152
  - test/test_cook.rb
145
153
  - test/test_digest.rb
146
154
  - test/test_download.rb