dep_selector 1.0.0.alpha.1 → 1.0.0.alpha.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
1
  ---
2
2
  SHA1:
3
- metadata.gz: eedf57363ca865a2274f202af0d5c2744d107f0e
4
- data.tar.gz: 8b0012e3789d25b4ebca6abdadf95937ab8a7f2f
3
+ metadata.gz: 8649fd62eb39c437fc17f2c7ed3ac12e3cbd0f17
4
+ data.tar.gz: b99d4e37b75f12200d9fa69e981b202651aac449
5
5
  SHA512:
6
- metadata.gz: cd94581cafdd7dc198c84fe25cf21eb5de8112d4f24ed767ef326ddc996d1e61f1bc68eda06f11ed9a872855328c95822e890a0eb0208a55d08052d1fd9c76a6
7
- data.tar.gz: a2e9623c53220191aedcbb01ba33a3efe27f1ee5cb7728634172fe7c60393ffa49fdd9905dbd00706e14cf4dd4adff248f9855314e0879ae3ce952528470d1e2
6
+ metadata.gz: 3d58e22b2f94b5f944b7d0121ca890ae258e699d369b9186fa3c2c7989131f64108d85d5cdfaeb8700fbcde90322591d420542e888efbd6c6f6d756a406d68ad
7
+ data.tar.gz: d8283e0b999e49288d31db6c6ae670ac12b96598de634a7c904d8424f0381c7f8369848ea0f992ef7b8d8456d240fc27109011035ed0008fb264046d81fe868d
@@ -24,8 +24,13 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
24
24
  # ./configure --with-architectures=i386,x86_64
25
25
  # to work properly here.
26
26
  require 'mkmf'
27
+ require 'dep-selector-libgecode'
27
28
 
28
- # $CFLAGS << "-g"
29
+ opt_path = DepSelectorLibgecode.opt_path
30
+ include_path = DepSelectorLibgecode.include_path
31
+ find_library("gecodesupport", nil, opt_path)
32
+ # find_header doesn't seem to work for stuff like `gecode/thing.hh`
33
+ $INCFLAGS << " -I#{include_path}"
29
34
 
30
35
  gecode_installed =
31
36
  # Gecode documentation notes:
@@ -57,21 +62,32 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
57
62
  unless gecode_installed
58
63
  STDERR.puts <<EOS
59
64
  =========================================================================================
60
- Gecode >3.5 must be installed (http://www.gecode.org/).
65
+ Gecode ~>3.5 must be installed (http://www.gecode.org/).
61
66
 
62
67
  OSX:
68
+ cd $( brew --prefix )
69
+ git checkout 3c5ca25 Library/Formula/gecode.rb
63
70
  brew install gecode
64
71
 
65
- For convenience, we have built Gecode for Debian/Ubuntu (<release> is lucid or maverick):
66
- Add the following two lines to /etc/apt/sources.list.d/opscode.list:
67
- deb http://apt.opscode.com <release> main
68
- deb-src http://apt.opscode.com <release> main
69
- Then run:
70
- curl http://apt.opscode.com/packages@opscode.com.gpg.key | sudo apt-key add -
71
- sudo apt-get update
72
- sudo apt-get install libgecode-dev
72
+ Debian and Ubuntu:
73
+ sudo apt-get install libgecode-dev
74
+
75
+ Build from source:
76
+ Get gecode 3.7.3 source:
77
+ curl -O http://www.gecode.org/download/gecode-3.7.3.tar.gz
78
+ Unpack it:
79
+ tar zxvf gecode-3.7.3.tar.gz
80
+ Build:
81
+ ./configure --disable-doc-dot \
82
+ --disable-doc-search \
83
+ --disable-doc-tagfile \
84
+ --disable-doc-chm \
85
+ --disable-doc-docset \
86
+ --disable-qt \
87
+ --disable-examples
88
+ make
89
+ (sudo) make install
73
90
 
74
- Other distributions can build from source.
75
91
  =========================================================================================
76
92
  EOS
77
93
  raise "Gecode not installed"
@@ -83,6 +99,22 @@ else # JRUBY
83
99
  require 'rbconfig'
84
100
  require 'ffi/platform'
85
101
 
102
+ incflags = "-I."
103
+ libpath = "-L."
104
+
105
+ require 'dep-selector-libgecode'
106
+ opt_path = DepSelectorLibgecode.opt_path
107
+ include_path = DepSelectorLibgecode.include_path
108
+ libpath << " -L#{opt_path}"
109
+
110
+ # On MRI, RbConfig::CONFIG["RPATHFLAG"] == "" when using clang/llvm, but this
111
+ # isn't set on JRuby so we need to detect llvm manually and set rpath on gcc
112
+ unless `gcc -v` =~ /LLVM/
113
+ rpath_flag = (" -Wl,-R%1$-s" % [opt_path])
114
+ libpath << rpath_flag
115
+ end
116
+ incflags << " -I#{include_path}"
117
+
86
118
  cflags = ENV['CFLAGS']
87
119
  cppflags = ENV['CPPFLAGS']
88
120
  cxxflags = ENV['CXXFLAGS']
@@ -121,6 +153,8 @@ else # JRUBY
121
153
  ENV['CXX'] = cxx
122
154
  ENV["CPPFLAGS"] = cppflags
123
155
  ENV["CXXFLAGS"] = cxxflags
156
+ ENV['INCFLAGS'] = incflags
157
+ ENV['LIBPATH'] = libpath
124
158
 
125
159
  dlext = FFI::Platform::LIBSUFFIX
126
160
 
@@ -145,7 +179,9 @@ CFLAGS = #{ENV['CFLAGS']}
145
179
  LDFLAGS = #{ENV['LDFLAGS']}
146
180
  CPPFLAGS = #{ENV['CPPFLAGS']}
147
181
  CXXFLAGS = #{ENV['CXXFLAGS']}
148
- INCFLAGS = -I.
182
+ INCFLAGS = #{ENV['INCFLAGS']}
183
+ LIBPATH = #{ENV['LIBPATH']}
184
+
149
185
  LDSHAREDXX = #{ldsharedxx}
150
186
 
151
187
  empty =
@@ -1,3 +1,3 @@
1
1
  module DepSelector
2
- VERSION = "1.0.0.alpha.1"
2
+ VERSION = "1.0.0.alpha.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dep_selector
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.1
4
+ version: 1.0.0.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Walters
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-04 00:00:00.000000000 Z
12
+ date: 2014-04-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -25,6 +25,20 @@ dependencies:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  version: '1.9'
28
+ - !ruby/object:Gem::Dependency
29
+ name: dep-selector-libgecode
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: 1.0.0.alpha
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ version: 1.0.0.alpha
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: rake
30
44
  requirement: !ruby/object:Gem::Requirement