]> git.wincent.com - wikitext.git/commitdiff
Attempted fix for build issues on Linux with RubyGems 2.0.0
authorWincent Colaiuta <win@wincent.com>
Wed, 27 Feb 2013 08:37:46 +0000 (00:37 -0800)
committerWincent Colaiuta <win@wincent.com>
Wed, 27 Feb 2013 08:44:52 +0000 (00:44 -0800)
On Linux the build is failing with:

  make install
  /usr/bin/install -c -m 0755 wikitext.so /data/shared/bundle/ruby/2.0.0/gems/wikitext-4.0/ext
  /usr/bin/install: `wikitext.so' and `/data/shared/bundle/ruby/2.0.0/gems/wikitext-4.0/ext/wikitext.so' are the same file

Looks to affect many gems with native components:

  https://github.com/rubygems/rubygems/issues/411
  https://bugs.ruby-lang.org/issues/7344
  https://bugs.ruby-lang.org/issues/7698

The workaround applied here is to move the extension files down one
level in the hierarchy.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
21 files changed:
Rakefile
ext/wikitext/.autotest [moved from ext/.autotest with 100% similarity]
ext/wikitext/.gitignore [moved from ext/.gitignore with 70% similarity]
ext/wikitext/ary.c [moved from ext/ary.c with 100% similarity]
ext/wikitext/ary.h [moved from ext/ary.h with 100% similarity]
ext/wikitext/depend [moved from ext/depend with 100% similarity]
ext/wikitext/extconf.rb [moved from ext/extconf.rb with 100% similarity]
ext/wikitext/parser.c [moved from ext/parser.c with 100% similarity]
ext/wikitext/parser.h [moved from ext/parser.h with 100% similarity]
ext/wikitext/ruby_compat.h [moved from ext/ruby_compat.h with 100% similarity]
ext/wikitext/str.c [moved from ext/str.c with 100% similarity]
ext/wikitext/str.h [moved from ext/str.h with 100% similarity]
ext/wikitext/token.c [moved from ext/token.c with 100% similarity]
ext/wikitext/token.h [moved from ext/token.h with 100% similarity]
ext/wikitext/wikitext.c [moved from ext/wikitext.c with 100% similarity]
ext/wikitext/wikitext.dot [moved from ext/wikitext.dot with 100% similarity]
ext/wikitext/wikitext.h [moved from ext/wikitext.h with 100% similarity]
ext/wikitext/wikitext_ragel.c [moved from ext/wikitext_ragel.c with 100% similarity]
ext/wikitext/wikitext_ragel.h [moved from ext/wikitext_ragel.h with 100% similarity]
ext/wikitext/wikitext_ragel.rl [moved from ext/wikitext_ragel.rl with 100% similarity]
wikitext.gemspec

index cbae4f8b71433641bab862a05667cb3ca0b1e343..22e52f684391da54a5d932000a4a5d84c5d8cb8a 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -29,52 +29,52 @@ $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
 require 'wikitext/version'
 
 CLEAN.include   Rake::FileList['**/*.so', '**/*.bundle', '**/*.o', '**/mkmf.log', '**/Makefile']
-CLOBBER.include Rake::FileList['ext/wikitext_ragel.c']
+CLOBBER.include Rake::FileList['ext/wikitext/wikitext_ragel.c']
 
 task :default => :all
 
 desc 'Build all and run all specs'
 task :all => [:make, :spec]
 
