[Rubygems-developers] The return of PLATFORM constants
Daniel.Berger at qwest.com
Thu May 15 10:23:24 EDT 2008
> -----Original Message-----
> From: rubygems-developers-bounces at rubyforge.org
> [mailto:rubygems-developers-bounces at rubyforge.org] On Behalf
> Of Eric Hodel
> Sent: Thursday, May 15, 2008 1:46 AM
> To: rubygems-developers at rubyforge.org
> Subject: Re: [Rubygems-developers] The return of PLATFORM constants
> On May 11, 2008, at 10:18 AM, Daniel Berger wrote:
> > I have a few C extensions where I would like to be able to
> provide a
> > way to specify a generic platform.
> > For example, the sys-cpu source is the same for both
> FreeBSD and OS X.
> > However, as things stand now I must create two separate
> gems - one for
> > each platform. Here's where a Gem::Platform::BSD constant would be
> > very handy. Or whatever you want to call it.
> The same binary works on FreeBSD and OS X? Or is it a
> source-only gem?
> If it is a source-only gem, is there a way to handle this
> with extconf.rb instead? While OS X has FreeBSD roots, the
> two don't have completely compatible internals, so its hard
> to describe this in RubyGems.
That's what I do. But what do I set the Gem::PLATFORM to? I can't just
use 'CURRENT', because FreeBSD won't pickup an OS X gem. I can't use
'RUBY' because there are other platforms, too.
The only solution I've got so far is to either create separate gems, or
just lump _all_ of the source files together and let extconf.rb sort it
out. The latter approach works, but the downside to that approach is
that I can't be specific about the rdoc files, so I end up a bunch of
extra .c files (from other platforms) that get picked up during rdoc
> > I'm in a similar situation with gems that aren't particular to any
> > version of a given platform or compiler. For example, the sys-cpu
> > source for Solaris is the same for any version of Solaris,
> be it 2.6
> > or 2.10. Here's where a Gem::Platform::SOLARIS would be very handy.
> > Is there any chance of adding these? If not, what are my options
> > outside of building a gem on every platform?
> You should be able to hand-specify a platform with something
> like Gem::Platform.new 'x86-freebsd', but there seems to be a bug.
I'll see what I can see. :)
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
More information about the Rubygems-developers