2021-01-12 08:12:01 +08:00
# Build-Depends: From X Window PR: zstd, drm (!windows), elfutils (!windows), wayland (!windows), wayland-protocols (!windows), xdamage, xshmfence (!windows), x11, xcb, xfixes, xext, xxf86vm, xrandr, xv, xvmc (!windows), egl-registry, opengl-registry, tool-meson
# Required LLVM modules: LLVM (modules: bitwriter, core, coroutines, engine, executionengine, instcombine, mcdisassembler, mcjit, scalaropts, transformutils) found: YES
2021-06-30 07:08:28 +08:00
# Patches are from https://github.com/pal1000/mesa-dist-win/tree/master/patches
set ( PATCHES
2022-05-17 02:41:53 +08:00
# Fix symbols exporting for MinGW GCC x86
d e f - f i x e s . p a t c h
# Clover build on Windows
c l o v e r . p a t c h
2021-06-30 07:08:28 +08:00
)
2021-01-12 08:12:01 +08:00
vcpkg_check_linkage ( ONLY_DYNAMIC_CRT )
2021-06-30 07:08:28 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
2021-01-12 08:12:01 +08:00
set ( VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled ) # some parts of this port can only build as a shared library.
endif ( )
vcpkg_from_gitlab (
G I T L A B _ U R L h t t p s : / / g i t l a b . f r e e d e s k t o p . o r g
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O m e s a / m e s a
2022-09-09 02:49:08 +08:00
R E F m e s a - 2 2 . 1 . 7
S H A 5 1 2 4 1 3 0 2 f c 5 5 e f 4 2 9 c 1 4 b 1 5 9 5 8 3 2 d b 3 a 8 9 8 3 8 0 2 3 0 f 8 6 d 2 b 8 4 a c 1 a e 3 b d 4 5 3 d 0 a a d 8 7 e c 7 a d 3 1 0 0 0 4 d c 6 4 f c f 3 4 f 5 8 d 8 e a 2 7 3 6 c 1 3 9 7 1 c 0 4 e b a 0 5 6 b c c 5 4 9 a 4 e 3 c c 7 c 9 4 7 0
2022-01-19 07:45:42 +08:00
F I L E _ D I S A M B I G U A T O R 1
2021-06-30 07:08:28 +08:00
H E A D _ R E F m a s t e r
P A T C H E S $ { P A T C H E S }
2021-01-12 08:12:01 +08:00
)
2022-04-15 02:08:23 +08:00
x_vcpkg_get_python_packages ( PYTHON_VERSION "3" OUT_PYTHON_VAR "PYTHON3" PACKAGES setuptools mako )
2021-01-12 08:12:01 +08:00
vcpkg_find_acquire_program ( FLEX )
get_filename_component ( FLEX_DIR "${FLEX}" DIRECTORY )
vcpkg_add_to_path ( PREPEND "${FLEX_DIR}" )
vcpkg_find_acquire_program ( BISON )
get_filename_component ( BISON_DIR "${BISON}" DIRECTORY )
vcpkg_add_to_path ( PREPEND "${BISON_DIR}" )
if ( WIN32 ) # WIN32 HOST probably has win_flex and win_bison!
if ( NOT EXISTS "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
if ( FLEX_DIR MATCHES "${DOWNLOADS}" )
file ( CREATE_LINK "${FLEX}" "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
else ( )
message ( FATAL_ERROR "${PORT} requires flex being named flex on windows and not win_flex!\n(Can be solved by creating a simple link from win_flex to flex)" )
endif ( )
endif ( )
if ( NOT EXISTS "${BISON_DIR}/BISON${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
if ( BISON_DIR MATCHES "${DOWNLOADS}" )
file ( CREATE_LINK "${BISON}" "${BISON_DIR}/bison${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
else ( )
message ( FATAL_ERROR "${PORT} requires bison being named bison on windows and not win_bison!\n(Can be solved by creating a simple link from win_bison to bison)" )
endif ( )
endif ( )
endif ( )
# For features https://github.com/pal1000/mesa-dist-win should be probably studied a bit more.
list ( APPEND MESA_OPTIONS -Dzstd=enabled )
list ( APPEND MESA_OPTIONS -Dshared-llvm=auto )
list ( APPEND MESA_OPTIONS -Dlibunwind=disabled )
list ( APPEND MESA_OPTIONS -Dlmsensors=disabled )
list ( APPEND MESA_OPTIONS -Dvalgrind=disabled )
list ( APPEND MESA_OPTIONS -Dglvnd=false )
list ( APPEND MESA_OPTIONS -Dglx=disabled )
list ( APPEND MESA_OPTIONS -Dgbm=disabled )
2022-09-09 02:49:08 +08:00
if ( "offscreen" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dosmesa=true )
else ( )
list ( APPEND MESA_OPTIONS -Dosmesa=false )
endif ( )
2021-01-12 08:12:01 +08:00
if ( "llvm" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dllvm=enabled )
else ( )
list ( APPEND MESA_OPTIONS -Dllvm=disabled )
endif ( )
if ( "gles1" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dgles1=enabled )
else ( )
list ( APPEND MESA_OPTIONS -Dgles1=disabled )
endif ( )
if ( "gles2" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dgles2=enabled )
else ( )
list ( APPEND MESA_OPTIONS -Dgles2=disabled )
endif ( )
if ( "opengl" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dopengl=true )
else ( )
list ( APPEND MESA_OPTIONS -Dopengl=false )
endif ( )
if ( "egl" IN_LIST FEATURES ) # EGL feature only works on Linux
list ( APPEND MESA_OPTIONS -Degl=enabled )
else ( )
list ( APPEND MESA_OPTIONS -Degl=disabled )
endif ( )
list ( APPEND MESA_OPTIONS -Dshared-glapi=enabled ) #shared GLAPI required when building two or more of the following APIs - opengl, gles1 gles2
if ( VCPKG_TARGET_IS_WINDOWS )
list ( APPEND MESA_OPTIONS -Dplatforms=['windows'] )
2021-06-30 07:08:28 +08:00
list ( APPEND MESA_OPTIONS -Dmicrosoft-clc=disabled )
2022-05-17 02:41:53 +08:00
if ( NOT VCPKG_TARGET_IS_MINGW )
set ( VCPKG_CXX_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_CXX_FLAGS}" )
set ( VCPKG_C_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_C_FLAGS}" )
endif ( )
2021-01-12 08:12:01 +08:00
endif ( )
2022-05-17 02:41:53 +08:00
2021-01-12 08:12:01 +08:00
vcpkg_configure_meson (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
O P T I O N S
2021-01-23 02:27:34 +08:00
- D g l e s - l i b - s u f f i x = _ m e s a
2021-01-12 08:12:01 +08:00
#-D egl-lib-suffix=_mesa
- D b u i l d - t e s t s = f a l s e
$ { M E S A _ O P T I O N S }
)
vcpkg_install_meson ( )
vcpkg_fixup_pkgconfig ( )
2023-01-12 15:04:26 +08:00
file ( REMOVE_RECURSE
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / i n c l u d e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / s h a r e "
# installed by egl-registry
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / K H R "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / E G L "
# installed by opengl-registry
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / G L "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / G L E S "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / G L E S 2 "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / G L E S 3 "
)
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 ( )
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 ( )
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/docs/license.rst" )