Creating a port where a dependency requires the port's source

Ashley Moran work at ashleymoran.me.uk
Sat Nov 25 09:47:24 PST 2006


Hi

This is my first time writing a Portfile.  I'm trying to write a port  
so I can install Ruby with the oniguruma regular expression library.   
I've created a folder for the test ports, and added file:///Users/ 
ashleymoran/Documents/Development/dports-dev to /opt/local/etc/ports/ 
sources.conf .

The change to the ruby port is just a variant, but I've created a new  
port for the time being:
~/Documents/Development/dports-dev/lang/ruby-oniguruma/Portfile:
   ... existing ruby portfile...
   variant oniguruma {
     depends_lib-append port:oniguruma2
   }

And I've made a new port for the oniguruma 2.x:

~/Documents/Development/dports-dev/devel/onigurama2/Portfile:
   # $Id: $
   PortSystem        1.0
   name              oniguruma2
   version           2.5.8
   categories        devel
   maintainers       work at ashleymoran.me.uk
   description       A regular expressions library.
   long_description \
       Oniguruma is a regular expressions library in which \
       different character encoding can be specified for every  
expression. \
       Version 2.x is for Ruby 1.8
   homepage          http://www.geocities.jp/kosako3/oniguruma/
   master_sites      http://www.geocities.jp/kosako3/oniguruma/archive/

   distname          onigd2_5_8
   checksums   md5   82cd47ded85f854149ae620a9fa728e5
   #configure.args    --with-rubydir=../../lang/ruby-oniguruma/work/ruby
   configure.args    --with-rubydir=/opt/local/var/db/dports/build/ 
_Users_ashleymoran_Documents_Development_dports-dev_lang_ruby- 
oniguruma/work/ruby

   worksrcdir        oniguruma
   build.cmd         make 185

Note the hideous configure.args is just my attempt to locate the  
source of the ruby port.

But this is where I come unstuck.  This is the install process for  
oniguruma is this:
   (in oniguruma directory)
      1. ./configure --with-rubydir=<ruby-source-dir>
      2. make 185    # for Ruby 1.8.5

But when I do "port build ruby-oniguruma +oniguruma", it seems to go  
off and build oniguruma *before* it's extracted the ruby source, so  
there's nothing in the work directory for it to patch.

Has this build pattern occured before?  Is there any way round the  
order MacPorts uses for building dependencies?  I'm completely new to  
this so I thought I'd ask for help.

Also, regardless of whether it's possible to do it cleanly, I've got  
two questions about the Portfile above:

1. how do I calculate the ruby work directory for the line  
"configure.args --with-rubydir="?

2. although I set build.cmd to "make 185", MacPorts uses the build  
command "make 185 all".  How do you stop this?


Thanks in advance for any advice

Ashley



More information about the macports-users mailing list