reduce-algebra portfile dev
Ryan Schmidt
ryandesign at macports.org
Wed Aug 24 11:30:09 PDT 2011
On Aug 21, 2011, at 12:39, Mark Brethen wrote:
> On Aug 20, 2011, at 9:42 PM, Joshua Root wrote:
>> On 2011-8-21 12:35 , Mark Brethen wrote:
>>> It sounds like manual Portfile scripting is necessary?
>>
>> Yes, something like:
>>
>> destroot {
>> xinstall ${worksrcpath}/bin/redcsl ${destroot}${prefix}/bin
>> }
>
> The bin directory has several shell scripts also, and are intended to provide an easy way to launch
> Reduce. The readme has this to say:
>
> This remark may seem obvious, but the important aspect of it
> is that these scripts identify directories where various Reduce resources are
> to be found, and contain curious-looking code to do this. However you should
> not copy any of these scripts and place them in a directory other than here
> since they rely on paths relative to the place where they themselves live.
>
> The redcsl.sh contains:
>
> #! /bin/sh
> a=$0
> c=unknown
> case $a in
> /* )
> c=$a
> ;;
> */* )
> case $a in
> ./* )
> a=`echo $a | sed -e s+./++`
> ;;
> esac
> c=`pwd`/$a
> ;;
> * )
> for d in $PATH
> do
> if test -x $d/$a
> then
> c=$d/$a
> fi
> done
> if test $c = "unknown" ;then
> echo "Unable to find full path for script. Please re-try"
> echo "launching it using a fully rooted path."
> exit 1
> fi
> ;;
> esac
> while test -h "$c"; do
> lt=`ls -l "$c" | sed 's/.*->[ ]\+//'`
> if echo "$lt" | grep -q '^/'; then
> c="$lt"
> else
> dir=`dirname "$c"`
> c="$dir/$lt"
> fi
> done
> here=`echo $c | sed -e 's+/[^/]*$++;s+/[^/]*$++'`
> exec $here/scripts/run.sh $here/scripts reduce redcsl $*
>
> I expect the last line calls the binary that is compiled and probably need to stage the pertinent scripts as well as the binary.
Then it sounds like you need to copy not only the redcsl binary but also all of its supporting files, at the same relative locations, into ${destroot}${prefix}. Since the other items would probably end up in unsightly locations if redcsl goes in ${prefix}/bin, that means redcsl should not go in ${prefix}/bin; instead, consider putting it and everything else in ${prefix}/libexec/${name}. Then you can write a wrapper script and put it in ${prefix}/bin. Alternately, since redcsl.sh seems to be a wrapper script already, you could rewrite its logic.
> Also, the following are listed as Linux packages necessary for building CSL Reduce:
>
> g++
> libx11-dev
> libxft-dev
> libxext-dev
> libncurses5-dev
>
> I gether that the MacPorts equivalent ports should go in a depends build statement in the Portfile.
g++ is the C++ compiler and is provided by Xcode. You don't declare a dependency on it; it's assumed to be there.
The others are in the following MacPorts ports:
xorg-libX11
Xft2
xorg-libXext
ncurses
You'll probably find their libraries are being linked to, which means they'll need to be library dependencies, not just build dependencies.
More information about the macports-dev
mailing list