Optionally depending on KDE4

Max Brazhnikov makc at freebsd.org
Mon Jun 15 18:19:48 UTC 2009


On Mon, 15 Jun 2009 09:16:47 -0600, hideo wrote:
> Max Brazhnikov (Mon 06/15/09 14:28):
> > On Sun, 14 Jun 2009 10:43:29 -0600, hideo wrote:
> > > Hi everyone,
> > >
> > > I'm trying to update audio/pacpl to the latest version which has
> > > dropped support for KDE3 and added support for KDE4. By "support"
> > > I mean it offers Konqueror and Dolphin service menu integration.
> > >
> > > How do I optionally pull in the KDE4 prefix and base, e.g.
> > > USE_KDE4=kdeprefix kdebase, as a dependency if either of
> > > these options are selected?
> >
> > It's described in handbook:
> > http://www.freebsd.org/doc/en/books/porters-handbook/makefile-
> > options.html#AEN2441
> >
> > In your case the code may look as following:
> >
> > OPTIONS=	KDE4 " Konqueror and Dolphin service menu integration" off
> >
> > .include <bsd.port.options.mk>
> >
> > .if defined(WITH_KDE4)
> > USE_KDE4=		kdeprefix kdebase
> > PLIST_SUB+=	KDE=""
> > .else
> > PLIST_SUB+=	KDE="@comment "
> > .endif
> >
> > .include <bsd.port.mk>
>
> Thanks Max. I had tried something similar but still had
> <bsd.port.pre.mk> so it bombed.
>
> > > Also, I notice that when these KDE4
> > > options are set, everything the port installs goes in KD4_PREFIX,
> > > including config, data, doc, and shared files.  Are users expected
> > > to know that KDE4 dependent ports have their config files, for example,
> > > in /usr/local/kde4/etc instead of /usr/local/etc?
> >
> > I expect this is rhetoric question :)
>
> Not really but I think it was due to my misunderstanding of what
> kdeprefix did.  By not adding that to USE_KDE4 I still have access to
> KDE4_PREFIX without everything getting installed there.

kdeprefix redefines PREFIX from its default value ${LOCALBASE} to 
${KDE4_PREFIX} (which is ${LOCALBASE}/kde4 currently, however it will be 
changed to pure ${LOCALBASE} after removal kde3 from portstree).

Whether a port should use kdeprefix it depends on how closely the port is 
tight to KDE4. Kde-dependent ports should go to KDE4_PREFIX mostly. If port 
does't use kde libraries (e.g. gtk based apps), but provides integration 
support for KDE4, then you may want to avoid kdeprefix.

> The only thing I'm still trying to figure out is how to get the
> difference, if any, between LOCALBASE and KDE4_PREFIX for the PLIST_SUB
> on the KDE4 related options. If I put the following in pkg-plist
>
> 	%%DOLPHIN%%share/kde4/services/ServiceMenus/dolphin/pacpl.desktop
> 	%%KONQUEROR%%share/kde4/services/ServiceMenus/konqueror/pacpl.desktop
>
> when it comes time to deinstall it fails because the paths are obviously
> relative to LOCALBASE.  However, I don't want to hardcode the difference
> in the paths, e.g. kde4, unless necessary, since it could change.

You can use @cwd directive in plist for this case:

stuff/that/lives/in/localbase
@cwd %%KDE4_PREFIX%%
%%DOLPHIN%%share/kde4/services/ServiceMenus/dolphin/pacpl.desktop
%%KONQUEROR%%share/kde4/services/ServiceMenus/konqueror/pacpl.desktop

just add PLIST_SUB+=	KDE4_PREFIX="${KDE4_PREFIX}" to Makefile.

> It
> seems like the thing to do would be to remove LOCALBASE from KDE4_PREFIX
> and add that to PLIST_SUB, though I'm not quite sure how to do that. Am
> I thinking about this in the wrong way?
>
> > Max
>
> Zach
Send me PR when you are ready and I'll commit it for you,

Max


More information about the freebsd-ports mailing list