Date: Mon, 28 Jan 2008 05:38:06 +0200 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: Ivan Rambius Ivanov <rambiusparkisanius@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: Slightly OT: Invoking a shell command from a Makeile Message-ID: <20080128033806.GA5932@kobe.laptop> In-Reply-To: <89ce7f740801271919n107c20a8v2341687285728fb1@mail.gmail.com> References: <89ce7f740801271448x27371cf7lfe5255256fb498ec@mail.gmail.com> <20080128005944.GA3072@kobe.laptop> <89ce7f740801271919n107c20a8v2341687285728fb1@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2008-01-28 05:19, Ivan Rambius Ivanov <rambiusparkisanius@gmail.com> wrote: > On Jan 28, 2008 2:59 AM, Giorgos Keramidas <keramida@ceid.upatras.gr> wrote: > > FPCVERSION!= make -f ${PORTSDIR}/lang/fpc/Makefile -V PORTVERSION > > Yes, I found this out after some searching in google. > > > I'm curious though. Why do you have to find the value of the > > {PORTVERSION} from a Ports makefile? > > > > Perhaps there is already a `standard' feature of the Ports which can do > > something similar. Have you asked around in freebsd-ports? > > The port I am developing builds and installs a software called nbc > [1], [2]. It is written in Pascal and uses the freepascal compiler [3] > coming from lang/fpc port and some other pascal libraries called units > coming from devel/fpc-fcl-base. These units are installed into > /usr/local/lib/fpc/<portversion_of_fpc>, where portversion of_fpc is > the version of the freepascal compiler as defined in PORTVERSION > variable in fpc's Makefile. Currently it is 2.2.0. I do not want to > hardcode that number in nbc port's Makefile - I want to extract it on > the fly from fpc port's Makefile, this is why I am doing this trick. That's interesting, but the *installed* copy of devel/fpc-fcl-base may be older than the available version in `/usr/ports'. Many programs install an `xxx-config' script too, which can be queried at runtime, i.e.: $ net-snmp-config --version 5.3.1 This runs from ${LOCALBASE} and it is *always* the same as the installed version of the net-snmp port. Maybe a similar script can be added to the devel/fpc-fcl-base port, if one is not already part of it? In a similar vein, the editors/emacs* ports support installing extensions in multiple subdirs of ${LOCALBASE} by switching make variables depending on the value of ${EMACS_PORT_NAME}. It's probably more work to make devel/fpc-fcl-base tunable like this, but it is going to be safer than assuming that the /usr/ports/lang/fpc version is actually the same as the installed version. This assumption is only true until the next CVSup of the ports tree, or until portsnap fetches a newer version of lang/fpc. I'm *not* a ports hacker, so some of the above may be false and all of it should be taken with a grain of salt, but I'm sure our freebsd-ports guys can help :) It's definitely worth asking them for the best way to implement something like this. - Giorgos
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080128033806.GA5932>