bincrafters / community

Central repository for issues and recipes
http://bincrafters.readthedocs.io/en/latest/
MIT License
218 stars 36 forks source link

[qt] Check for opensuse fails on Suse Linux Enterprise Server #766

Closed wdobbe closed 5 years ago

wdobbe commented 5 years ago

Package and Environment Details

Conan profile

Steps to reproduce

Enter following commands on a Suse Linux Enterprise Server (any version)

git clone -b stable/5.12.3 https://github.com/bincrafters/conan-qt.git
conan create ./conan-qt

tools.os_info.linux_distro on SLES is 'sles'. The problem can be solved with for example the following fix:

diff --git a/conanfile.py b/conanfile.py
index 04cebfb..d067529 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -265,11 +265,11 @@ class QtConan(ConanFile):
                     elif self.options.opengl == "es2":
                         pack_names.append("libgles2-mesa-dev")
                 else:
-                    if not tools.os_info.linux_distro.startswith("opensuse"):
+                    if not tools.os_info.linux_distro.startswith("opensuse") and not tools.os_info.linux_distro.startswith("sles"):
                         pack_names = ["libxcb"]
                     if not tools.os_info.with_pacman:
                         if self.options.opengl == "desktop":
-                            if tools.os_info.linux_distro.startswith("opensuse"):
+                            if tools.os_info.linux_distro.startswith("opensuse") or tools.os_info.linux_distro.startswith("sles"):
                                 pack_names.append("Mesa-libGL-devel")
                             else:
                                 pack_names.append("mesa-libGL-devel")

FYI: contents of /etc/os-release:

NAME="SLES"
VERSION="12-SP4"
VERSION_ID="12.4"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP4"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12:sp4"

list of libxcb packages on SLES (same as on OpenSuse):

S | Name                  | Summary                                                    | Type   
--+-----------------------+------------------------------------------------------------+--------
i | libxcb-composite0     | X11 Composite Extension C library                          | package
  | libxcb-cursor0        | XCB cursor library (libxcursor port)                       | package
i | libxcb-damage0        | X11 Damage Extension C library                             | package
i | libxcb-devel          | Development files for the X11 protocol C library           | package
  | libxcb-devel-doc      | Documentation for libxcb                                   | package
i | libxcb-dpms0          | X11 DPMS Extension C library                               | package
i | libxcb-dri2-0         | X11 DRI2 Extension C library                               | package
  | libxcb-dri2-0-32bit   | X11 DRI2 Extension C library                               | package
i | libxcb-dri3-0         | X11 DRI3 Extension C library                               | package
  | libxcb-dri3-0-32bit   | X11 DRI3 Extension C library                               | package
  | libxcb-ewmh2          | XCB utility module for client- and WM-side ICCCM helpers   | package
i | libxcb-glx0           | X11 GLX Extension C library                                | package
  | libxcb-glx0-32bit     | X11 GLX Extension C library                                | package
i | libxcb-icccm4         | XCB utility module for client- and WM-side ICCCM helpers   | package
i | libxcb-image0         | XCB utility module for XImage/XShmImage-like functions     | package
i | libxcb-keysyms1       | XCB utility module for X keycode constants and conversions | package
i | libxcb-present0       | X11 Present Extension C library                            | package
  | libxcb-present0-32bit | X11 Present Extension C library                            | package
i | libxcb-randr0         | X11 RandR Extension C library                              | package
i | libxcb-record0        | X11 RECORD Extension C library                             | package
i | libxcb-render-util0   | XCB utility module for the Render extension                | package
i | libxcb-render0        | X11 Render Extension C library                             | package
  | libxcb-render0-32bit  | X11 Render Extension C library                             | package
i | libxcb-res0           | X11 Resource Extension C library                           | package
i | libxcb-screensaver0   | X11 ScreenSaver Extension C library                        | package
i | libxcb-shape0         | X11 Shape Extension C library                              | package
i | libxcb-shm0           | X11 Shared Memory Extension C library                      | package
  | libxcb-shm0-32bit     | X11 Shared Memory Extension C library                      | package
i | libxcb-sync1          | X11 Sync Extension C library                               | package
  | libxcb-sync1-32bit    | X11 Sync Extension C library                               | package
i | libxcb-util1          | XCB utility modules                                        | package
  | libxcb-util1-32bit    | XCB utility modules                                        | package
i | libxcb-xevie0         | X11 Xevie Extension C library                              | package
i | libxcb-xf86dri0       | X11 XFree86-DRI Extension C library                        | package
i | libxcb-xfixes0        | X11 Xfixes Extension C library                             | package
  | libxcb-xfixes0-32bit  | X11 Xfixes Extension C library                             | package
i | libxcb-xinerama0      | X11 Xinerama Extension C library                           | package
i | libxcb-xkb1           | X11 Keyboard Extension C library                           | package
  | libxcb-xkb1-32bit     | X11 Keyboard Extension C library                           | package
i | libxcb-xprint0        | X11 XPrint Extension C library                             | package
i | libxcb-xtest0         | X11 XTEST Extension C library                              | package
i | libxcb-xv0            | X11 video Extension C library                              | package
i | libxcb-xvmc0          | X11 Video Motion Compensation Extension C library          | package
i | libxcb1               | X11 core protocol C library                                | package
  | libxcb1-32bit         | X11 core protocol C library                                | package

List of mesa-libgl packages on SLES (same as on opensuse):

bamboo@tc-linux-bs02:~/build/conan-qt> zypper se mesa-libgl
Loading repository data...
Reading installed packages...

S | Name                    | Summary                                              | Type   
--+-------------------------+------------------------------------------------------+--------
i | Mesa-libGL-devel        | GL/GLX development files of the OpenGL API           | package
i | Mesa-libGL1             | The GL/GLX runtime of the Mesa 3D graphics library   | package
  | Mesa-libGL1-32bit       | The GL/GLX runtime of the Mesa 3D graphics library   | package
  | Mesa-libGLESv1_CM-devel | Development files for the OpenGL ES 1.x API          | package
  | Mesa-libGLESv1_CM1      | OpenGL|ES 1.x Common Profile API implementation      | package
i | Mesa-libGLESv2-2        | OpenGL|ES 2.x API implementation                     | package
  | Mesa-libGLESv2-devel    | Development files for the OpenGL ES 2.x API          | package
  | Mesa-libGLESv3-devel    | Development files for the OpenGL ES 3.x API          | package
  | Mesa-libglapi-devel     | Development files for the Mesa GL API implementation | package
i | Mesa-libglapi0          | Free implementation of the GL API                    | package
  | Mesa-libglapi0-32bit    | Free implementation of the GL API

Logs

package libxcb is not installed
Running: sudo -A zypper --non-interactive ref

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

sudo: no askpass program specified, try setting SUDO_ASKPASS
qt/5.12.3@bincrafters/stable: ERROR: while executing system_requirements(): Command 'sudo -A zypper --non-interactive ref' failed
ERROR: Error in system requirements
Morwenn commented 5 years ago

No love for if not tools.os_info.linux_distro.startswith(("opensuse", "sles"))? :p

ericLemanissier commented 5 years ago

It would have been much cleaner, but I didn't know about this possibility. Guess what, I'm not a python programmer ! Don't hesitate to do a PR, the recipe obviously needs some cleaning.