Date: Mon, 27 May 2002 21:22:31 -0400 From: "Matthew Emmerton" <matt@gsicomp.on.ca> To: "dannyman" <dannyman@toldme.com>, <freebsd-hackers@FreeBSD.ORG> Subject: Re: ruby ports and PREFIX Message-ID: <000b01c205e6$243e8810$1200a8c0@gsicomp.on.ca> References: <20020527175202.E27552@pianosa.catch22.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> So, what I'm doing here is experimenting with encap, a nifty little > package standard where the idea is that you install your software with > PREFIX set to /usr/local/encap/pkgname-version, and the package manager, > epkg, will look through that dir and symlink files from that hierarchy > in to /usr/local for you. It makes stuff like identifying the source of > a file, or rolling back to an earlier version of a software package, > downright trivial, > > Of course, in terms of FreeBSD, I like to use ports to build packages, > so I've patched up bsd.port.mk to re-define PREFIX for intallations, and > run the package manager after install completes, etc. Most ports work > really well, assuming they honor PREFIX. > > Which, ruby add-ons do not seem to do. For example, optparse: > > do-install: > ${MKDIR} ${RUBY_SITELIBDIR}/${PORTNAME} > ${INSTALL_DATA} ${WRKSRC}/optparse.rb ${RUBY_SITELIBDIR}/ > ${INSTALL_DATA} ${WRKSRC}/optparse/*.rb ${RUBY_SITELIBDIR}/${PORTNAME}/ > > What the heck is that? On my test system, the RUBY_SITELIBDIR is > defined by interrogating RUBY, and the result is > /usr/local/encap/ruby-1.6.7.2002.05.02p/lib/ruby/site_ruby/1.6 ... what > I REALLY want is for the Port to install files based on PREFIX, > /usr/local/encap/ruby-optparse-0.8.6, and then I will link them in to > the proper ruby site directories which contain files in /usr/local > symlinked to their appropriate source packages. > > A few questions: > > 1) Shouldn't the ruby add-on ports honor PREFIX? But they do! When you install Ruby, it will install into ${PREFIX}. By interrogating Ruby to get the RUBY_SITELIBDIR, you'll get the proper site library directory, which is most definitely under ruby's install directory, which is under the ${PREFIX} that was specified at compile-time. > 2) To that end, is there a good way to define RUBY_SITELIBDIR and > friends in bsd.ruby.mk to honor PREFIX? See above. > 3) Once I symlink new files in to the ruby file hierarchy, so I have to > do any magic for Ruby to pick up to this fact? Is ruby going to do > anything troublesome like go looking in the encap directory it was built > for, instead of /usr/local? As long as the files can be found (physically or via symlinks) via the RUBY_SITELIBDIR that ruby think it's using, you shouldn't have any problems. IIRC, this situation is one of the reasons why Perl is coming out of the base system in -CURRENT right now, in order to make all things Perl PREFIX-clean. -- Matt Emmerton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000b01c205e6$243e8810$1200a8c0>