rake-compiler-dock 0.4.1 → 0.4.2

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
- ---
2
- SHA1:
3
- metadata.gz: d972c1947e89297809fcea04b48cf9044de9f248
4
- data.tar.gz: 83f36b3533e6940d3b37efda8290b17a72475e3c
5
- SHA512:
6
- metadata.gz: 86dc09c161ee24cb22087eb4753493a867c4ab3c431c3e62c1d386469b6a8cff628aa195f799bfcdc69d657d1d5469a7c89e4a9f0fb49b6e5e7793763c3ab37b
7
- data.tar.gz: 0a380df5a0fe45293fd54c7f769a1997ae0d51bcf1299004054057ba8b53d1788b99d6fa17da035926ef18bf81692da8a3ca70411d1d95e8c9c53339d451b1ed
1
+ ---
2
+ SHA1:
3
+ data.tar.gz: 15cbe947034dfc4a02757ce326f0dc1867fbab2f
4
+ metadata.gz: ac2bb475e78bc2d577805c0dbe95fedeb5b70297
5
+ SHA512:
6
+ data.tar.gz: 122fd75f408b1d88d160989427ae9447ef3cbc519adb7524cc2675bc6b5f26698b66b709722ef020da285e7f8fac0e172c7972f9bd9f7c85ee4a7c36734bc3d3
7
+ metadata.gz: 8fba0273d71b33fde24b316ecd2bd5c4cebc7d511780a73c8bd52f7b0782a4bc6fee96b06fba08e98319fada419064d6d089ce29df56375a334648270238fed6
Binary file
data.tar.gz.sig CHANGED
Binary file
data/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
1
  FROM ubuntu:14.04
2
2
 
3
3
  RUN apt-get -y update && \
4
- apt-get install -y curl git-core mingw32 xz-utils build-essential wget
4
+ apt-get install -y curl git-core mingw32 xz-utils build-essential wget unzip
5
5
 
6
6
  RUN mkdir -p /opt/mingw && \
7
7
  curl -SL http://downloads.sourceforge.net/mingw-w64/i686-w64-mingw32-gcc-4.7.2-release-linux64_rubenvb.tar.xz | \
@@ -110,4 +110,6 @@ ADD src/runas /usr/local/bin/
110
110
  # Install sudoers configuration
111
111
  ADD src/sudoers /etc/sudoers.d/rake-compiler-dock
112
112
 
113
+ ENV RUBY_CC_VERSION 1.8.7:1.9.3:2.0.0:2.1.6:2.2.2
114
+
113
115
  CMD bash
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rake-compiler-dock.gemspec
4
4
  gemspec
5
+
6
+ gem "test-unit-notify", "~> 1.0", :platform => :ruby
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ 0.4.2 / 2015-07-04
2
+ ------------------
3
+ * Describe use of environment variables in README.
4
+ * Provide RCD_IMAGE, RCD_HOST_RUBY_PLATFORM and RCD_HOST_RUBY_VERSION to the container.
5
+ * Add unzip tool to docker image.
6
+
7
+
1
8
  0.4.1 / 2015-07-01
2
9
  ------------------
3
10
  * Make rake-compiler-dock compatible to ruby-1.8 to ease the usage in gems still supporting 1.8.
data/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # rake-compiler-dock
2
2
 
3
- Easy to use Docker based cross compiler environment for building binary Windows gems.
3
+ Easy to use and reliable cross compiler environment for building Windows binary gems.
4
4
 
