# Statement in /usr/ports/UPDATING for GL/mesa merge



## talsamon (May 13, 2017)

Please, make an entry in /usr/ports/UPDATING for the merge of the "GL and mesa" ports.
I guess some people, at least newbies will run into problems.


----------



## talsamon (May 13, 2017)

Grapics/libGL, graphics/libEGL, graphics/libglapi, graphics/libglesv2 graphics/gbm and graphics/dri has to removed before update with
`pkg delete -f  packagename` (will install in the same place),
Also run `pkg check -d`. All packages of the output must
recompiled.


----------



## Mwh65 (May 13, 2017)

When I run `pkg check -d` its asking to install the 4 separate packages again after I just deleted them, rather than reconfigure to use mesa-libs.

Any ideas ?


----------



## talsamon (May 13, 2017)

Normally, `pkg check -d[CMD]`[/CMD] checks the dependencies and installs missing ones. In this case you only have to answer "n" or "no". But it tells you which packages missing a library.
There are different ways to check dependencies e.g. `portmaster --check-depends` (I always use `pkg check`).


----------



## Mwh65 (May 13, 2017)

This is what I mean ...


```
cairo has a missing dependency: libGL
cairo has a missing dependency: libEGL
freeglut has a missing dependency: libGL
libGLU has a missing dependency: libGL

>>> Missing package dependencies were detected.
>>> Found 2 issue(s) in the package database.

The following packages will be installed:

New packages to be INSTALLED:
libGL: 17.0.3
libEGL: 17.0.3
libglapi: 17.0.3
gbm: 17.0.3

Number of packages to be installed: 4

The process will require 2 MiB more space.
306 KiB to be downloaded.

>>> Try to fix the missing dependencies? [y/N]: n
```

It's trying to re-install the 4 packages I just removed instead of re-building dependencies for graphics/cairo, graphics/freeglut and graphics/libGLU


----------



## drhowarddrfine (May 14, 2017)

This is confusing me too as those ports are depended on by other parts so removing them doesn't make sense


----------



## talsamon (May 14, 2017)

Sure make it sense. You  can*t install the new merged
mesa ports if you don't removing the old "GL-ports".
*Mwh65*: But it is no automatic to solve your problems.
It is only info. You have rebuild/recompile the depend
ports (all those have "missing" in the message) "per hand"
with portmaster or an other tool.


----------



## drhowarddrfine (May 14, 2017)

talsamon It doesn't make sense if other ports rely on the ports we're being told to uninstall.

For example, I tried to uninstall libEGL and portmaster complains that these ports are dependent on libEGL:


```
libepoxy-1.3.1
qt5-gui-5.7.1
cairo-1.14.8,2
gstreamer1-plugins-gl-1.8.0
```

Now that I'm home and had a chance to think about it, I see what you are saying, that the other ports need to be re-built but a lot of people won't realize that and don't get a "heads up" on what is happening and/or need instructions on rebuilding those ports.


----------



## talsamon (May 14, 2017)

What did I (and many others)?
I removed the GL-ports with `pkg delete -f` $removeme. It removes the packages in the pseudo-variable removeme.
Not their dependencies. After this I rebuild all dependencies
showed in the output of `pkg check -d`.
This were e.g
All mediaplayers, libreoffice, all webkits, a lot of games, all
gecko-ports, xorg and xorg-server, the graphics-driver   and handful of smaller ports like sdl2, sdl-image, freeglut, graphviz,...

Ok, but it is not my thing to explain it.
It should explained in /usr/ports/UPDATING. it spares
a lot of misunderstoods, questions and problems.
In the meantime there exists questions on pipermail
and a PR 219247.

And in the worst case, somebody could not start xorg.


----------



## ShelLuser (May 14, 2017)

drhowarddrfine said:


