rake-compiler-dock 0.1.0 → 0.2.0

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: 826e842d110c43f9b333aaf07ee5ee2dc86aeb97
4
- data.tar.gz: 062e38a137965df768c35e2455acc45c24be0651
3
+ metadata.gz: a9d812c3d58c67858e89228862019e7414399f0a
4
+ data.tar.gz: a49c40cc58b5687fac2b5b7d9f9fbeb50ab4cd5b
5
5
  SHA512:
6
- metadata.gz: 0f109af320b70531b5a2885e9259d43d7fa223ed3ca3238add01b012d00f77279e40021db6325aaf6351ac02411e76efd0eca59d46ada60f4f16f092ac7bcc86
7
- data.tar.gz: 4fae5e1bea609687d558bc8433e5666224fc74e3141fec6dc2ac66f3b23b26820704efa4b994f521440202e1556b9a12a4147265e65a1065413335ff6dda4aab
6
+ metadata.gz: 63a62025d40a77e6ea621119b2103e4e6a3290e8f5556fc73daa2a2f4bce1c4c3eae57f3f1b9719a105b6c276098887c9a0fb8aab5d5e50d25d3ea9343da4445
7
+ data.tar.gz: cd2f86c14498ae4cfcd54f739a1f007c1bcf4a5e3a9bf6a1bfced80bc9420468e29f25269aab8a1e03952cb11b073a633758c028b27acfa2570aa781de8e73d6
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
4
+ apt-get install -y curl git-core mingw32 xz-utils build-essential wget
5
5
 
6
6
  RUN mkdir -p /opt/mingw && \
7
7
  curl -SL http://sunet.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.7-release/i686-w64-mingw32-gcc-4.7.2-release-linux64_rubenvb.tar.xz | \
@@ -106,4 +106,7 @@ RUN gcc $HOME/sigfw.c -o /usr/local/bin/sigfw
106
106
  # Install user mapper
107
107
  ADD src/runas /usr/local/bin/
108
108
 
109
+ # Install sudoers configuration
110
+ ADD src/sudoers /etc/sudoers.d/rake-compiler-dock
111
+
109
112
  CMD bash
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ 0.2.0 / 2015-06-08
2
+ ------------------
3
+ * Add a simple API for running commands within the rake-compiler-dock environment.
4
+ * Respect ftp, http and https_proxy settings from the host.
5
+ * Add wget to the image
6
+
7
+
1
8
  0.1.0 / 2015-05-27
2
9
  ------------------
3
10
  * first public release
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # rake-compiler-dock
2
2
 
3
- Docker based cross compiler environment for building binary windows gems.
3
+ Easy to use Docker based cross compiler environment for building binary windows gems.
4
4
 
5
- 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 usage.
5
+ 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 usage and integration.
6
6
 
7
7
 
8
8
  ## Installation
@@ -11,9 +11,9 @@ Install docker natively on Linux:
11
11
 
12
12
  $ sudo apt-get install docker.io
13
13
 
