#54861 closed defect (fixed)
mlt-qt5 install fails with the message "Package Qt5Core was not found in the pkg-config search path."
Reported by: | wilya7 | Owned by: | ddennedy (Dan Dennedy) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | RJVB (René Bertin) | |
Port: | mlt mlt-qt5 |
Description
Hello. I am not a developer, so I apologize for any mistake in this report. I could not find any other bug report on the trac site about mlt-qt5 not being able to be installed, so here is my report.
While doing a clean up with the command
port -f clean --all all
I got the script failing with the message:
Package Qt5Core was not found in the pkg-config search path.
while processing mlt-qt5 package.
If I try:
port -d install mlt-qt5
I get:
DEBUG: Copying /Users/cfusco/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences DEBUG: Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/multimedia/mlt DEBUG: OS darwin/16.7.0 (Mac OS X 10.12) arch i386 DEBUG: Reading variant descriptions from /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/_resources/port1.0/variant_descriptions.conf DEBUG: Sourcing PortGroup muniversal 1.0 from /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/_resources/port1.0/group/muniversal-1.0.tcl DEBUG: Re-registering default for supported_archs DEBUG: Sourcing PortGroup qt5 1.0 from /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/_resources/port1.0/group/qt5-1.0.tcl DEBUG: Package Qt5Core was not found in the pkg-config search path. Perhaps you should add the directory containing `Qt5Core.pc' to the PKG_CONFIG_PATH environment variable No package 'Qt5Core' found while executing "exec ${prefix}/bin/pkg-config --modversion Qt5Core" (procedure "qt5.active_version" line 4) invoked from within "qt5.active_version" invoked from within "if {${subport} eq "${name}"} { conflicts ${name}-qt5 PortGroup qt4 1.0 } else { conflicts ${name} PortGroup qt..." (file "Portfile" line 37) invoked from within "source Portfile" invoked from within "$workername eval {source Portfile}" (procedure "mportopen" line 41) invoked from within "mportopen $porturl [array get options] [array get requested_variations]" Error: Unable to open port: Package Qt5Core was not found in the pkg-config search path. Perhaps you should add the directory containing `Qt5Core.pc' to the PKG_CONFIG_PATH environment variable No package 'Qt5Core' found
this is my sw_vers output:
ProductName: Mac OS X ProductVersion: 10.12.6 BuildVersion: 16G29
I hope this report will be helpful. Thank you for your fantastic work on Macport.
Change History (21)
comment:1 Changed 7 years ago by raimue (Rainer Müller)
Cc: | RJVB added |
---|---|
Owner: | set to ddennedy |
Port: | mlt mlt-qt5 added |
Status: | new → assigned |
comment:2 Changed 7 years ago by RJVB (René Bertin)
comment:3 Changed 7 years ago by wilya7
Here
port -v info mlt-qt5
Hasbeen-MBP:~ cfusco$ sudo port -v info mlt-qt5 Password: Error: Unable to open port: Package Qt5Core was not found in the pkg-config search path. Perhaps you should add the directory containing `Qt5Core.pc' to the PKG_CONFIG_PATH environment variable No package 'Qt5Core' found
qt5-qtbase was not installed when I did the "port -f clean --all all". I install it now:
Hasbeen-MBP:~ cfusco$ sudo port install qt5-qtbase ---> Computing dependencies for qt5-qtbase The following dependencies will be installed: libmng Continue? [Y/n]: y ---> Fetching archive for libmng ---> Attempting to fetch libmng-2.0.3_0.darwin_16.x86_64.tbz2 from https://packages.macports.org/libmng ---> Attempting to fetch libmng-2.0.3_0.darwin_16.x86_64.tbz2.rmd160 from https://packages.macports.org/libmng ---> Installing libmng @2.0.3_0 ---> Activating libmng @2.0.3_0 ---> Cleaning libmng ---> Fetching archive for qt5-qtbase ---> Attempting to fetch qt5-qtbase-5.8.0_0+openssl.darwin_16.x86_64.tbz2 from https://packages.macports.org/qt5-qtbase ---> Attempting to fetch qt5-qtbase-5.8.0_0+openssl.darwin_16.x86_64.tbz2.rmd160 from https://packages.macports.org/qt5-qtbase ---> Installing qt5-qtbase @5.8.0_0+openssl ---> Activating qt5-qtbase @5.8.0_0+openssl ---> Cleaning qt5-qtbase ---> Updating database of binaries ---> Scanning binaries for linking errors ---> No broken files found.
now I do port contents qt5-qtbase | fgrep .pc
Hasbeen-MBP:~ cfusco$ port contents qt5-qtbase | fgrep .pc /opt/local/lib/pkgconfig/Qt5Concurrent.pc /opt/local/lib/pkgconfig/Qt5Core.pc /opt/local/lib/pkgconfig/Qt5DBus.pc /opt/local/lib/pkgconfig/Qt5Gui.pc /opt/local/lib/pkgconfig/Qt5Network.pc /opt/local/lib/pkgconfig/Qt5OpenGL.pc /opt/local/lib/pkgconfig/Qt5OpenGLExtensions.pc /opt/local/lib/pkgconfig/Qt5PrintSupport.pc /opt/local/lib/pkgconfig/Qt5Sql.pc /opt/local/lib/pkgconfig/Qt5Test.pc /opt/local/lib/pkgconfig/Qt5Widgets.pc /opt/local/lib/pkgconfig/Qt5Xml.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5Concurrent.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5Core.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5DBus.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5Gui.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5Network.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5OpenGL.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5OpenGLExtensions.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5PrintSupport.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5Sql.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5Test.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5Widgets.pc /opt/local/libexec/qt5/lib/pkgconfig/Qt5Xml.pc
now I try again to install qt5-qtbase
Edit: I meant mlt-qt5, which it works now (see next comment).
comment:4 Changed 7 years ago by wilya7
Sorry, I meant "now I try to install again mlt-qt5", and it works. So, a dependency problem?
What I don't understand, if it is a dependency problem, should not the install script take care of that? Also, I noticed the problem when I did "port -f clean --all all" which it failed when I didn't have those packages installed. Should not the script work regardless if the package is installed or not?
Edit: I tried again port -f clean --all all and it works as well. Is it a bug? Or I was supposed to have qt5-qtbase installed first?
comment:5 Changed 7 years ago by RJVB (René Bertin)
Congratulations, you found a bug ...
I overlooked the fact that dependency version checking is a bit of a hack in MacPorts. This is what the port should have done:
diff --git a/multimedia/mlt/Portfile b/multimedia/mlt/Portfile --- a/multimedia/mlt/Portfile +++ b/multimedia/mlt/Portfile @@ -42,7 +42,7 @@ if {${subport} eq "${name}"} { if {[info procs qt5.active_version] eq ""} { proc qt5.active_version {} { global prefix - if {[file exists ${prefix}/bin/pkg-config]} { + if {[file exists ${prefix}/bin/pkg-config/Qt5Core.pc]} { set av [exec ${prefix}/bin/pkg-config --modversion Qt5Core] return ${av} } else { @@ -53,10 +53,15 @@ if {${subport} eq "${name}"} { qt5.depends_component \ qtsvg - if {[vercmp [qt5.active_version] 5.7.0] >= 0} { - configure.cxxflags-append \ - -stdlib=libc++ \ - -std=c++11 + pre-configure { + # qt5.active_version only works if Qt is installed; we can + # be certain that is the case in the pre-configure phase. + if {[vercmp [qt5.active_version] 5.7.0] >= 0} { + ui_debug "Qt 5.7.0 and up require at least C++11" + configure.cxxflags-append \ + -stdlib=libc++ \ + -std=c++11 + } } }
You already uninstalled Qt5-qtbase, maybe you can apply the patch and confirm if installing mlt-qt5 now indeed pulls in qt5-qtbase as I think it will?
comment:6 Changed 7 years ago by wilya7
Applied the patch. Indeed it works, as well as now it does the port clean command! Your fix was successful. Thank you so much.
comment:7 Changed 7 years ago by bmeike (G. Blake Meike)
Hi. I'm encountering what appears to be exactly the same bug. Sadly, the Portfile is nothing like the one above and cannot be patched with that patch. It is:
PortSystem 1.0 PortGroup muniversal 1.0 name mlt epoch 3 version 6.4.1 categories multimedia maintainers dennedy.org:dan gmail.com:rjvbertin openmaintainer license GPL-2+
Suggestions?
comment:8 Changed 7 years ago by RJVB (René Bertin)
It looks like you need to do a port selfupdate
, your Portfile is out of date.
comment:9 Changed 7 years ago by bmeike (G. Blake Meike)
I just did a port selfupdate
.
---> Updating MacPorts base sources using rsync MacPorts base version 2.4.1 installed, MacPorts base version 2.4.1 downloaded. ---> Updating the ports tree ---> MacPorts base is already the latest version The ports tree has been updated. To upgrade your installed ports, you should run port upgrade outdated
I ran the upgrade. Several packages were, actually, upgraded.
I then retried port clean all --all
. It produced the error:
---> Cleaning mlt Error: Unable to open port: Package Qt5Core was not found in the pkg-config search path. Perhaps you should add the directory containing `Qt5Core.pc' to the PKG_CONFIG_PATH environment variable No package 'Qt5Core' found
The Portfile for mlt
has not changed. It is as shown above, and is dated 9/29.
Am I getting my ports from the wrong place?
comment:10 Changed 7 years ago by wilya7
This is the directory where the portfile to be patched is located in my system: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/multimedia/mlt
I confirm that in my system the patch can be applied and it works well. After I put the patch in place, port clean all --all
works just fine.
comment:11 Changed 7 years ago by bmeike (G. Blake Meike)
Yep. I was looking at the wrong multimedia/mlt/Portfile
. Patching the correct file fixed the problem. Thanks!
comment:12 follow-up: 15 Changed 7 years ago by wilya7
I think this patch can be safely applied upstream. Is there a timeline to be expected? I would love not have to apply again the patch anytime I do a new "port selfupdate". Regardless, thank you for fixing the problem.
comment:13 follow-up: 14 Changed 7 years ago by ddennedy (Dan Dennedy)
Regarding upstream, I have in my working copy a change to add "-std=c++11" when the c++ compiler contains clang-9 in its version string.
The "-stdlib=libc++" part I am not so sure about as I have not had to make that change here. If you want that upstreaming - bearing in mind that the MLT Makeflle must be cross-platform and compatible with older versions of OSes and compilers - what sort of test would you suggest for including that?
comment:14 Changed 7 years ago by wilya7
Replying to ddennedy:
Regarding upstream, I have in my working copy a change to add "-std=c++11" when the c++ compiler contains clang-9 in its version string.
The "-stdlib=libc++" part I am not so sure about as I have not had to make that change here. If you want that upstreaming - bearing in mind that the MLT Makeflle must be cross-platform and compatible with older versions of OSes and compilers - what sort of test would you suggest for including that?
I understand. Unfortunately I have no idea how to be helpful here, besides thanking you again.
comment:15 follow-ups: 16 17 Changed 7 years ago by RJVB (René Bertin)
Replying to wilya7:
I think this patch can be safely applied upstream. Is there a timeline to be expected? I would love not have to apply again the patch anytime I do a new "port selfupdate". Regardless, thank you for fixing the problem.
Don't you simply mean shipping the patch with the port so that you don't have to apply it yourself?
The stdlib part is not dependent on the compiler but on the (Mac) OS version.
What clang versions have "clang-9" in their version string? You'd need something that accounts for both the stock/official versioning (e.g. 4.0.1) and Apple's sauce...
comment:16 Changed 7 years ago by wilya7
Replying to RJVB:
Replying to wilya7:
I think this patch can be safely applied upstream. Is there a timeline to be expected? I would love not have to apply again the patch anytime I do a new "port selfupdate". Regardless, thank you for fixing the problem.
Don't you simply mean shipping the patch with the port so that you don't have to apply it yourself?
Yes, that's what I meant.
comment:17 follow-up: 18 Changed 7 years ago by ddennedy (Dan Dennedy)
Replying to RJVB:
The stdlib part is not dependent on the compiler but on the (Mac) OS version.
libc++ is a part of LLVM, which is no longer bound to OS.
What clang versions have "clang-9" in their version string? You'd need something that accounts for both the stock/official versioning (e.g. 4.0.1) and Apple's sauce...
On my 10.12.6 machine:
ddennedy-macbook:~ ddennedy$ clang++ --version Apple LLVM version 9.0.0 (clang-900.0.38) Target: x86_64-apple-darwin16.7.0
I have a OS X 10.8-based machine that I use for testing, and it says clang-8.... It did not work with the "-std=c++11" option when I added it to the Makefile and before I restricted it to gcc. However, it could have been that I needed to specify libc++ but did not. I will have to test that again.
comment:18 Changed 7 years ago by RJVB (René Bertin)
Replying to ddennedy:
libc++ is a part of LLVM, which is no longer bound to OS.
Who said bound to? ;) I also have libc++ on Linux, but do you know any distribution that uses it? That's what I mean, you're still bound to the choice the OS made.
What clang versions have "clang-9" in their version string? You'd need something that accounts for both the stock/official versioning (e.g. 4.0.1) and Apple's sauce...
On my 10.12.6 machine:
ddennedy-macbook:~ ddennedy$ clang++ --version Apple LLVM version 9.0.0 (clang-900.0.38) Target: x86_64-apple-darwin16.7.0I have a OS X 10.8-based machine that I use for testing, and it says clang-8.... It did not work with the "-std=c++11" option when I added it to the Makefile and before I restricted it to gcc. However, it could have been that I needed to specify libc++ but did not. I will have to test that again.
I have 10.9, and Xcode clang says Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
. That one still indicates the stock clang version it's based on. Then I have 2 other versions available:
> clang++-mp-3.9 --version ; clang++-mp-4.0 --version clang version 3.9.1 (tags/RELEASE_391/final) Target: x86_64-apple-darwin13.4.0 Thread model: posix InstalledDir: /opt/local/libexec/llvm-3.9/bin clang version 4.0.1 (tags/RELEASE_401/final) Target: x86_64-apple-darwin13.4.0 Thread model: posix InstalledDir: /opt/local/libexec/llvm-4.0/bin
your build system can run into any of those (and more), and will have to figure out which is which...
comment:19 Changed 7 years ago by jmroot (Joshua Root)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:20 follow-up: 21 Changed 3 years ago by cooljeanius (Eric Gallager)
could the comment with all the port names in it please be edited or deleted? I'm tired of this bug showing up in the search results for every port I want to search for bugs about
comment:21 Changed 3 years ago by wilya7
Replying to cooljeanius:
could the comment with all the port names in it please be edited or deleted? I'm tired of this bug showing up in the search results for every port I want to search for bugs about
Done
Can you please show the output of
port -v info mlt-qt5
andport contents qt5-qtbase | fgrep .pc
?port:qt5-qtbase is supposed to make its .pc files accessible to pkg-config without need for specific instructions.