Solved Interesting issue: vlc fails to build (libbluray not found)

The fun begins:
Code:
[...]
===>   vlc-2.2.8_3,4 depends on shared library: libbluray.so - found (/usr/local/lib/libbluray.so)
[...]
checking for BLURAY... no
configure: error: Library libbluray >= 0.3.0 needed for bluray was not found
===>  Script "configure" failed unexpectedly.
-from the build log-

Lets have a closer look:
Code:
# pkg-config --cflags libbluray
Package /usr/ports/packages was not found in the pkg-config search path.
Perhaps you should add the directory containing `/usr/ports/packages.pc'
to the PKG_CONFIG_PATH environment variable
Package '/usr/ports/packages', required by 'libbluray', not found

# grep /usr/ports/packages /usr/local/libdata/pkgconfig/libbluray.pc
Requires.private: /usr/ports/packages libxml-2.0 freetype2 fontconfig

That's quite bogus.
But now the problem becomes clear:
Code:
# grep PACKAGES /usr/ports/multimedia/libbluray/work/libbluray-1.0.2/configure
ac_subst_vars='PACKAGES
  PACKAGES="$PACKAGES libxml-2.0"
  PACKAGES="$PACKAGES freetype2"
      PACKAGES="$PACKAGES fontconfig"
      
# grep PACKAGES /usr/local/etc/pkgtools.conf
  ENV['PACKAGES'] ||= ENV['PORTSDIR'] + '/packages'
  ENV['PKG_PATH'] ||= ENV['PACKAGES'] + '/All'

portupgrade uses a shell variable PACKAGES and happily exports it to everybody in the build toolchain ("namespacing is for weenies"). And libbluray uses a shell variable PACKAGES in it's configure script to collect it's lib requirements, which are string-appended to the end - obviousely without bothering to initialize the variable beforehand.

So, who is to blame here?
 
I have this same issue. What was the fix?

Running 11.1-RELEASE-p9 on amd64. Have libbluray-1.0.2,1 installed from ports (and libbluray.so and .so.2 and .so.2.0.2 exist in /usr/local/lib). I am running a combination of pkg's and ports, maybe that's the issue?
 
Hi,
You have at least three options:
1. use libbluray from packages
2. uninstall libbluray, then rebuild it, but do not use portupgrade. Build it with make;make install instead.
3. Add a patch as /usr/ports/multimedia/libbluray/files/patch-xa (the directory does not yet exist):
Code:
*** configure.orig      Sun May  6 01:30:52 2018
--- configure   Sun May  6 01:33:00 2018
***************
*** 586,591 ****
--- 586,592 ----
  subdirs=
  MFLAGS=
  MAKEFLAGS=
+ PACKAGES=

  # Identity of this package.
  PACKAGE_NAME='libbluray'

The disadvantage of option 3 is that You get Your own modification into the portstree which You must maintain in the future. it would be better to fix the thing upstream, but I am not sure who should fix it (portupgrade or libbluray maintainer).
Some other good options (which I did not try) might be
4. to work with the -m or -M option of portupgrade, to unset the offending variable from there, or
5. to add something appropriate to the MAKE_ENV= hash in /user/local/etc/pkgtools.conf
 
TLDR; that seem a typical problem of misaligned libraries. I never used ports-mgmt/portupgrade and I do not know how it work but this is a typical flaw of all those builders which does not automatically rebuild ports when its dependencies are updated. So, apparently, nothing to report since it is working as intended. :)

You can easily experience the same kind of thing while using ports-mgmt/portmaster; however portmaster has an option to recursive rebuild the dependencies when building a port. But ports-mgmt/synth and ports-mgmt/poudriere users should never experience that.

I do not use multimedia/vlc but built it normally using ports-mgmt/poudriere.
 
Actually not - I know the problem You describe, but this here is different: it is simply about using variables without initializing them. And if you do this with a shell-variable, it may have any value exported from the invoking command.
 
Back
Top