Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#16993 closed enhancement (fixed)

RFE: have pkgconfig look for x11 libraries

Reported by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc:
Port: pkgconfig

Description

May I humbly suggest that pkg-config search in both
${prefix}/lib/pkgconfig and ${x11prefix}/lib/pkgconfig
for .pc files.

Attached is the proposed change.

While looking at the gtk2 port, I noticed that its configure script
could not find several X11 libraries it was looking for.
I looked into creating MacPorts versions, but I would have ended up porting
the entire system.

Another example is xrender.
I have been testing a newer version.
The xrender.pc file depends on x11.pc, which resides in ${x11prefix}/lib/pkgconfig.
Were I to make the upgrade, all ports which use xrender would have to set
the PKG_CONFIG_PATH variable.

All of this is possible, but it seems to me that as a matter of both convenience
and elegancy, pkgconfig should search for X11 libraries by default.
After all, many ports do in fact use the X11 libraries.

The rare port which genuliy does not want to search for X11 libraries can set
the PKG_CONFIG_LIBDIR variable.

My proposed change sets the search order so MacPorts libraries are found first.

Attachments (1)

Portfile.diff (603 bytes) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 15 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 15 years ago by afb@…

Another interesting aspect of this is that the pkgconfig of Tiger's X11 is severely limited. Like missing x11.pc itself, which causes some ports trusting pkg-config output to believe that there is no X11 installed... (e.g. xfce4-settings)

And yes, Leopard's X11 is better (in that respect).

Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: Portfile.diff added

comment:2 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Ok, that patch sets these pkgconfig paths: ${prefix}/lib/pkgconfig:${prefix}/share/pkgconfig:${x11prefix}/lib/pkgconfig

Why does some software install pkgconfig files into ${prefix}/share/pkgconfig?

comment:3 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

I did not know this until recently, but the default search path (set in the configure script) for pkg-config is
pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig',
which is ${prefix}/lib/pkgconfig and ${prefix}/share/pkgconfig.

On my machine, gnome-mime-data, gtk-doc, iso-codes, and shared-mime-info install .pc files into ${prefix}/share/pkgconfig.

comment:4 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

May I go ahead and commit this patch?

comment:5 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Status: newassigned

Sorry -- I'll commit it right now.

comment:6 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Committed in r42121. Thanks for the suggestion!

comment:7 Changed 15 years ago by (none)

Milestone: Port Enhancements

Milestone Port Enhancements deleted

Note: See TracTickets for help on using tickets.