5
5
  It provides cross compilers and Ruby environments for all versions of the [RubyInstaller](http://rubyinstaller.org/) .
6
6
  They are prepared for use with [rake-compiler](https://github.com/rake-compiler/rake-compiler) .
7
7
 
8
- This is similar to [rake-compiler-dev-box](https://github.com/tjschuck/rake-compiler-dev-box) but is based on lightweight Docker containers and is wrapped as a gem for easier setup, usage and integration.
9
- It is also a bit more reliable, since the underlying docker images are versioned and kept unchanged while building.
8
+ This is kind of successor of [rake-compiler-dev-box](https://github.com/tjschuck/rake-compiler-dev-box).
9
+ It is wrapped as a gem for easier setup, usage and integration and is based on lightweight Docker containers.
10
+ It is also more reliable, since the underlying docker images are sematic versioned and kept unchanged while building.
10
11
 
11
12
  ## Installation
12
13
 
@@ -63,14 +64,48 @@ You can also choose between different executable ruby versions by `rvm use <vers
63
64
 
64
65
  ### Add to your Rakefile
65
66
 
66
- Rake-compiler-dock can be easily integrated into your Rakefile like this:
67
+ To make the build process reproduceable for other parties, it is recommended to add rake-compiler-dock to your Rakefile. This can be done like this:
67
68
 
68
69
  task 'gem:windows' do
69
70
  require 'rake_compiler_dock'
70
71
  RakeCompilerDock.sh "bundle && rake cross native gem"
71
72
  end
72
73
 
73
- See [the wiki](https://github.com/larskanis/rake-compiler-dock/wiki/Projects-using-rake-compiler-dock) for projects which use rake-compiler-dock.
74
+ Rake-compiler-dock uses [semantic versioning](http://semver.org/), so you should add it into your Gemfile, to make sure, that future changes will not break your build.
75
+
76
+ gem 'rake-compiler-dock', '~> 0.4.0'
77
+
78
+ See [the wiki](https://github.com/larskanis/rake-compiler-dock/wiki/Projects-using-rake-compiler-dock) for projects which make use of rake-compiler-dock.
79
+
80
+
81
+ ## Variables
82
+
83
+ Rake-compiler-dock makes use of several environment variables.
84
+
85
+ The following variables are recognized by rake-compiler-dock:
86
+
87
+ * `RCD_IMAGE` - The docker image that is downloaded and started. Defaults to "larskanis/rake-compiler-dock:IMAGE_VERSION" with an image version that is determined by the gem version.
88
+
89
+ The following variables are passed through to the docker container without modification:
90
+
91
+ * `http_proxy`, `https_proxy`, `ftp_proxy` - See [Frequently asked questions](https://github.com/larskanis/rake-compiler-dock/wiki/FAQ) for more details.
92
+
93
+ The following variables are provided to the running docker container:
94
+
95
+ * `RCD_IMAGE` - The full docker image name the container is running on.
96
+ * `RCD_HOST_RUBY_PLATFORM` - The `RUBY_PLATFORM` of the host ruby.
97
+ * `RCD_HOST_RUBY_VERSION` - The `RUBY_VERSION` of the host ruby.
98
+ * `RUBY_CC_VERSION` - The target ruby versions for rake-compiler. The default is defined in the [Dockerfile](https://github.com/larskanis/rake-compiler-dock/blob/master/Dockerfile), but can be changed as a parameter to rake.
99
+
100
+ Other environment variables can be set or passed through to the container like this:
101
+
102
+ RakeCompilerDock.sh "rake cross native gem OPENSSL_VERSION=#{ENV['OPENSSL_VERSION']}"
103
+
104
+
105
+ ## More information
106
+
107
+ See [Frequently asked questions](https://github.com/larskanis/rake-compiler-dock/wiki/FAQ) for more details.
108
+
74
109
 
75
110
  ## Contributing
76
111
 
data/Rakefile CHANGED
@@ -4,3 +4,7 @@ require "rake_compiler_dock"
4
4
  task :build do
5
5
  sh "docker build -t larskanis/rake-compiler-dock:#{RakeCompilerDock::IMAGE_VERSION} ."
6
6
  end
7
+
8
+ task :test do
9
+ sh "ruby -w -W2 -I. -Ilib -e \"#{Dir["test/test_*.rb"].map{|f| "require '#{f}';"}.join}\" -- -v"
10
+ end
@@ -15,7 +15,7 @@ module RakeCompilerDock
15
15
  end
16
16
 
17
17
  def image_name
18
- ENV['RAKE_COMPILER_DOCK_IMAGE'] || "larskanis/rake-compiler-dock:#{IMAGE_VERSION}"
18
+ ENV['RCD_IMAGE'] || ENV['RAKE_COMPILER_DOCK_IMAGE'] || "larskanis/rake-compiler-dock:#{IMAGE_VERSION}"
19
19
  end
20
20
 
21
21
  def exec(*args)
@@ -63,6 +63,9 @@ module RakeCompilerDock
63
63
  "-e", "ftp_proxy=#{ENV['ftp_proxy']}",
64
64
  "-e", "http_proxy=#{ENV['http_proxy']}",
65
65
  "-e", "https_proxy=#{ENV['https_proxy']}",
66
+ "-e", "RCD_HOST_RUBY_PLATFORM=#{RUBY_PLATFORM}",
67
+ "-e", "RCD_HOST_RUBY_VERSION=#{RUBY_VERSION}",
68
+ "-e", "RCD_IMAGE=#{image_name}",
66
69
  "-w", make_valid_path(pwd),
67
70
  *drun_args]
68
71
 
@@ -81,7 +84,7 @@ module RakeCompilerDock
81
84
  end
82
85
 
83
86
  def verbose_flag(options)
84
- verbose = options.fetch(:verbose) do
87
+ options.fetch(:verbose) do
85
88
  Object.const_defined?(:Rake) && Rake.const_defined?(:FileUtilsExt) ? Rake::FileUtilsExt.verbose_flag : false
86
89
  end
87
90
  end
@@ -1,4 +1,4 @@
1
1
  module RakeCompilerDock
2
- VERSION = "0.4.1"
3
- IMAGE_VERSION = "0.4.0"
2
+ VERSION = "0.4.2"
3
+ IMAGE_VERSION = "0.4.2"
4
4
  end
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = RakeCompilerDock::VERSION
9
9
  spec.authors = ["Lars Kanis"]
10
10
  spec.email = ["lars@greiz-reinsdorf.de"]
11
- spec.summary = %q{Docker based cross compiler environment for building binary windows gems.}
12
- spec.description = %q{Easy to use Docker based cross compiler environment for building binary windows gems.
11
+ spec.summary = %q{Easy to use and reliable cross compiler environment for building Windows binary gems.}
12
+ spec.description = %q{Easy to use and reliable cross compiler environment for building Windows binary gems.
13
13
  Use rake-compiler-dock to enter an interactive shell session or add a task to your Rakefile to automate your cross build.}
14
14
  spec.homepage = "https://github.com/larskanis/rake-compiler-dock"
15
15
  spec.license = "MIT"
@@ -21,4 +21,5 @@ Use rake-compiler-dock to enter an interactive shell session or add a task to yo
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.7"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "test-unit", "~> 3.0"
24
25
  end
data/src/runas CHANGED
@@ -9,5 +9,4 @@ ln -s /usr/local/rake-compiler "$HOME"/.rake-compiler
9
9
 
10
10
  sudo -u "$USER" --set-home \
11
11
  BASH_ENV=/etc/rubybashrc \
12
- RUBY_CC_VERSION=1.8.7:1.9.3:2.0.0:2.1.6:2.2.2 \
13
12
  -- "$@"
@@ -1 +1 @@
1
- Defaults env_keep += "http_proxy https_proxy ftp_proxy"
1
+ Defaults env_keep += "http_proxy https_proxy ftp_proxy RCD_HOST_RUBY_PLATFORM RCD_HOST_RUBY_VERSION RCD_IMAGE RUBY_CC_VERSION"
@@ -0,0 +1,50 @@
1
+ require 'rake_compiler_dock'
2
+ require 'rbconfig'
3
+ require 'test/unit'
4
+ begin
5
+ require 'test/unit/notify'
6
+ rescue LoadError
7
+ end
8
+
9
+ class TestEnvironmentVariables < Test::Unit::TestCase
10
+ @@rcd_env = nil
11
+
12
+ def setup
13
+ @@rcd_env ||= begin
14
+ args = "bash -c 'set'"
15
+ idir = File.join(File.dirname(__FILE__), '../lib')
16
+ cmd = "#{RbConfig::CONFIG['RUBY_INSTALL_NAME']} -I#{idir.inspect} bin/rake-compiler-dock #{args}"
17
+ output = `#{cmd}`
18
+
19
+ output.split("\n").inject({}) do |hash, line|
20
+ if line =~ /\A(\w+)=(.*)\z/
21
+ hash[$1] = $2.chomp
22
+ end
23
+ hash
24
+ end
25
+ end
26
+ end
27
+
28
+ def rcd_env
29
+ @@rcd_env
30
+ end
31
+
32
+ def test_IMAGE
33
+ assert_equal RakeCompilerDock.image_name, rcd_env['RCD_IMAGE']
34
+ end
35
+
36
+ def test_RUBY_CC_VERSION
37
+ df = File.read(File.expand_path("../../Dockerfile", __FILE__))
38
+ df =~ /^ENV RUBY_CC_VERSION\s+(.*)\s+$/
39
+ assert_equal $1, rcd_env['RUBY_CC_VERSION']
40
+ end
41
+
42
+ def test_HOST_RUBY_PLATFORM
43
+ assert_equal RUBY_PLATFORM, rcd_env['RCD_HOST_RUBY_PLATFORM']
44
+ end
45
+
46
+ def test_HOST_RUBY_VERSION
47
+ assert_equal RUBY_VERSION, rcd_env['RCD_HOST_RUBY_VERSION']
48
+ end
49
+
50
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rake-compiler-dock
3
- version: !ruby/object:Gem::Version
4
- version: 0.4.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.2
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Lars Kanis
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
10
+ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDPDCCAiSgAwIBAgIBAjANBgkqhkiG9w0BAQUFADBEMQ0wCwYDVQQDDARsYXJz
@@ -29,47 +29,52 @@ cert_chain:
29
29
  6jkDey5mE3jQb893U6ihl55uLkVQwxZZTq/flNWjTIcbbvKKafEGdGv5uOlB+KRL
30
30
  PRtgPFlA2jDgUr1EPAIH1Q==
31
31
  -----END CERTIFICATE-----
32
- date: 2015-07-01 00:00:00.000000000 Z
33
- dependencies:
34
- - !ruby/object:Gem::Dependency
32
+
33
+ date: 2015-07-04 00:00:00 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
35
36
  name: bundler
36
- requirement: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.7'
41
- type: :development
42
37
  prerelease: false
43
- version_requirements: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.7'
48
- - !ruby/object:Gem::Dependency
38
+ requirement: &id001 !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ version: "1.7"
43
+ type: :development
44
+ version_requirements: *id001
45
+ - !ruby/object:Gem::Dependency
49
46
  name: rake
50
- requirement: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '10.0'
47
+ prerelease: false
48
+ requirement: &id002 !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ~>
51
+ - !ruby/object:Gem::Version
52
+ version: "10.0"
55
53
  type: :development
54
+ version_requirements: *id002
55
+ - !ruby/object:Gem::Dependency
56
+ name: test-unit
56
57
  prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '10.0'
58
+ requirement: &id003 !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: "3.0"
63
+ type: :development
64
+ version_requirements: *id003
62
65
  description: |-
63
- Easy to use Docker based cross compiler environment for building binary windows gems.
66
+ Easy to use and reliable cross compiler environment for building Windows binary gems.
64
67
  Use rake-compiler-dock to enter an interactive shell session or add a task to your Rakefile to automate your cross build.
65
- email:
68
+ email:
66
69
  - lars@greiz-reinsdorf.de
67
- executables:
70
+ executables:
68
71
  - rake-compiler-dock
69
72
  extensions: []
73
+
70
74
  extra_rdoc_files: []
71
- files:
72
- - ".gitignore"
75
+
76
+ files:
77
+ - .gitignore
73
78
  - Dockerfile
74
79
  - Gemfile
75
80
  - History.md
@@ -92,29 +97,32 @@ files:
92
97
  - src/sigfw.c
93
98
  - src/strip_wrapper
94
99
  - src/sudoers
100
+ - test/test_environment_variables.rb
95
101
  homepage: https://github.com/larskanis/rake-compiler-dock
96
- licenses:
102
+ licenses:
97
103
  - MIT
98
104
  metadata: {}
105
+
99
106
  post_install_message:
100
107
  rdoc_options: []
101
- require_paths:
108
+
109
+ require_paths:
102
110
  - lib
103
- required_ruby_version: !ruby/object:Gem::Requirement
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- version: '0'
108
- required_rubygems_version: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- version: '0'
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - &id004
114
+ - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: "0"
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - *id004
113
120
  requirements: []
121
+
114
122
  rubyforge_project:
115
- rubygems_version: 2.4.5
123
+ rubygems_version: 2.0.3
116
124
  signing_key:
117
125
  specification_version: 4
118
- summary: Docker based cross compiler environment for building binary windows gems.
119
- test_files: []
120
- has_rdoc:
126
+ summary: Easy to use and reliable cross compiler environment for building Windows binary gems.
127
+ test_files:
128
+ - test/test_environment_variables.rb
metadata.gz.sig CHANGED
Binary file