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
2023-10-13 01:46:42 +08:00
R E F m e s a - $ { V E R S I O N }
S H A 5 1 2 9 6 f 7 6 0 2 c 9 8 d 5 3 2 a 2 6 9 1 1 6 b d 5 d 3 f 9 c b e 8 7 c a 4 4 2 5 b 3 0 9 4 6 7 c c 1 9 f 8 3 2 7 7 a 0 f a a a 9 8 0 4 e d e a 7 2 d c a e b 6 f 7 7 7 4 c a c 1 7 7 9 0 d 5 d 7 6 b 5 8 c 3 5 7 e f 6 3 9 c b 6 0 6 4 e 7 4 8 0 d 9 3 b 8 6 1 b f
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
2023-10-13 01:46:42 +08:00
P A T C H E S
g a l l i u m - f i x - b u i l d - w i t h - l l v m - 1 7 . p a t c h
c l o v e r - l l v m - m o v e - t o - m o d e r n - p a s s - m a n a g e r . p a t c h
2023-03-31 05:18:52 +08:00
)
2022-04-15 02:08:23 +08:00
2023-10-13 01:46:42 +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 )
2023-10-13 01:46:42 +08:00
get_filename_component ( FLEX_DIR "${FLEX}" DIRECTORY )
2021-01-12 08:12:01 +08:00
vcpkg_add_to_path ( PREPEND "${FLEX_DIR}" )
vcpkg_find_acquire_program ( BISON )
2023-10-13 01:46:42 +08:00
get_filename_component ( BISON_DIR "${BISON}" DIRECTORY )
2021-01-12 08:12:01 +08:00
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 ( )
2023-04-26 14:17:36 +08:00
if ( FEATURES STREQUAL "core" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" )
endif ( )
2023-01-12 15:04:26 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/docs/license.rst" )