[Rubygems-developers] gem building native extensions

Aaron Patterson aaron_patterson at speakeasy.net
Wed Apr 5 13:04:09 EDT 2006


Hi, I'm building a native extention in a gem, and gem seems to be
removing $(target_prefix) from the end of RUBYARCHDIR, and RUBYLIBDIR in
the Makefile.  Because of that, my library doesn't get installed in to
the correct directory.  Is this expected functionality?

I modified gem, to not remove that variable, and my gem installed
properly.  I've included the patch below.

--Aaron

Index: lib/rubygems/installer.rb
===================================================================
RCS file: /var/cvs/rubygems/rubygems/lib/rubygems/installer.rb,v
retrieving revision 1.110
diff -u -r1.110 installer.rb
--- lib/rubygems/installer.rb 5 Apr 2006 14:40:30 -0000 1.110
+++ lib/rubygems/installer.rb 5 Apr 2006 16:57:12 -0000
@@ -570,8 +570,8 @@
       results = []
       raise unless File.exist?('Makefile')
       mf = File.read('Makefile')
-      mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$.*/, "RUBYARCHDIR = #{dest_path}")
-      mf = mf.gsub(/^RUBYLIBDIR\s*=\s*\$.*/, "RUBYLIBDIR = #{dest_path}")
+      mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$[^$]*/, "RUBYARCHDIR = #{dest_path}")
+      mf = mf.gsub(/^RUBYLIBDIR\s*=\s*\$[^$]*/, "RUBYLIBDIR = #{dest_path}")
       File.open('Makefile', 'wb') {|f| f.print mf}

       make_program = ENV['make']


More information about the Rubygems-developers mailing list