-extension_makefile  = 'ext/Makefile'
-ragel               = 'ext/wikitext_ragel.c'
-built_extension     = "ext/wikitext.#{RbConfig::CONFIG['DLEXT']}" # wikitext.bundle (Darwin), wikitext.so (Linux)
+extension_makefile  = 'ext/wikitext/Makefile'
+ragel               = 'ext/wikitext/wikitext_ragel.c'
+built_extension     = "ext/wikitext/wikitext.#{RbConfig::CONFIG['DLEXT']}" # wikitext.bundle (Darwin), wikitext.so (Linux)
 extension_files     = FileList[
-  'ext/Makefile',
-  'ext/ary.c',
-  'ext/ary.h',
-  'ext/parser.c',
-  'ext/parser.h',
-  'ext/ruby_compat.h',
-  'ext/str.c',
-  'ext/str.h',
-  'ext/token.c',
-  'ext/token.h',
-  'ext/wikitext.c',
-  'ext/wikitext.h',
-  'ext/wikitext_ragel.c',
-  'ext/wikitext_ragel.h',
+  'ext/wikitext/Makefile',
+  'ext/wikitext/ary.c',
+  'ext/wikitext/ary.h',
+  'ext/wikitext/parser.c',
+  'ext/wikitext/parser.h',
+  'ext/wikitext/ruby_compat.h',
+  'ext/wikitext/str.c',
+  'ext/wikitext/str.h',
+  'ext/wikitext/token.c',
+  'ext/wikitext/token.h',
+  'ext/wikitext/wikitext.c',
+  'ext/wikitext/wikitext.h',
+  'ext/wikitext/wikitext_ragel.c',
+  'ext/wikitext/wikitext_ragel.h',
 ]
 
 desc 'Build C extension'
 task :make => [ragel, extension_makefile, built_extension]
 
-file ragel => ['ext/wikitext_ragel.rl'] do
-  Dir.chdir('ext') do
+file ragel => ['ext/wikitext/wikitext_ragel.rl'] do
+  Dir.chdir('ext/wikitext') do
     # pass the -s switch here because otherwise Ragel is totally silent
     # I like to have visual confirmation that it's actually run
     sh 'ragel -G2 -s wikitext_ragel.rl'
   end
 end
 
-file extension_makefile => ['ext/extconf.rb', 'ext/depend', ragel] do
-  Dir.chdir('ext') do
+file extension_makefile => ['ext/wikitext/extconf.rb', 'ext/wikitext/depend', ragel] do
+  Dir.chdir('ext/wikitext') do
     ruby 'extconf.rb'
   end
 end
 
 file built_extension => extension_files do
-  Dir.chdir('ext') do
+  Dir.chdir('ext/wikitext') do
     sh 'make && touch .built'
   end
 end
similarity index 100%
rename from ext/.autotest
rename to ext/wikitext/.autotest
similarity index 70%
rename from ext/.gitignore
rename to ext/wikitext/.gitignore
index 7589ca029e7b1b3e4f3562ed41d04586a689e66d..dd0c1bacd68cdfed7131f83832f84d7b5ffdad23 100644 (file)
@@ -2,6 +2,6 @@
 *.bundle
 *.so
 .built
+.RUBYARCHDIR.time
 Makefile
 mkmf.log
-
similarity index 100%
rename from ext/ary.c
rename to ext/wikitext/ary.c
similarity index 100%
rename from ext/ary.h
rename to ext/wikitext/ary.h
similarity index 100%
rename from ext/depend
rename to ext/wikitext/depend
similarity index 100%
rename from ext/extconf.rb
rename to ext/wikitext/extconf.rb
similarity index 100%
rename from ext/parser.c
rename to ext/wikitext/parser.c
similarity index 100%
rename from ext/parser.h
rename to ext/wikitext/parser.h
similarity index 100%
rename from ext/ruby_compat.h
rename to ext/wikitext/ruby_compat.h
similarity index 100%
rename from ext/str.c
rename to ext/wikitext/str.c
similarity index 100%
rename from ext/str.h
rename to ext/wikitext/str.h
similarity index 100%
rename from ext/token.c
rename to ext/wikitext/token.c
similarity index 100%
rename from ext/token.h
rename to ext/wikitext/token.h
similarity index 100%
rename from ext/wikitext.c
rename to ext/wikitext/wikitext.c
similarity index 100%
rename from ext/wikitext.dot
rename to ext/wikitext/wikitext.dot
similarity index 100%
rename from ext/wikitext.h
rename to ext/wikitext/wikitext.h
index d0ae941b49eeb625cc09fa1f6bcaab4b5983b8fd..dfc19d0c64e43bad4dfd1c750f7196bfdffd0b9b 100644 (file)
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
   s.required_ruby_version = '>= 2.0.0'
   s.summary               = 'Wikitext-to-HTML translator'
   s.require_paths         = ['ext', 'lib']
-  s.extensions            = ['ext/extconf.rb']
+  s.extensions            = ['ext/wikitext/extconf.rb']
   s.executables           = ['wikitext']
   s.files                 = Dir[
     'bin/wikitext',