From owner-freebsd-hackers Mon May 27 18:22:39 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from tomts13-srv.bellnexxia.net (tomts13.bellnexxia.net [209.226.175.34]) by hub.freebsd.org (Postfix) with ESMTP id 8CA9437B404 for ; Mon, 27 May 2002 18:22:34 -0700 (PDT) Received: from xena.gsicomp.on.ca ([65.95.179.11]) by tomts13-srv.bellnexxia.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20020528012233.BEBL16321.tomts13-srv.bellnexxia.net@xena.gsicomp.on.ca>; Mon, 27 May 2002 21:22:33 -0400 Received: from hermes (hermes.gsicomp.on.ca [192.168.0.18]) by xena.gsicomp.on.ca (8.11.3/8.11.3) with SMTP id g4S08hb31731; Mon, 27 May 2002 20:08:43 -0400 (EDT) (envelope-from matt@gsicomp.on.ca) Message-ID: <000b01c205e6$243e8810$1200a8c0@gsicomp.on.ca> From: "Matthew Emmerton" To: "dannyman" , References: <20020527175202.E27552@pianosa.catch22.org> Subject: Re: ruby ports and PREFIX Date: Mon, 27 May 2002 21:22:31 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > 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