[baseline][opengl,mesa] Resolve ambiguities (#28160)

* [mesa] supports: !staticcrt

* [mesa] Install copyright from license.rst

* [mesa] Revise internal dependencies

* [mesa] Revise external dependencies

* [mesa] Move windows opengl32 lib to manual-link

* [opengl] Fix case of include names

* [opengl] Refactor for simplicity and mingw support

* [opengl] Stop copying out of windows SDK [skip actions]

* Update versions

* Revert "[opengl] Stop copying out of windows SDK"

* [mesa] Align with port opengl
This commit is contained in:
Kai Pastor 2023-01-12 08:04:26 +01:00 committed by GitHub
parent 5387e1925b
commit ce70fb4f1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 87 additions and 85 deletions

View File

@ -117,24 +117,34 @@ vcpkg_configure_meson(
vcpkg_install_meson()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
# installed by egl-registry
"${CURRENT_PACKAGES_DIR}/include/KHR"
"${CURRENT_PACKAGES_DIR}/include/EGL"
# installed by opengl-registry
"${CURRENT_PACKAGES_DIR}/include/GL"
"${CURRENT_PACKAGES_DIR}/include/GLES"
"${CURRENT_PACKAGES_DIR}/include/GLES2"
"${CURRENT_PACKAGES_DIR}/include/GLES3"
)
file(GLOB remaining "${CURRENT_PACKAGES_DIR}/include/*")
if(NOT remaining)
# All headers to be provided by egl-registry and/or opengl-registry
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include")
endif()
#installed by egl-registry
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/KHR")
file(REMOVE "${CURRENT_PACKAGES_DIR}/include/EGL/egl.h")
file(REMOVE "${CURRENT_PACKAGES_DIR}/include/EGL/eglext.h")
file(REMOVE "${CURRENT_PACKAGES_DIR}/include/EGL/eglplatform.h")
#installed by opengl-registry
set(_double_files include/GL/glcorearb.h include/GL/glext.h include/GL/glxext.h
include/GLES/egl.h include/GLES/gl.h include/GLES/glext.h include/GLES/glplatform.h
include/GLES2/gl2.h include/GLES2/gl2ext.h include/GLES2/gl2platform.h
include/GLES3/gl3.h include/GLES3/gl31.h include/GLES3/gl32.h include/GLES3/gl3platform.h)
list(TRANSFORM _double_files PREPEND "${CURRENT_PACKAGES_DIR}/")
file(REMOVE ${_double_files})
if(VCPKG_TARGET_IS_WINDOWS)
# opengl32.lib is already installed by port opengl.
# Mesa claims to provide a drop-in replacement of opengl32.dll.
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/opengl32.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/opengl32.lib")
if(NOT VCPKG_BUILD_TYPE)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/opengl32.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/opengl32.lib")
endif()
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/GLES")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/GLES2")
# Handle copyright
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(TOUCH "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/docs/license.rst")

View File

@ -1,10 +1,11 @@
{
"name": "mesa",
"version": "22.1.7",
"port-version": 1,
"description": "Mesa - The 3D Graphics Library",
"homepage": "https://www.mesa3d.org/",
"license": "MIT AND BSL-1.0 AND SGI-B-2.0",
"supports": "!(windows & arm)",
"supports": "!(windows & arm) & !staticcrt",
"dependencies": [
{
"name": "vcpkg-get-python-packages",
@ -28,20 +29,8 @@
"name": "mesa",
"default-features": false,
"features": [
"gles1"
]
},
{
"name": "mesa",
"default-features": false,
"features": [
"gles2"
]
},
{
"name": "mesa",
"default-features": false,
"features": [
"gles1",
"gles2",
"opengl"
]
},
@ -58,10 +47,7 @@
"egl": {
"description": "Build support for EGL platform",
"dependencies": [
{
"name": "mesa",
"default-features": false
}
"egl-registry"
]
},
"gles1": {
@ -69,7 +55,10 @@
"dependencies": [
{
"name": "mesa",
"default-features": false
"default-features": false,
"features": [
"opengl"
]
}
]
},
@ -78,7 +67,10 @@
"dependencies": [
{
"name": "mesa",
"default-features": false
"default-features": false,
"features": [
"opengl"
]
}
]
},
@ -125,10 +117,7 @@
"opengl": {
"description": "Build support for OpenGL (all versions)",
"dependencies": [
{
"name": "mesa",
"default-features": false
}
"opengl"
]
}
}