14
- ... or use the installer on Windows: [boot2docker](https://docs.docker.com/installation/windows)
14
+ ... or install boot2docker on [Windows](https://github.com/boot2docker/windows-installer/releases) or [OS X](https://github.com/boot2docker/osx-installer/releases) .
15
15
 
16
- Install rake-compiler-dock as a gem. This will download the docker image at the first run:
16
+ Install rake-compiler-dock as a gem. The docker image is downloaded later on demand:
17
17
 
18
18
  $ gem install rake-compiler-dock
19
19
 
@@ -32,7 +32,7 @@ All commands are executed with the current user and group of the host.
32
32
  `rake-compiler-dock` without arguments starts an interactive shell session.
33
33
  You can choose between different ruby versions by `rvm use <version>` .
34
34
  All changes within the current working directory are shared with the host.
35
- But all other changes to the file system are dropped at the end of the session.
35
+ But note, that all other changes to the file system are dropped at the end of the session.
36
36
 
37
37
  `rake-compiler-dock` can also take the build command(s) from STDIN or as command arguments.
38
38
 
@@ -49,7 +49,18 @@ The environment variable `RUBY_CC_VERSION` is predefined and includes all these
49
49
 
50
50
  $ rake-compiler-dock bash -c 'echo $RUBY_CC_VERSION' # => 1.8.7:1.9.3:2.0.0:2.1.6:2.2.2
51
51
 
52
- Overwrite it, if the given gem does not support all of them.
52
+ Overwrite `RUBY_CC_VERSION`, if your gem does not support all available versions.
53
+
54
+ ### Add to your Rakefile
55
+
56
+ Rake-compiler-dock can be easily integrated into your Rakefile like this:
57
+
58
+ task 'gem:windows' do
59
+ require 'rake_compiler_dock'
60
+ RakeCompilerDock.sh "bundle && rake cross native gem"
61
+ end
62
+
63
+ See [the wiki](https://github.com/larskanis/rake-compiler-dock/wiki/Projects-using-rake-compiler) for projects which use rake-compiler-dock.
53
64
 
54
65
  ## Contributing
55
66
 
@@ -2,31 +2,7 @@
2
2
 
3
3
  require 'rake_compiler_dock'
4
4
 
5
- if RUBY_PLATFORM =~ /mingw|mswin/
6
- # Change Path from "C:\Path" to "/c/Path" as used by boot2docker
7
- pwd = Dir.pwd.gsub(/^([a-z]):/i){ "/#{$1.downcase}" }
8
- uid = 1000
9
- gid = 1000
10
- else
11
- pwd = Dir.pwd
12
- uid = Process.uid
13
- gid = Process.gid
14
- end
15
- user = `id -nu`.chomp
16
- group = `id -ng`.chomp
17
5
  args = ARGV.empty? ? ['bash'] : ARGV
18
- image = ENV['RAKE_COMPILER_DOCK_IMAGE'] || "larskanis/rake-compiler-dock:#{RakeCompilerDock::VERSION}"
19
-
20
- cmd = ["docker", "run", "--rm", "-i", "-t",
21
- "-v", "#{pwd}:#{pwd}",
22
- "-e", "UID=#{uid}",
23
- "-e", "GID=#{gid}",
24
- "-e", "USER=#{user}",
25
- "-e", "GROUP=#{group}",
26
- "-w", pwd,
27
- image,
28
- "sigfw", "runas", *args]
29
-
30
- puts cmd.join(" ")
31
- system(*cmd)
32
- exit $?.exitstatus
6
+ RakeCompilerDock.exec(*args) do |ok, res|
7
+ exit(res.exitstatus)
8
+ end
@@ -1,5 +1,74 @@
1
1
  require "rake_compiler_dock/version"
2
2
 
3
3
  module RakeCompilerDock
4
- # Your code goes here...
4
+ # Run the command cmd within a fresh rake-compiler-dock container and within a shell.
5
+ #
6
+ # If a block is given, upon command completion the block is called with an OK flag (true on a zero exit status) and a Process::Status object.
7
+ # Without a block a RuntimeError is raised when the command exits non-zero.
8
+ #
9
+ # Examples:
10
+ #
11
+ # RakeCompilerDock.sh 'bundle && rake cross native gem'
12
+ #
13
+ # # check exit status after command runs
14
+ # sh %{bundle && rake cross native gem} do |ok, res|
15
+ # if ! ok
16
+ # puts "windows cross build failed (status = #{res.exitstatus})"
17
+ # end
18
+ # end
19
+ def sh(cmd, &block)
20
+ exec('bash', '-c', cmd, &block)
21
+ end
22
+
23
+ def image_name
24
+ ENV['RAKE_COMPILER_DOCK_IMAGE'] || "larskanis/rake-compiler-dock:#{VERSION}"
25
+ end
26
+
27
+ # Run the command cmd within a fresh rake-compiler-dock container.
28
+ # The command is run directly, without the shell.
29
+ #
30
+ # If a block is given, upon command completion the block is called with an OK flag (true on a zero exit status) and a Process::Status object.
31
+ # Without a block a RuntimeError is raised when the command exits non-zero.
32
+ #
33
+ # Examples:
34
+ #
35
+ # RakeCompilerDock.exec 'bash', '-c', 'echo $RUBY_CC_VERSION'
36
+ def exec(*args)
37
+ if RUBY_PLATFORM =~ /mingw|mswin/
38
+ # Change Path from "C:\Path" to "/c/Path" as used by boot2docker
39
+ pwd = Dir.pwd.gsub(/^([a-z]):/i){ "/#{$1.downcase}" }
40
+ uid = 1000
41
+ gid = 1000
42
+ else
43
+ pwd = Dir.pwd
44
+ uid = Process.uid
45
+ gid = Process.gid
46
+ end
47
+ user = `id -nu`.chomp
48
+ group = `id -ng`.chomp
49
+
50
+ cmd = ["docker", "run", "--rm", "-i", "-t",
51
+ "-v", "#{pwd}:#{pwd}",
52
+ "-e", "UID=#{uid}",
53
+ "-e", "GID=#{gid}",
54
+ "-e", "USER=#{user}",
55
+ "-e", "GROUP=#{group}",
56
+ "-e", "ftp_proxy=#{ENV['ftp_proxy']}",
57
+ "-e", "http_proxy=#{ENV['http_proxy']}",
58
+ "-e", "https_proxy=#{ENV['https_proxy']}",
59
+ "-w", pwd,
60
+ image_name,
61
+ "sigfw", "runas", *args]
62
+
63
+ ok = system(*cmd)
64
+ if block_given?
65
+ yield(ok, $?)
66
+ elsif !ok
67
+ show_command = cmd.join(" ")
68
+ fail "Command failed with status (#{$?.exitstatus}): " +
69
+ "[#{show_command}]"
70
+ end
71
+ end
72
+
73
+ module_function :exec, :sh, :image_name
5
74
  end
@@ -1,3 +1,3 @@
1
1
  module RakeCompilerDock
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -9,7 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Lars Kanis"]
10
10
  spec.email = ["lars@greiz-reinsdorf.de"]
11
11
  spec.summary = %q{Docker based cross compiler environment for building binary windows gems.}
12
- spec.description = %q{Use rake-compiler-dock to enter an interactive shell session.}
12
+ spec.description = %q{Easy to use Docker based cross compiler environment for building binary windows gems.
13
+ Use rake-compiler-dock to enter an interactive shell session or add a task to your Rakefile to automate your cross build.}
13
14
  spec.homepage = "https://github.com/larskanis/rake-compiler-dock"
14
15
  spec.license = "MIT"
15
16
 
@@ -2,11 +2,13 @@ diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
2
2
  index 6acc816..6aa2a49 100644
3
3
  --- a/tasks/bin/cross-ruby.rake
4
4
  +++ b/tasks/bin/cross-ruby.rake
5
- @@ -135,6 +135,7 @@ file "#{USER_HOME}/builds/#{MINGW_HOST}/#{RUBY_CC_VERSION}/Makefile" => ["#{USER
5
+ @@ -135,8 +135,7 @@ file "#{USER_HOME}/builds/#{MINGW_HOST}/#{RUBY_CC_VERSION}/Makefile" => ["#{USER
6
6
  "--build=#{RUBY_BUILD}",
7
7
  '--enable-shared',
8
8
  '--disable-install-doc',
9
- + '--with-ext=',
10
- '--without-tk',
11
- '--without-tcl'
9
+ - '--without-tk',
10
+ - '--without-tcl'
11
+ + '--with-ext='
12
12
  ]
13
+
14
+ # Force Winsock2 for Ruby 1.8, 1.9 defaults to it
@@ -0,0 +1 @@
1
+ Defaults env_keep += "http_proxy https_proxy ftp_proxy"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-compiler-dock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Kanis
@@ -10,26 +10,26 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDLjCCAhagAwIBAgIBAzANBgkqhkiG9w0BAQUFADA9MQ4wDAYDVQQDDAVrYW5p
14
- czEXMBUGCgmSJomT8ixkARkWB2NvbWNhcmQxEjAQBgoJkiaJk/IsZAEZFgJkZTAe
15
- Fw0xNTAyMjYxNDIyNDRaFw0xNjAyMjYxNDIyNDRaMD0xDjAMBgNVBAMMBWthbmlz
16
- MRcwFQYKCZImiZPyLGQBGRYHY29tY2FyZDESMBAGCgmSJomT8ixkARkWAmRlMIIB
17
- IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApop+rNmg35bzRugZ21VMGqI6
18
- HGzPLO4VHYncWn/xmgPU/ZMcZdfj6MzIaZJ/czXyt4eHpBk1r8QOV3gBXnRXEjVW
19
- 9xi+EdVOkTV2/AVFKThcbTAQGiF/bT1n2M+B1GTybRzMg6hyhOJeGPqIhLfJEpxn
20
- lJi4+ENAVT4MpqHEAGB8yFoPC0GqiOHQsdHxQV3P3c2OZqG+yJey74QtwA2tLcLn
21
- Q53c63+VLGsOjODl1yPn/2ejyq8qWu6ahfTxiIlSar2UbwtaQGBDFdb2CXgEufXT
22
- L7oaPxlmj+Q2oLOfOnInd2Oxop59HoJCQPsg8f921J43NCQGA8VHK6paxIRDLQID
23
- AQABozkw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OC23BvyHXzCtcFsXCoEkt+Wwh0RFqVZdnjM
22
+ LMO2vULHKKHDdX54K/sbVCj9pN9h1aotNzrEyo55zxn0G9PHg/G3P8nMvAXPkUTe
23
+ brhXrfCwWRvOXA4TAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0G
24
+ A1UdDgQWBBRAHK81igrXodaDj8a8/BIKsaZrETANBgkqhkiG9w0BAQUFAAOCAQEA
25
+ MSeqyuvnysrcVerV+iQHfW1k53W8sl0pA8f8t/VFp7fUfKXJ9K7AGby4y9xOsqII
26
+ AeHuFrYoCxgoJL2k088/IKdu5bsuJ4FWzDpIV70uSOZsPKhlBiLqDLvccFnB/XBe
27
+ 3qSVN9x1I/lkVT4j55MqKjvvkn5GCfKz6JLPHgwEihiV0qmgsX2uZnxU4JbAbI5R
28
+ 4NX+7Dq+AuZUp5MtQslByeESOalT3SBfXSQ8QkZPwMVstsRm2h+0kVRu/AQHiGwJ
29
+ 6jkDey5mE3jQb893U6ihl55uLkVQwxZZTq/flNWjTIcbbvKKafEGdGv5uOlB+KRL
30
+ PRtgPFlA2jDgUr1EPAIH1Q==
31
31
  -----END CERTIFICATE-----
32
- date: 2015-05-28 00:00:00.000000000 Z
32
+ date: 2015-06-08 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: bundler
@@ -59,7 +59,9 @@ dependencies:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '10.0'
62
- description: Use rake-compiler-dock to enter an interactive shell session.
62
+ description: |-
63
+ Easy to use Docker based cross compiler environment for building binary windows gems.
64
+ Use rake-compiler-dock to enter an interactive shell session or add a task to your Rakefile to automate your cross build.
63
65
  email:
64
66
  - lars@greiz-reinsdorf.de
65
67
  executables:
@@ -82,6 +84,7 @@ files:
82
84
  - src/runas
83
85
  - src/sigfw.c
84
86
  - src/strip_wrapper
87
+ - src/sudoers
85
88
  homepage: https://github.com/larskanis/rake-compiler-dock
86
89
  licenses:
87
90
  - MIT
@@ -107,3 +110,4 @@ signing_key:
107
110
  specification_version: 4
108
111
  summary: Docker based cross compiler environment for building binary windows gems.
109
112
  test_files: []
113
+ has_rdoc:
metadata.gz.sig CHANGED
Binary file