Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Add recipe for libglvnd #25919

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions recipes/libglvnd/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/bash

set -ex

# get meson to find pkg-config when cross compiling
export PKG_CONFIG=$BUILD_PREFIX/bin/pkg-config

meson ${MESON_ARGS} builddir --prefix=$PREFIX
meson configure builddir
ninja -v -C builddir
ninja -C builddir install
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/src/EGL/meson.build b/src/EGL/meson.build
index c90f0ca..3cf618a 100644
--- a/src/EGL/meson.build
+++ b/src/EGL/meson.build
@@ -39,9 +39,12 @@ if host_machine.system() in ['haiku']
egl_vendor_config_dirs += ':/boot/system/non-packaged/add-ons/opengl/egl_vendor.d'
egl_vendor_config_dirs += ':/boot/system/add-ons/opengl/egl_vendor.d'
else
+ # conda-forge specific patch: in conda-forge we do not ship any EGL implementation
+ # as a conda-forge package, so we patch the DEFAULT_EGL_VENDOR_CONFIG_DIRS to point
+ # to the system one, where we assume that glvnd is installed with /usr prefix
egl_vendor_config_dirs = '@0@/glvnd/egl_vendor.d:@1@/glvnd/egl_vendor.d'.format(
- join_paths(get_option('prefix'),get_option('sysconfdir')),
- join_paths(get_option('prefix'),get_option('datadir')))
+ join_paths('/usr',get_option('sysconfdir')),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets resolved at build time to be either lib or lib64 correct? Wont this cause problems between Ubuntu and fedora

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fortunately not, this are not the directory that contains the libraries, but rather the directories that contains the .json configuration files containg ICD information, see https://github.com/NVIDIA/libglvnd/blob/master/src/EGL/icd_enumeration.md .
So by default they should be /usr/share/glvnd/egl_vendor.d and /etc/glvnd/egl_vendor.d/. To be honest, I need to actually check if /etc/glvnd/egl_vendor.d/ is working as intended, as it is not clear how /etc/glvnd/egl_vendor.d/ could emerge if prefix is /usr, but /usr/share/glvnd/egl_vendor.d is working fine and should be the same across Ubuntu and Fedora.

Copy link
Member

@ehfd ehfd Jul 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ join_paths('/usr',get_option('datadir')))
endif

libEGL = shared_library(
47 changes: 47 additions & 0 deletions recipes/libglvnd/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{% set name = "libglvnd" %}
{% set version = "1.7.0" %}

package:
name: {{ name }}
version: {{ version }}

source:
- url: https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v{{ version }}/libglvnd-v{{ version }}.tar.bz2
sha256: d0e1925a3c9aee0143b8c181ac31d5637c8faa081759c277b8e16c7075612c11
patches:
- libglvnd_look_for_egl_icd_in_system_location.patch

build:
skip: true # [not linux]
number: 0
run_exports:
- {{ pin_subpackage(name, max_pin='x') }}

requirements:
build:
- {{ compiler('c') }}
- meson
- pkg-config
- ninja
host:
- xorg-libxext
- xorg-libx11
- xorg-xorgproto
- wayland-protocols

test:
commands:
- test -f $PREFIX/lib/pkgconfig/gl.pc
- test -f $PREFIX/include/GL/gl.h
- test -f $PREFIX/lib/libGL.so.1


about:
home: https://gitlab.freedesktop.org/glvnd/libglvnd
license: LicenseRef-TODO-Sort-Out-Correct-License
license_file: README.md
summary: The GL Vendor-Neutral Dispatch library

extra:
recipe-maintainers:
- traversaro