View File

@ -3,8 +3,8 @@ libdir=${prefix}/lib
includedir=${prefix}/include
Name: glu
Description: OpenGL Utility Library
Description: Windows OpenGL Utility library
Version: @WINDOWS_SDK_SEMVER@
Requires: opengl
Libs: -L${libdir} -lGlU32
Cflags: -I${includedir}
Libs: -L${libdir} -lglu32
Cflags: @WINDOWS_GL_CFLAGS@

View File

@ -3,7 +3,7 @@ libdir=${prefix}/lib
includedir=${prefix}/include
Name: OpenGL
Description: OpenGL library and headers.
Description: Windows OpenGL library
Version: @WINDOWS_SDK_SEMVER@
Libs: -L${libdir} -lOpenGL32
Cflags: -I${includedir}
Libs: -L${libdir} -lopengl32
Cflags: @WINDOWS_GL_CFLAGS@

View File

@ -1,14 +1,14 @@
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
vcpkg_get_windows_sdk(WINDOWS_SDK)
function(copy_from_windows_sdk WINDOWS_SDK)
if (WINDOWS_SDK MATCHES "10.")
set(LIBGLFILEPATH "$ENV{WindowsSdkDir}Lib/${WINDOWS_SDK}/um/${TRIPLET_SYSTEM_ARCH}/OpenGL32.Lib")
set(LIBGLUFILEPATH "$ENV{WindowsSdkDir}Lib/${WINDOWS_SDK}/um/${TRIPLET_SYSTEM_ARCH}/GlU32.Lib")
set(HEADERSPATH "$ENV{WindowsSdkDir}Include/${WINDOWS_SDK}/um")
set(COPYRIGHT "See https://developer.microsoft.com/windows/downloads/windows-10-sdk for the Windows 10 SDK license.")
elseif(WINDOWS_SDK MATCHES "8.")
set(LIBGLFILEPATH "$ENV{WindowsSdkDir}Lib/winv6.3/um/${TRIPLET_SYSTEM_ARCH}/OpenGL32.Lib")
set(LIBGLUFILEPATH "$ENV{WindowsSdkDir}Lib/winv6.3/um/${TRIPLET_SYSTEM_ARCH}/GlU32.Lib")
set(HEADERSPATH "$ENV{WindowsSdkDir}Include/um")
set(COPYRIGHT "See https://developer.microsoft.com/windows/downloads/windows-8-1-sdk for the Windows 8.1 SDK license.")
else()
message(FATAL_ERROR "Portfile not yet configured for Windows SDK with version: ${WINDOWS_SDK}")
endif()
@ -23,41 +23,36 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
message(FATAL_ERROR "Cannot find Windows ${WINDOWS_SDK} SDK. File does not exist: ${DISPLAY}")
endif()
set(INCLUDEGLPATH "${CURRENT_PACKAGES_DIR}/include/gl")
set(SHAREOPENGLPATH "${CURRENT_PACKAGES_DIR}/share/opengl")
set(RELEASELIBPATH "${CURRENT_PACKAGES_DIR}/lib")
set(DEBUGLIBPATH "${CURRENT_PACKAGES_DIR}/debug/lib")
set(GLGLHPATH "${HEADERSPATH}/gl/GL.h")
set(GLGLUHPATH "${HEADERSPATH}/gl/GLU.h")
file(MAKE_DIRECTORY "${INCLUDEGLPATH}" "${SHAREOPENGLPATH}" "${RELEASELIBPATH}")
file(INSTALL "${HEADERSPATH}/GL/gl.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/GL")
file(INSTALL "${HEADERSPATH}/GL/glu.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/GL")
file(INSTALL "${LIBGLFILEPATH}" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
file(INSTALL "${LIBGLUFILEPATH}" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
if (NOT VCPKG_BUILD_TYPE)
file(MAKE_DIRECTORY "${DEBUGLIBPATH}")
file(INSTALL "${LIBGLFILEPATH}" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
file(INSTALL "${LIBGLUFILEPATH}" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
endif()
file(COPY "${GLGLHPATH}" "${GLGLUHPATH}" DESTINATION "${INCLUDEGLPATH}")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "${COPYRIGHT}")
endfunction()
if (NOT VCPKG_BUILD_TYPE)
file(COPY "${LIBGLFILEPATH}" DESTINATION "${DEBUGLIBPATH}")
file(COPY "${LIBGLUFILEPATH}" DESTINATION "${DEBUGLIBPATH}")
if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_IS_MINGW)
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
set(WINDOWS_SDK_SEMVER "10.0.0")
set(WINDOWS_GL_CFLAGS "")
else()
vcpkg_get_windows_sdk(WINDOWS_SDK)
copy_from_windows_sdk("${WINDOWS_SDK}")
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" WINDOWS_SDK_SEMVER "${WINDOWS_SDK}")
set(WINDOWS_GL_CFLAGS "-I\${includedir}")
endif()
file(COPY "${LIBGLFILEPATH}" DESTINATION "${RELEASELIBPATH}")
file(COPY "${LIBGLUFILEPATH}" DESTINATION "${RELEASELIBPATH}")
if (WINDOWS_SDK MATCHES "10.")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "See https://developer.microsoft.com/windows/downloads/windows-10-sdk for the Windows 10 SDK license")
elseif(WINDOWS_SDK MATCHES "8.")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "See https://developer.microsoft.com/windows/downloads/windows-8-1-sdk for the Windows 8.1 SDK license")
endif()
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" WINDOWS_SDK_SEMVER "${WINDOWS_SDK}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/opengl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/opengl.pc" @ONLY)
configure_file("${CMAKE_CURRENT_LIST_DIR}/glu.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/glu.pc" @ONLY)
if (NOT VCPKG_BUILD_TYPE)
configure_file("${CMAKE_CURRENT_LIST_DIR}/opengl.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/opengl.pc" @ONLY)
configure_file("${CMAKE_CURRENT_LIST_DIR}/glu.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/glu.pc" @ONLY)
if(NOT VCPKG_BUILD_TYPE)
file(COPY "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/opengl.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
file(COPY "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/glu.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
endif()
vcpkg_fixup_pkgconfig()
else()
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

View File

@ -1,6 +1,6 @@
{
"name": "opengl",
"version-date": "2022-10-08",
"version-date": "2022-12-04",
"description": "Open Graphics Library (OpenGL)[3][4][5] is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics.",
"license": null,
"dependencies": [

View File

@ -571,8 +571,6 @@ mecab:x64-windows = skip
mecab:x64-windows-static = skip
mecab:x64-windows-static-md=skip
mecab:x86-windows = skip
# Due to static crt.
mesa:x64-windows-static=fail
# Missing dependent libraries.
mesa:x64-linux=fail
mesa:x64-osx=fail

View File

@ -4886,7 +4886,7 @@
},
"mesa": {
"baseline": "22.1.7",
"port-version": 0
"port-version": 1
},
"meschach": {
"baseline": "1.2b",
@ -5573,7 +5573,7 @@
"port-version": 0
},
"opengl": {
"baseline": "2022-10-08",
"baseline": "2022-12-04",
"port-version": 0
},
"opengl-registry": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ff0e8b2a943a94c7f1c3d13fbacbddd6d0c2aa3e",
"version": "22.1.7",
"port-version": 1
},
{
"git-tree": "7febde5a35ffc0cc975e25219121f5dc7048e0ef",
"version": "22.1.7",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "653ce2ed9ecbcce0b51a78f4663031ee78332beb",
"version-date": "2022-12-04",
"port-version": 0
},
{
"git-tree": "ea1726ace2d45bcfda85af4b7ef80c579bbbccca",
"version-date": "2022-10-08",