LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-29-2019, 04:46 PM   #1
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Rep: Reputation: 12
Looking for generic way to locate *.pc


This is about third time I need to satisfy "package dependency".

In an essence - how do I get from "dbus-1" to add reference to "dbus-1.pc"?

I did checked for package "dbus" and I have one.
I did search (find) for just dbus.pc and found none.

I have no "dbus-1" nor any associated files,including "dbus-1.pc"

It looks as there is some magic in versioning Linux packages and from previous experience "configure" and "pkg-config" is able to work with correct
package version.

And I need to do the same. So I am asking for generic way to download /install - what dbus version to have "dbus-1" package?

I am hoping it is "distro" independent and "apt" should be able to select correct architecture from repository.



Code:
   
 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.6\""; } >&5
  ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.6") 2>&5  2>&6  # echo to screen too 
printf "\033[1;31m\n@line $LINENO DEBUG no dbus-1  TOK  (?)  \033[0m\n"
exit
pkg-config output

Quote:
Looking for package 'dbus-1'
Looking for package 'dbus-1-uninstalled'
Package dbus-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dbus-1' found
 
Old 04-29-2019, 07:56 PM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,972

Rep: Reputation: 271Reputation: 271Reputation: 271
The environment variable $PKG_CONFIG_PATH points to the directories searched for package files.
Code:
locate dbus | grep pc
should produce few-enough results. dbus-1.pc is in the dbus-1.12.12-x86_64-1 package of Slackware
 
1 members found this post helpful.
Old 04-29-2019, 08:29 PM   #3
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Thanks,
yes, that is the environment variable need to be set but I needed to find the *.pc path first.

I found the following *.pc location using your code, but why I could not find it using find . -name "dbus*.pc " ?



/usr/lib/x86_64-linux-gnu/pkgconfig/dbus-1.pc



Thanks again for your help.
 
Old 04-29-2019, 08:39 PM   #4
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,972

Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by AnneRanch View Post
why I could not find it using find . -name "dbus*.pc " ?
Because you started in the wrong directory? I just went to / and ran it and it worked.
 
1 members found this post helpful.
Old 04-30-2019, 12:23 AM   #5
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Code:
$ pkgconf --path dbus-1
/usr/lib64/pkgconfig/dbus-1.pc
 
Old 04-30-2019, 08:30 AM   #6
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by orbea View Post
Code:
$ pkgconf --path dbus-1
/usr/lib64/pkgconfig/dbus-1.pc
Unfortunately after installing pkgconf I got "invalid option -- path " .
I'll check why.

Anyway, excellent post!
Appreciate it.
 
Old 04-30-2019, 08:32 AM   #7
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by RandomTroll View Post
Because you started in the wrong directory? I just went to / and ran it and it worked.
Yes, mea culpa !
 
Old 04-30-2019, 08:37 AM   #8
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Quote:
Originally Posted by AnneRanch View Post
Unfortunately after installing pkgconf I got "invalid option -- path " .
I'll check why.

Anyway, excellent post!
Appreciate it.
You must have pkg-config and not pkgconf, the latter is a newer and better supported implementation. I confirmed that pkg-config does not have --path here either.
 
Old 04-30-2019, 09:12 AM   #9
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by orbea View Post
You must have pkg-config and not pkgconf, the latter is a newer and better supported implementation. I confirmed that pkg-config does not have --path here either.
Yea, but the pkgconf man HAS --path option. And that is what counts, or should count.
But there is no "path" in --help file.

Perhaps another "orphaned" application, replaced with "new and improved" pkg-config but missing "path" option.
( No further comments necessary )


As I said - I will be looking into this , but later.
Your contribution is appreciated,


Quote:
jim@jim-desktop:~$ dpkg -l "pkgconf"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii pkgconf 0.9.12-1 amd64 manage compile and link flags for
jim@jim-desktop:~$
 
Old 04-30-2019, 09:24 AM   #10
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
I think I see the problem, your dpkg output claims you have pkgconf-0.9.12 while I have the most recent release, 1.6.1.

Code:
$ pkgconf --help | grep -- --path
  --path                            show the exact filenames for any matching .pc
See their release tarballs here.

https://distfiles.dereferenced.org/pkgconf/

And their git repo.

https://git.dereferenced.org/pkgconf/pkgconf

Edit:

Their NEWS file claims --path was added in 1.2.0.

Quote:
Changes from 1.1.0 to 1.2.0:
----------------------------

* Features:
- new --path option lists the .pc files which provided the requested dependencies
https://git.dereferenced.org/pkgconf...192e/NEWS#L226

Last edited by orbea; 04-30-2019 at 09:28 AM.
 
Old 04-30-2019, 09:56 AM   #11
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by orbea View Post
I think I see the problem, your dpkg output claims you have pkgconf-0.9.12 while I have the most recent release, 1.6.1.

Code:
$ pkgconf --help | grep -- --path
  --path                            show the exact filenames for any matching .pc
See their release tarballs here.

https://distfiles.dereferenced.org/pkgconf/

And their git repo.

https://git.dereferenced.org/pkgconf/pkgconf

Edit:

Their NEWS file claims --path was added in 1.2.0.


https://git.dereferenced.org/pkgconf...192e/NEWS#L226
OK,
Can't help to comment - why do I always pick wrong hammer?
Cheers

Last edited by AnneRanch; 04-30-2019 at 09:57 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] setting up initrd / generic kernel in Grub2...can't load generic Ubunoob001 Slackware 12 03-20-2015 07:32 AM
what are initrd.img-2.6.28-11-generic and vmlinuz-2.6.28-11-generic? karuna-bdc Linux - Newbie 11 07-17-2009 05:00 AM
Update from 2.6.27-13-generic to 2.6.27-14-generic fails bobreeves Linux - Kernel 1 03-19-2009 09:02 AM
GART TLB error generic level generic Clydesdale Linux - Software 1 08-13-2007 06:47 PM
GART TLB error generic level generic Clydesdale Linux - Hardware 0 08-13-2007 06:18 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration