[nycbug-talk] FreeBSD Porting

Steven Kreuzer skreuzer at f2o.org
Mon Oct 23 22:46:30 EDT 2006


Johnny Lam wrote:
> Steven Kreuzer wrote:
>>
>> .if defined(WITH_GEODNS)
>> LIB_DEPENDS=   GeoIP.5:${PORTSDIR}/net/GeoIP
>> BUILD_DEPENDS= ${LOCALBASE}/include/GeoIP.h:${PORTSDIR}/net/GeoIP
>> RUN_DEPENDS=   ${LIB_DEPENDS}
>> CONFIGURE_ENV+= LDFLAGS="-L${LOCALBASE}/lib -lGeoIP"
>> CFLAGS="-I${LOCALBASE}/include"
>> .endif
>>
>> However, I also need to apply 3 patches the the bind source to enable
>> this feature. I created diff's and put them in the files directory.
>> However, those patches get applied regardless of the options selected.
>>
>> Do you know of any way to apply those patches only if WITH_GEODNS is
>> true? According to the porter handbook, it looks like all or nothing?
>>
>> Anyone have any hacks or tricks?
>
> Make your patches look like:
>
> #ifdef GEODNS
> /* Your changes here. */
> #endif
>
> And change the above CFLAGS definition to:
>
> CFLAGS=    -DGEODNS -I${LOCALBASE}/include
>
>     Cheers,
>
>     -- Johnny Lam <jlam at pkgsrc.org>
I finally got around to adding those #ifndef's to the patch and it works 
like a charm.

Its funny how such an elegant solution can be so simple. I can't tell 
you how long I spent trying to think of a complex workaround.

Thanks Johnny.

SK



More information about the talk mailing list