> For example, I tried to uninstall libEGL and portmaster complains that these ports are dependent on libEGL:
> 
> 
> ```
> ...


You're raising a non-concern.


```
macron:/usr/ports/graphics/cairo $ make all-depends-list
/usr/ports/ports-mgmt/pkg
/usr/ports/devel/pkgconf
/usr/ports/x11/pixman
/usr/ports/devel/xorg-macros
/usr/ports/lang/perl5.24
/usr/ports/print/freetype2
/usr/ports/devel/gmake
/usr/ports/devel/gettext-tools
/usr/ports/converters/libiconv
/usr/ports/devel/gettext-runtime
/usr/ports/print/indexinfo
/usr/ports/graphics/png
/usr/ports/x11-fonts/fontconfig
/usr/ports/textproc/expat2
macron:/usr/ports/graphics/cairo $
```
When I look at x11-toolkits/qt5-gui you'll even see something else:


```
/usr/ports/x11-toolkits/qt5-gui $ make all-depends-list | grep mesa
/usr/ports/graphics/mesa-libs
```
Also important to note: if you're using Portmaster then you could have gotten all the heads up you needed:


```
===>>> ldb-1.1.29_1
===>>> libGL-13.0.6

        ===>>> The graphics/libGL port moved to graphics/mesa-libs
        ===>>> Reason: Mesa libraries were merged into one port

===>>> libICE-1.0.9_1,1
===>>> libSM-1.2.2_3,1
--CUT--
===>>> libgd-2.2.4_1,1
===>>> libglapi-13.0.6

        ===>>> The graphics/libglapi port moved to graphics/mesa-libs
        ===>>> Reason: Mesa libraries were merged into one port

===>>> libgpg-error-1.27
===>>> libidn-1.33_1
```
Note that I'm not necessarily disagreeing with the /usr/ports/UPDATING comment, but you almost make it sound as if people couldn't find out about this at all, and that simply isn't true.


----------



## drhowarddrfine (May 14, 2017)

ShelLuser No. I'm not saying one won't find out. I'm saying it springs up on you without notice in /usr/ports/UPDATING just as you said. Then you question what went wrong and then you have to figure out how to fix it. Many of us know but it comes at you sideways on a Saturday afternoon when you have a few minutes to update a system. And there will still be many who will struggle with it.


----------



## paulw (May 14, 2017)

Just in case it helps anyone, the sequence of commands which worked for me (based on the packages I have installed) was:


```
sudo pkg update
sudo pkg delete -f libEGL libGL libglesv2 gbm libglapi
sudo pkg install mesa-libs
sudo pkg delete -f dri
sudo pkg install mesa-dri s2tc
sudo pkg upgrade xkbcomp sudo iridium-browser gtk3 gnutls gdbm chromium
sudo pkg upgrade -f xorg-server xcb-util-renderutil xcb-util seamonkey sdl2 rxvt-unicode qupzilla-qt5 qt5-webkit qt5-quick qt5-opengl qt5-gui nvidia-settings mpv \
mplayer mesa-demos libva libXfont libGLU kodi freeglut fluxconf firefox dnsmasq
sudo portsnap fetch update
sudo portmaster nvidia-driver-304
sudo pkg check -d
```

NB: I don't have the *xorg* metaport installed.


----------



## Mwh65 (May 14, 2017)

With the help of the replies I successfully sorted the dependency issues with ...


```
pkg upgrade freeglut
pkg upgrade libGLU
pkg upgrade cairo
```


----------



## paulw (May 14, 2017)

Mwh65 said:


> With the help of the replies I successfully sorted the dependency issues with ...
> 
> 
> ```
> ...



Based on :


```
pkg info -r mesa-libs
mesa-libs-17.0.4:
    cairo-1.14.8,2
    libepoxy-1.3.1
    qt5-gui-5.7.1
    libGLU-9.0.0_2
    qt5-quick-5.7.1
    qt5-opengl-5.7.1
    libva-1.8.1_1
    freeglut-3.0.0
    sdl2-2.0.5
    qt5-webkit-5.7.1
    mesa-demos-8.3.0_1
    xorg-server-1.18.4,1
    seamonkey-2.46_9
    qupzilla-qt5-1.8.9_2
    nvidia-settings-378.13
    mpv-0.25.0,1
    mplayer-1.3.0.20170415_1
    kodi-17.1_1
    firefox-53.0.2,1
    nvidia-driver-304-304.135
```

I should apparently have added:


```
sudo pkg upgrade -f cairo libepoxy
```

to my previous post.


----------



## trev (May 16, 2017)

