# graphics/mesa-libs and python



## amnixed (Jan 3, 2019)

Hello,

on a recently installed FreeBSD 12.0-STABLE r342671 system I'm trying to build and install graphics/mesa-libs as a dependency of dns/unbound. However, I get the error:


```
# make install clean
===>   unbound-1.8.3 depends on package: autoconf>=2.69 - found
===>   unbound-1.8.3 depends on package: automake>=1.16.1 - found
===>   unbound-1.8.3 depends on executable: libtoolize - found
===>   unbound-1.8.3 depends on package: pkgconf>=1.3.0_1 - found
===>   unbound-1.8.3 depends on shared library: libexpat.so - found (/usr/local/lib/libexpat.so)
===>   unbound-1.8.3 depends on shared library: libldns.so - found (/usr/local/lib/libldns.so)
===>   unbound-1.8.3 depends on shared library: libfstrm.so - found (/usr/local/lib/libfstrm.so)
===>   unbound-1.8.3 depends on shared library: libprotobuf-c.so - not found

[...]

===>   cairo-1.15.12,2 depends on file: /usr/local/libdata/pkgconfig/xcb-renderutil.pc - found
===>   cairo-1.15.12,2 depends on package: pkgconf>=1.3.0_1 - found
===>   cairo-1.15.12,2 depends on package: xorgproto>=0 - found
===>   cairo-1.15.12,2 depends on package: xorgproto>=0 - found
===>   cairo-1.15.12,2 depends on file: /usr/local/libdata/pkgconfig/pixman-1.pc - found
===>   cairo-1.15.12,2 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found
===>   cairo-1.15.12,2 depends on file: /usr/local/libdata/pkgconfig/xext.pc - found
===>   cairo-1.15.12,2 depends on file: /usr/local/libdata/pkgconfig/xrender.pc - found
===>   cairo-1.15.12,2 depends on file: /usr/local/libdata/pkgconfig/xcb.pc - found
===>   cairo-1.15.12,2 depends on shared library: libfreetype.so - found (/usr/local/lib/libfreetype.so)
===>   cairo-1.15.12,2 depends on shared library: libpng.so - found (/usr/local/lib/libpng.so)
===>   cairo-1.15.12,2 depends on shared library: libfontconfig.so - found (/usr/local/lib/libfontconfig.so)
===>   cairo-1.15.12,2 depends on shared library: libglib-2.0.so - found (/usr/local/lib/libglib-2.0.so)
===>   cairo-1.15.12,2 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so)
===>   cairo-1.15.12,2 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so)
===>   cairo-1.15.12,2 depends on shared library: libGL.so - not found
===>  mesa-libs-18.1.9_4 needs Python 2.7 at most, but 3.6 was specified.
*** Error code 1

Stop.
make[18]: stopped in /usr/ports/graphics/mesa-libs
*** Error code 1
```

lang/python27 is installed:


```
# portversion -v | grep python
[Reading data from pkg(8) ... - 147 packages found - done]
python27-2.7.15             =  up-to-date with port
```

How can I make graphics/mesa-libs use the installed lang/python27 port?


----------



## SirDice (Jan 3, 2019)

amnixed said:


> I'm trying to build and install graphics/mesa-libs as a dependency of dns/unbound.


Why would a 3D graphics library be a dependency of a DNS server?



amnixed said:


> How can I make graphics/mesa-libs use the installed lang/python27 port?


Apparently you changed the DEFAULT_VERSION of Python in /etc/make.conf. If you tell it to use 3.6 by default, ports that require 2.7 are going to fail.


----------



## amnixed (Jan 3, 2019)

SirDice said:


> Why would a 3D graphics library be a dependency of a DNS server?



I'm wondering about that myself. The only change I made in build options was 
	
	



```
DNSTAP=on
```
.



SirDice said:


> Apparently you changed the DEFAULT_VERSION of Python in /etc/make.conf. If you tell it to use 3.6 by default, ports that require 2.7 are going to fail.



I have not:


```
# cat /etc/make.conf
cat: /etc/make.conf: No such file or directory
```

Also:


```
# cat /usr/ports/Mk/bsd.default-versions.mk | grep -i python
    LINUX LUA MYSQL PERL5 PGSQL PHP PYTHON PYTHON2 PYTHON3 RUBY SSL TCLTK
PYTHON_DEFAULT?=    2.7
PYTHON2_DEFAULT?=    2.7
PYTHON3_DEFAULT?=    3.6
```

Also, I was able to build other ports which depend on lang/python27 with no errors:


```
# portversion -vr python27-2.7.15
[Reading data from pkg(8) ... - 147 packages found - done]
glib-2.56.3_2,1             =  up-to-date with port
ninja-1.8.2_1,2             =  up-to-date with port
py27-Babel-2.6.0            =  up-to-date with port
py27-Jinja2-2.10            =  up-to-date with port
py27-MarkupSafe-1.0         =  up-to-date with port
py27-alabaster-0.7.6        =  up-to-date with port
[...]
py27-setuptools-40.6.2      =  up-to-date with port
py27-setuptools_scm-1.17.0  =  up-to-date with port
py27-six-1.12.0             =  up-to-date with port
py27-snowballstemmer-1.2.0_1  =  up-to-date with port
py27-sphinx-1.6.5_1,1       =  up-to-date with port
py27-sphinx_rtd_theme-0.4.2  =  up-to-date with port
py27-sphinxcontrib-websupport-1.0.1  =  up-to-date with port
py27-typing-3.6.4           =  up-to-date with port
py27-urllib3-1.22,1         =  up-to-date with port
python27-2.7.15             =  up-to-date with port
scons-3.0.1                 =  up-to-date with port
xcb-proto-1.13              =  up-to-date with port
```

Should DEFAULT_VERSION] of Python in /etc/make.conf set explicitly even if it's already set in /usr/ports/Mk/bsd.default-versions.mk?


----------



## SirDice (Jan 3, 2019)

amnixed said:


> Should DEFAULT_VERSION] of Python in /etc/make.conf set explicitly even if it's already set in /usr/ports/Mk/bsd.default-versions.mk?


No, definitely not. You use DEFAULT_VERSIONS to overrule whatever is set in bsd.default-versions.mk.


----------



## SirDice (Jan 3, 2019)

Oh, I think I understand why it's pulling in Mesa.  The DNSTAP option pulls in devel/protobuf-c. This port has DOXYGEN enabled by default and this is what's pulling in a plethora of X and QT libraries. If you turn that option off the build dependencies should be significantly reduced.


----------



## amnixed (Jan 3, 2019)

Perfect, dns/unbound builds fine with 
	
	



```
DNSTAP=off
```
. Still, what's your advice about the graphics/mesa-libs ports python dependency?


----------



## SirDice (Jan 3, 2019)

amnixed said:


> Still, what's your advice about the graphics/mesa-libs ports python dependency?


Still trying to figure that one out. Mesa-libs itself doesn't appear to depend on Python at all, so I suspect it's one of its dependencies.


----------



## amnixed (Jan 3, 2019)

I found this:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233723


----------



## daeron (Nov 8, 2019)

Not a solution, but a kludge. Install devel/meson before trying to build mesa-libs.
I had installed llvm80 first but after checking the mesa3d.org site it seems meson is needed,


----------

