rake-compiler-dock 0.1.0 → 0.2.0
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Dockerfile +4 -1
- data/History.md +7 -0
- data/README.md +17 -6
- data/bin/rake-compiler-dock +3 -27
- data/lib/rake_compiler_dock.rb +70 -1
- data/lib/rake_compiler_dock/version.rb +1 -1
- data/rake-compiler-dock.gemspec +2 -1
- data/src/rake-compiler-without-exts.diff +6 -4
- data/src/sudoers +1 -0
- metadata +25 -21
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9d812c3d58c67858e89228862019e7414399f0a
|
4
|
+
data.tar.gz: a49c40cc58b5687fac2b5b7d9f9fbeb50ab4cd5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63a62025d40a77e6ea621119b2103e4e6a3290e8f5556fc73daa2a2f4bce1c4c3eae57f3f1b9719a105b6c276098887c9a0fb8aab5d5e50d25d3ea9343da4445
|
7
|
+
data.tar.gz: cd2f86c14498ae4cfcd54f739a1f007c1bcf4a5e3a9bf6a1bfced80bc9420468e29f25269aab8a1e03952cb11b073a633758c028b27acfa2570aa781de8e73d6
|
checksums.yaml.gz.sig
CHANGED
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
|
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.
|
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
|
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
|
|
data/bin/rake-compiler-dock
CHANGED
@@ -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
|
-
|
19
|
-
|
20
|
-
|
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
|
data/lib/rake_compiler_dock.rb
CHANGED
@@ -1,5 +1,74 @@
|
|
1
1
|
require "rake_compiler_dock/version"
|
2
2
|
|
3
3
|
module RakeCompilerDock
|
4
|
-
#
|
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
|
data/rake-compiler-dock.gemspec
CHANGED
@@ -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{
|
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,
|
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
|
-
|
10
|
-
|
11
|
-
|
9
|
+
- '--without-tk',
|
10
|
+
- '--without-tcl'
|
11
|
+
+ '--with-ext='
|
12
12
|
]
|
13
|
+
|
14
|
+
# Force Winsock2 for Ruby 1.8, 1.9 defaults to it
|
data/src/sudoers
ADDED
@@ -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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: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DVR0PBAQDAgSwMB0G
|
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-
|
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:
|
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
|