Armed with the info from the above replies, absent any note in /usr/ports/UPDATING:

1. `pkg delete -f libEGL libGL libglesv2 gbm libglapi`

2. `pkg check -dn`

3. Use the list of packages from step 2 to rebuild the affected packages by running `portupgrade -f <pkg names>` (which rebuilds from source, I don't use binary packages).

The lack of any note in /usr/ports/UPDATING was quite unexpected and surprising which just goes to show how much I've been relying on it in the past.


----------



## drhowarddrfine (May 16, 2017)

getopt You people who think about and attempt the obvious drive me crazy.


----------



## drhowarddrfine (May 16, 2017)

getopt I didn't put a smiley face cause that ruins my dry humor posts. I probably should have added "that I didn't think of" somewhere.


----------



## YuryG (May 17, 2017)

And `poudriere` also refuses to upgrade more than half of ports without `-c` flag. [after this MESA/GL upgrade]


----------



## OlivierW (May 17, 2017)

With poudriere I had to use "pkgclean", like:
`poudriere pkgclean -j myJailName -p HEAD -f pkg.list`


----------



## monwarez (May 24, 2017)

I would say that the missing statement will be mostly for user of ports-mgmt/portupgrade and ports-mgmt/portmaster. For `pkg` user, including ports-mgmt/poudriere and ports-mgmt/synth, there should be no need for special command. At least with `synth`, I just updated like always and at the end all the ports that moved to *mesa-libs* was deleted, and I get *mesa-libs* instead.


----------



## scottro (May 26, 2017)

This should be in UPDATING.  As has been said here, and in various mail list posts.

As ShelLuser wrote above:


> Note that I'm not necessarily disagreeing with the /usr/ports/UPDATING comment, but you almost make it sound as if people couldn't find out about this at all, and that simply isn't true.


(Note that my original post didn't reference them, hence their comment below that I should have.)

So...before doing updates of any sort, would you mind providing a list of everything that should be checked first? Is it UPDATING, forums, questions@?  Anywhere else?

I guess it's gotten more Linux like as time passes.


----------



## ShelLuser (May 26, 2017)

scottro said:


> So...before doing updates of any sort, would you mind providing a list of everything that should be checked first? Is it UPDATING, forums, questions@?  Anywhere else?


It would have helped to reference me since that quote also came from me.

As others already mentioned above: it heavily depends on your way of updating. I compile ports while relying on ports-mgmt/portmaster and thus use 2 sources of information: /usr/ports/UPDATING (obviously) through use of `pkg updating` _as well as_ the output of `portmaster -L` which, as I already showed above, clearly stated the issue in the output.

Apparently people who rely on ports-mgmt/synth had no issues to content with at all.

As such: there is no "one size fits all" scenario here.


----------



## scottro (May 26, 2017)

Fair enough--and yes, I should have referenced you.  Thanks, that's a legit answer, UPDATING and portmaster -L.  I'm correcting the earlier post to reference you.


----------



## jrronimo (Jun 21, 2017)

To chime in as a newbie, this mesa thing has thrown me for quite a loop. I have a combination of ports and pkgs installed, and I find that I have run both `sudo pkg upgrade` and `sudo portupgrade -a` to get everything updated. I started by using portmaster for my ports (which I think was based on some advice I read in the forums), but there were some failures that led me to portupgrade.

I did a regular `sudo portupgrade -a` and suddenly it failed like so:


```
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        libglapi-17.0.3

Number of packages to be removed: 1
[1/1] Deinstalling libglapi-17.0.3...
[1/1] Deleting files for libglapi-17.0.3: 100%
[Reading data from pkg(8) ... - 292 packages found - done]
--->  Installing the new version via the port
===>  Installing for mesa-libs-17.1.2
===>   mesa-libs-17.1.2 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found
===>   mesa-libs-17.1.2 depends on file: /usr/local/libdata/pkgconfig/xcb.pc - found
===>   mesa-libs-17.1.2 depends on file: /usr/local/libdata/pkgconfig/xdamage.pc - found
===>   mesa-libs-17.1.2 depends on file: /usr/local/libdata/pkgconfig/xext.pc - found
===>   mesa-libs-17.1.2 depends on file: /usr/local/libdata/pkgconfig/xfixes.pc - found
===>   mesa-libs-17.1.2 depends on file: /usr/local/libdata/pkgconfig/xshmfence.pc - found
===>   mesa-libs-17.1.2 depends on file: /usr/local/libdata/pkgconfig/xxf86vm.pc - found
===>   mesa-libs-17.1.2 depends on shared library: libexpat.so - found (/usr/local/lib/libexpat.so)
===>   mesa-libs-17.1.2 depends on shared library: libdrm.so - found (/usr/local/lib/libdrm.so)
===>   mesa-libs-17.1.2 depends on shared library: libunwind.so - found (/usr/local/lib/libunwind.so)
===>   Registering installation for mesa-libs-17.1.2
Installing mesa-libs-17.1.2...
pkg-static: mesa-libs-17.1.2 conflicts with libEGL-17.0.3 (installs files into the same place).  Problematic file: /usr/local/include/EGL/egl.h
*** Error code 70

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

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

Stop.
make: stopped in /usr/ports/graphics/mesa-libs
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20170619-72313-19vbx29 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=libglapi-17.0.3 UPGRADE_PORT_VER=17.0.3 make reinstall
--->  Restoring the old version
Installing libglapi-17.0.3...
Extracting libglapi-17.0.3: 100%
** Fix the installation problem and try again.
** Package origin of 'libGL' has been changed: 'graphics/libGL' -> 'graphics/mesa-libs'
--->  Skipping 'graphics/mesa-libs' (libGL-17.0.3) because it has already failed
** Package origin of 'gbm' has been changed: 'graphics/gbm' -> 'graphics/mesa-libs'
--->  Skipping 'graphics/mesa-libs' (gbm-17.0.3) because it has already failed
** Package origin of 'libEGL' has been changed: 'graphics/libEGL' -> 'graphics/mesa-libs'
--->  Skipping 'graphics/mesa-libs' (libEGL-17.0.3) because it has already failed
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! net/samba44 (samba43-4.3.13_2)        (interrupted by user)
        ! graphics/mesa-libs (libglapi-17.0.3)  (install error)
        * graphics/mesa-libs (libGL-17.0.3)
        * graphics/mesa-libs (gbm-17.0.3)
        * graphics/mesa-libs (libEGL-17.0.3)
```

I freely admit that I am not very well versed in FreeBSD -- I set up my server about a year ago to be a Samba, web, & game server. I don't know when mesa got installed, or why. I certainly haven't seen any information that mesa was changing... 

I did see this warning from portmaster at one point:

```
===>>> libGL-13.0.6

       ===>>> The graphics/libGL port moved to graphics/mesa-libs
        ===>>> Reason: Mesa libraries were merged into one port
```

...but I frankly have no idea what that means or what I'm supposed to do with this information. I haven't seen a forum post, or a note on the front page about this with guidance about how to handle this transition. I only saw errors in my upgrade and I haven't been able to fix it yet. Some sort of guidance would really be appreciated, whether it's in UPDATING or somewhere else.

Out of curiosity, where was this change even discussed? Is it on a mailing list? It'd be interesting to read through the logic behind it, not because I disagree or anything, merely because I don't know why this change has happened.

I know it's horrible, but I have not yet read the manual cover to cover. I have read many pieces of it, but there are limits to my free time, unfortunately. I'm sure I come off as incredibly naive, and I'm sorry for that. I'm doing my best to learn when I can.


----------



## scottro (Jun 22, 2017)

Reading the manual from cover to cover wouldn't help in this case.      I don't know if there was mention on the ports mailing list and I see a bug was filed.  
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219243, where it is suggested an entry be made to updating.

https://lists.freebsd.org/pipermail/freebsd-ports/2017-May/thread.html#108564 shows the May mailing list thread, do a search for mesa on the page.  The first thread is called graphics/mesa-libs issues and the second longer one is mesa libs issues.

As you'll see in this thread (meaning _this_ one, the one we're in), people have solved it in various ways. The wonderful ports-mgmt/synth synth seems to fix many things.  On a second machine, I just used it and it put everything into place.

If your question is, under normal circumstances, would you have been made aware of it, it seems to have only been discussed on the ports mailing list.


----------

