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

[vcpkg-tool-meson] Update meson to a more recent version #28084

Merged
merged 123 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
5f36007
update meson
Neumann-A Nov 30, 2022
12664f7
v db
Neumann-A Nov 30, 2022
e8a9ec3
install old python module
Neumann-A Dec 2, 2022
d2f214a
remove automatic python lib linkage.
Neumann-A Dec 2, 2022
9b82b99
fix patch
Neumann-A Dec 2, 2022
deaeb19
fix python dep
Neumann-A Dec 5, 2022
cb360de
remove python setting so that it can be passed via the portfile if ne…
Neumann-A Dec 5, 2022
82ab77a
remove python patch
Neumann-A Dec 5, 2022
6aabafa
Remove old module installation
Neumann-A Dec 5, 2022
034a5da
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Dec 6, 2022
d4a693b
remove everything except for osx
Neumann-A Dec 6, 2022
2a0c322
kill zlib
Neumann-A Dec 6, 2022
9e4e1de
use build.x_args
Neumann-A Dec 6, 2022
8847269
use build. also for the linker
Neumann-A Dec 6, 2022
b45ebe1
add missing \n
Neumann-A Dec 6, 2022
a8eeebe
update to 1.0 and check python version
Neumann-A Jan 5, 2023
af4f354
pass compiler flags via prog variables for sanity checks
Neumann-A Jan 5, 2023
1373c84
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Jan 5, 2023
406fe9b
reset stuff
Neumann-A Jan 5, 2023
8e87d29
remove build. stuff
Neumann-A Jan 5, 2023
1b8c4f5
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Jan 7, 2023
d2658d1
fix intl ?
Neumann-A Jan 7, 2023
4ad2599
bump v
Neumann-A Jan 7, 2023
ae52424
bump gobject introspection
Neumann-A Jan 7, 2023
fd44704
fix thorvg
Neumann-A Jan 7, 2023
4d52e12
v db
Neumann-A Jan 7, 2023
99d5587
fix uwp toolchain for meson.
Neumann-A Jan 8, 2023
ce09cce
meson fixes.
Neumann-A Jan 8, 2023
7a62d91
remove /TC and /TP flag
Neumann-A Jan 9, 2023
4b6e09f
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Jan 9, 2023
680e38e
v db
Neumann-A Jan 9, 2023
390f8b3
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Feb 8, 2023
37bd521
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Feb 23, 2023
a19f3d0
move meson to DOWNLOADS.
Neumann-A Feb 23, 2023
72e237c
write version in helper port
Neumann-A Feb 23, 2023
6f75017
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Feb 24, 2023
a184de5
set meson script path correctly
Neumann-A Feb 24, 2023
3239e10
remove unnecessary variables
Neumann-A Feb 24, 2023
f2869e1
move port configs after common definitions.
Neumann-A Feb 24, 2023
5d22ad8
fix find_acquire_program
Neumann-A Feb 24, 2023
aa7cdf0
Merge branch 'update_meson_to_0.64.1' of https://github.com/Neumann-A…
Neumann-A Feb 24, 2023
ff2d520
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Feb 24, 2023
5aab89d
Merge branch 'microsoft:master' into update_meson_to_0.64.1
Neumann-A Feb 27, 2023
bcd8cb9
Merge branch 'microsoft:master' into update_meson_to_0.64.1
Neumann-A Feb 28, 2023
dccaca3
Merge branch 'master' of https://github.com/microsoft/vcpkg into upda…
LilyWangLL Mar 1, 2023
036efc6
Merge branch 'microsoft:master' into update_meson_to_0.64.1
Neumann-A Mar 1, 2023
d8b2ecf
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Mar 2, 2023
5ef0613
v db
Neumann-A Mar 2, 2023
f2ca091
v db
Neumann-A Mar 2, 2023
f97db09
Merge branch 'microsoft:master' into update_meson_to_0.64.1
Neumann-A Mar 6, 2023
3c1e2e2
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Mar 24, 2023
799fc5d
use separate arguments in script
Neumann-A Mar 24, 2023
17c480f
v db
Neumann-A Mar 24, 2023
9b705cf
Merge branch 'microsoft:master' into update_meson_to_0.64.1
Neumann-A Mar 27, 2023
c3080ec
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Mar 30, 2023
eccdc49
v db
Neumann-A Mar 30, 2023
4253c22
Merge branch 'microsoft:master' into update_meson_to_0.64.1
Neumann-A Apr 10, 2023
ae83875
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Apr 19, 2023
31767b2
v db
Neumann-A Apr 19, 2023
96e45d0
Merge branch 'master' into update_meson_to_0.64.1
Neumann-A Apr 21, 2023
75fbc49
only copy pdb if it exists
Neumann-A Apr 22, 2023
8b7b054
update to 1.1.0 and fix options detection
Neumann-A Apr 22, 2023
116cba6
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A May 3, 2023
bd92110
v db
Neumann-A May 3, 2023
b23d717
fix libnice-gst build
Neumann-A May 3, 2023
6ea3786
v db
Neumann-A May 3, 2023
974b25e
re-add python dep patch
Neumann-A May 3, 2023
81e67cd
v db
Neumann-A May 3, 2023
a7c734b
Fix x86 builds
Neumann-A May 4, 2023
c271a93
v db
Neumann-A May 4, 2023
825f5d4
remove double version
Neumann-A May 9, 2023
8a08729
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A May 11, 2023
93c96ea
revert uwp changes since they are not necessary here
Neumann-A May 11, 2023
a2b7069
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Jan 1, 2024
82c40ac
upgrade to 1.3.1
Neumann-A Jan 1, 2024
1bd9b1f
port version
Neumann-A Jan 1, 2024
aff2a24
- fix path
Neumann-A Jan 1, 2024
9ebd174
Make meson in downloads more robust by having a calculated hash in th…
Neumann-A Jan 3, 2024
4e01a94
v
Neumann-A Jan 3, 2024
130d4d0
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Jan 4, 2024
fc41c6a
add missing meson dependency to libnice
Neumann-A Jan 4, 2024
11ad785
try meson version 1.2.3 - 1.3.1 breaks transitive deps in gdk-pixbuf
Neumann-A Jan 4, 2024
9617237
back to 1.1.1
Neumann-A Jan 4, 2024
dfbceeb
Merge branch 'microsoft:master' into update_meson_to_0.64.1
Neumann-A Jan 8, 2024
b50f213
add missing ,
Neumann-A Jan 13, 2024
c575c22
format
Neumann-A Jan 13, 2024
ed36237
v db
Neumann-A Jan 13, 2024
839f1d3
Merge branch 'update_meson_to_0.64.1' of https://github.com/Neumann-A…
Neumann-A Jan 13, 2024
4859873
Merge branch 'microsoft:master' into update_meson_to_0.64.1
Neumann-A Jan 14, 2024
779b34a
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Jan 22, 2024
6052354
back to 1.3.1 with fix for gdk-pixbuf
Neumann-A Jan 22, 2024
d8c42eb
Merge branch 'update_meson_to_0.64.1' of https://github.com/Neumann-A…
Neumann-A Jan 22, 2024
3e58895
v db
Neumann-A Jan 22, 2024
fee4d29
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Jan 23, 2024
68d18cb
add meson dependency
Neumann-A Jan 23, 2024
a51bfce
fix port version
Neumann-A Jan 23, 2024
3ee7b5b
v db
Neumann-A Jan 23, 2024
8898e38
remove version.txt
Neumann-A Jan 23, 2024
bd8ac3f
add dep
Neumann-A Jan 24, 2024
e87d06e
v db
Neumann-A Jan 24, 2024
2e67bac
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Jan 24, 2024
54f252e
remove 1.1.1 from db
Neumann-A Jan 24, 2024
7f60154
Merge branch 'microsoft:master' into update_meson_to_0.64.1
Neumann-A Jan 26, 2024
9bbcdef
adjust python3 for mesa?
Neumann-A Jan 30, 2024
83694f8
Merge branch 'update_meson_to_0.64.1' of https://github.com/Neumann-A…
Neumann-A Jan 30, 2024
1173ecd
Fix typo and add python dir to path
Neumann-A Jan 30, 2024
e6e19d4
cleanup
Neumann-A Jan 30, 2024
0b00d59
bump version
Neumann-A Jan 30, 2024
1fd2824
v db
Neumann-A Jan 30, 2024
fb349d7
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Feb 7, 2024
e4b8cbe
v db
Neumann-A Feb 7, 2024
a5efc83
Fix xcb-util-errors
Neumann-A Feb 9, 2024
cd53697
v db
Neumann-A Feb 9, 2024
e494f63
Merge branch 'microsoft:master' into update_meson_to_0.64.1
Neumann-A Feb 19, 2024
d3c0db0
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Feb 28, 2024
2babb21
update to 1.3.2
Neumann-A Feb 29, 2024
811a333
v db
Neumann-A Feb 29, 2024
e3ab038
Merge remote-tracking branch 'upstream/master' into update_meson_to_0…
Neumann-A Mar 8, 2024
7fc8fc4
adjust to z_vcpkg_setup_pkgconfig_path change
Neumann-A Mar 8, 2024
5df1477
v db
Neumann-A Mar 8, 2024
372a52c
restore python in the old template
Neumann-A Mar 9, 2024
9b36347
remove sysroot adjustmnet in xcb-proto
Neumann-A Mar 9, 2024
ed2ffa9
v db
Neumann-A Mar 9, 2024
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
12 changes: 12 additions & 0 deletions ports/gdk-pixbuf/fix-static-deps.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build
index d7aa127b48..c313dc272d 100644
--- a/gdk-pixbuf/meson.build
+++ b/gdk-pixbuf/meson.build
@@ -214,6 +214,7 @@ gdkpixbuf = library('gdk_pixbuf-2.0',
dependencies: [
gdk_pixbuf_deps,
included_loaders_deps,
+ loaders_deps
],
install: true)

2 changes: 1 addition & 1 deletion ports/gdk-pixbuf/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
vcpkg_from_gitlab(
GITLAB_URL https://gitlab.gnome.org/
OUT_SOURCE_PATH SOURCE_PATH
Expand All @@ -10,6 +9,7 @@ vcpkg_from_gitlab(
fix_build_error_windows.patch
loaders-cache.patch
use-libtiff-4-pkgconfig.patch
fix-static-deps.patch
)

if("introspection" IN_LIST FEATURES)
Expand Down
2 changes: 1 addition & 1 deletion ports/gdk-pixbuf/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gdk-pixbuf",
"version": "2.42.10",
"port-version": 2,
"port-version": 3,
"description": "Image loading library.",
"homepage": "https://gitlab.gnome.org/GNOME/gdk-pixbuf",
"license": "LGPL-2.1-or-later",
Expand Down
2 changes: 1 addition & 1 deletion ports/glib/libintl.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ diff --git a/meson.build b/meson.build
libintl_prefix = '#include <libintl.h>'
-libintl = dependency('intl', required: false)
-if libintl.found() and libintl.type_name() != 'internal'
+libintl = dependency('Intl', method:'cmake', required: true)
+libintl = dependency('intl', required : true)
+libintl_deps = [libintl]
+if false
# libintl supports different threading APIs, which may not
Expand Down
1 change: 1 addition & 0 deletions ports/glib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "glib",
"version": "2.78.4",
"port-version": 1,
"description": "Portable, general-purpose utility library.",
"homepage": "https://developer.gnome.org/glib/",
"license": "LGPL-2.1-or-later",
Expand Down
10 changes: 7 additions & 3 deletions ports/gobject-introspection/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ vcpkg_find_acquire_program(FLEX)
vcpkg_find_acquire_program(BISON)

set(OPTIONS_DEBUG -Dbuild_introspection_data=false)
set(OPTIONS_RELEASE -Dbuild_introspection_data=true)
if(VCPKG_CROSSCOMPILING AND
NOT (CMAKE_HOST_WIN32 AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86"))
if(VCPKG_CROSSCOMPILING)
list(APPEND OPTIONS_RELEASE -Dgi_cross_use_prebuilt_gi=true)
list(APPEND OPTIONS_RELEASE -Dbuild_introspection_data=false)
# g-ir-scanner is not correctly setup for the cross build and
# fails to correctly link against x86 libs (uses x64 instead)
else()
list(APPEND OPTIONS_RELEASE -Dbuild_introspection_data=true)
endif()

vcpkg_configure_meson(
Expand All @@ -41,6 +44,7 @@ vcpkg_configure_meson(
g-ir-annotation-tool='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-annotation-tool'
g-ir-compiler='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-compiler${VCPKG_HOST_EXECUTABLE_SUFFIX}'
g-ir-scanner='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-scanner'
python='${CURRENT_HOST_INSTALLED_DIR}/tools/python3/python${VCPKG_HOST_EXECUTABLE_SUFFIX}'
)

vcpkg_host_path_list(APPEND ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig")
Expand Down
6 changes: 5 additions & 1 deletion ports/gobject-introspection/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gobject-introspection",
"version": "1.72.0",
"port-version": 7,
"port-version": 8,
"description": "A middleware layer between C libraries (using GObject) and language bindings.",
"homepage": "https://gi.readthedocs.io/en/latest/",
"license": null,
Expand All @@ -25,6 +25,10 @@
},
"libffi",
"python3",
{
"name": "python3",
"host": true
},
{
"name": "vcpkg-tool-meson",
"host": true
Expand Down
8 changes: 6 additions & 2 deletions ports/libnice/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "libnice",
"version": "0.1.21",
"port-version": 1,
"port-version": 2,
"description": "Libnice is an implementation of the IETF's Interactive Connectivity Establishment (ICE) standard (RFC 5245) and the Session Traversal Utilities for NAT (STUN) standard (RFC 5389).",
"homepage": "https://nice.freedesktop.org",
"license": "LGPL-2.1-only AND MPL-1.1",
Expand All @@ -13,6 +13,10 @@
"host": true,
"default-features": false
},
"openssl"
"openssl",
{
"name": "vcpkg-tool-meson",
"host": true
}
]
}
5 changes: 5 additions & 0 deletions ports/mesa/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ vcpkg_from_gitlab(
)

x_vcpkg_get_python_packages(PYTHON_VERSION "3" OUT_PYTHON_VAR "PYTHON3" PACKAGES setuptools mako)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path(PREPEND "${PYTHON3_DIR}")

vcpkg_find_acquire_program(FLEX)
get_filename_component(FLEX_DIR "${FLEX}" DIRECTORY)
Expand Down Expand Up @@ -103,6 +105,9 @@ vcpkg_configure_meson(
#-D egl-lib-suffix=_mesa
-Dbuild-tests=false
${MESA_OPTIONS}
ADDITIONAL_BINARIES
python=['${PYTHON3}','-I']
python3=['${PYTHON3}','-I']
)
vcpkg_install_meson()
vcpkg_fixup_pkgconfig()
Expand Down
1 change: 1 addition & 0 deletions ports/mesa/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "mesa",
"version": "23.2.1",
"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",
Expand Down
4 changes: 2 additions & 2 deletions ports/thorvg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ vcpkg_configure_meson(
OPTIONS
${BUILD_OPTIONS}
# see ${SOURCE_PATH}/meson_options.txt
-Dengines=sw
-Dengines=['sw']
-Dloaders=all
-Dsavers=tvg
-Dvector=true
-Dvector=true # This assumes AVX
-Dbindings=capi
-Dtests=false
-Dexamples=false
Expand Down
1 change: 1 addition & 0 deletions ports/thorvg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "thorvg",
"version": "0.12.1",
"port-version": 1,
"description": "ThorVG is a platform-independent portable library for drawing vector-based scenes and animations",
"homepage": "https://www.thorvg.org",
"license": "MIT",
Expand Down
12 changes: 12 additions & 0 deletions ports/vcpkg-tool-meson/adjust-args.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/mesonbuild/cmake/toolchain.py b/mesonbuild/cmake/toolchain.py
index abf2cf6..477629e 100644
--- a/mesonbuild/cmake/toolchain.py
+++ b/mesonbuild/cmake/toolchain.py
@@ -204,6 +204,6 @@ class CMakeToolchain:
@staticmethod
def is_cmdline_option(compiler: 'Compiler', arg: str) -> bool:
if compiler.get_argument_syntax() == 'msvc':
- return arg.startswith('/')
+ return arg.startswith(('/','-'))
else:
return arg.startswith('-')
46 changes: 46 additions & 0 deletions ports/vcpkg-tool-meson/adjust-python-dep.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py
index 38e3d5f..6427980 100644
--- a/mesonbuild/dependencies/python.py
+++ b/mesonbuild/dependencies/python.py
@@ -208,7 +208,8 @@ class PythonSystemDependency(SystemDependency, _PythonDependencyBase):
# compile args
+ verdot = self.variables.get('py_version_short')
inc_paths = mesonlib.OrderedSet([
self.variables.get('INCLUDEPY'),
- self.paths.get('include'),
+ self.paths.get('include') + f'/../../../include/python${verdot}',
self.paths.get('platinclude')])

self.compile_args += ['-I' + path for path in inc_paths if path]
@@ -279,9 +279,9 @@ class PythonSystemDependency(SystemDependency, _PythonDependencyBase):
else:
libpath = Path(f'python{vernum}.dll')
else:
if limited_api:
vernum = vernum[0]
- libpath = Path('libs') / f'python{vernum}.lib'
+ libpath = Path('libs') / f'..' / f'..' / f'..' / f'lib' / f'python{vernum}.lib'
# For a debug build, pyconfig.h may force linking with
# pythonX_d.lib (see meson#10776). This cannot be avoided
# and won't work unless we also have a debug build of
@@ -296,6 +296,8 @@ class PythonSystemDependency(SystemDependency, _PythonDependencyBase):
vscrt = self.env.coredata.options[mesonlib.OptionKey('b_vscrt')].value
if vscrt in {'mdd', 'mtd', 'from_buildtype', 'static_from_buildtype'}:
vscrt_debug = True
+ if is_debug_build:
+ libpath = Path('libs') / f'..' / f'..' / f'..' / f'debug/lib' / f'python{vernum}_d.lib'
if is_debug_build and vscrt_debug and not self.variables.get('Py_DEBUG'):
mlog.warning(textwrap.dedent('''\
Using a debug build type with MSVC or an MSVC-compatible compiler
@@ -390,10 +390,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice',
set_env('PKG_CONFIG_PATH', old_pkg_path)

candidates.append(functools.partial(wrap_in_pythons_pc_dir, pkg_name, env, kwargs, installation))
+ candidates.append(functools.partial(PythonPkgConfigDependency, pkg_name, env, kwargs, installation))
- # We only need to check both, if a python install has a LIBPC. It might point to the wrong location,
- # e.g. relocated / cross compilation, but the presence of LIBPC indicates we should definitely look for something.
- if pkg_libdir is not None:
- candidates.append(functools.partial(PythonPkgConfigDependency, pkg_name, env, kwargs, installation))
else:
candidates.append(functools.partial(PkgConfigDependency, 'python3', env, kwargs))

5 changes: 3 additions & 2 deletions ports/vcpkg-tool-meson/meson-intl.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -610,7 +610,8 @@ iconv_factory = DependencyFactory(
@@ -593,7 +593,8 @@ iconv_factory = DependencyFactory(

intl_factory = DependencyFactory(
packages['intl'] = intl_factory = DependencyFactory(
'intl',
+ [DependencyMethods.BUILTIN, DependencyMethods.SYSTEM, DependencyMethods.CMAKE],
+ cmake_name='Intl',
Expand Down
41 changes: 41 additions & 0 deletions ports/vcpkg-tool-meson/meson.template.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[binaries]
cmake = ['@CMAKE_COMMAND@']
ninja = ['@NINJA@']
pkg-config= ['@PKGCONFIG@']
@MESON_MT@
@MESON_AR@
@MESON_RC@
@MESON_C@
@MESON_C_LD@
@MESON_CXX@
@MESON_CXX_LD@
@MESON_OBJC@
@MESON_OBJC_LD@
@MESON_OBJCPP@
@MESON_OBJCPP_LD@
@MESON_FC@
@MESON_FC_LD@
@MESON_WINDRES@
@MESON_ADDITIONAL_BINARIES@
[properties]
cmake_toolchain_file = '@SCRIPTS@/buildsystems/vcpkg.cmake'
[cmake]
VCPKG_TARGET_TRIPLET = '@TARGET_TRIPLET@'
VCPKG_HOST_TRIPLET = '@_HOST_TRIPLET@'
VCPKG_CHAINLOAD_TOOLCHAIN_FILE = '@VCPKG_CHAINLOAD_TOOLCHAIN_FILE@'
VCPKG_CRT_LINKAGE = '@VCPKG_CRT_LINKAGE@'
_VCPKG_INSTALLED_DIR = '@_VCPKG_INSTALLED_DIR@'
@MESON_HOST_MACHINE@
@MESON_BUILD_MACHINE@
[built-in options]
default_library = '@MESON_DEFAULT_LIBRARY@'
werror = false
@MESON_CFLAGS@
@MESON_CXXFLAGS@
@MESON_FCFLAGS@
@MESON_OBJCFLAGS@
@MESON_OBJCPPFLAGS@
# b_vscrt
@MESON_VSCRT_LINKAGE@
# c_winlibs/cpp_winlibs
@MESON_WINLIBS@
86 changes: 33 additions & 53 deletions ports/vcpkg-tool-meson/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,38 @@
# In the future, it is expected that this port acquires and installs Meson.
# Currently is used in ports that call vcpkg_find_acquire_program(MESON) in order to force rebuilds.

set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

set(program MESON)
set(program_version 0.63.0)
set(program_name meson)
set(search_names meson meson.py)
set(interpreter PYTHON3)
set(apt_package_name "meson")
set(brew_package_name "meson")
set(paths_to_search "${CURRENT_PACKAGES_DIR}/tools/meson")
set(supported_on_unix ON)
set(version_command --version)
set(extra_search_args EXACT_VERSION_MATCH)

vcpkg_find_acquire_program(PYTHON3)

# Reenable if no patching of meson is required within vcpkg
# z_vcpkg_find_acquire_program_find_external("${program}"
# ${extra_search_args}
# PROGRAM_NAME "${program_name}"
# MIN_VERSION "${program_version}"
# INTERPRETER "${interpreter}"
# NAMES ${search_names}
# VERSION_COMMAND ${version_command}
# )

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mesonbuild/meson
REF bb91cea0d66d8d036063dedec1f194d663399cdf
SHA512 e5888eb35dd4ab5fc0a16143cfbb5a7849f6d705e211a80baf0a8b753e2cf877a4587860a79cad129ec5f3474c12a73558ffe66439b1633d80b8044eceaff2da
PATCHES
meson-intl.patch
remove-freebsd-pcfile-specialization.patch
)

vcpkg_execute_required_process(
COMMAND "${CMAKE_COMMAND}"
"-DSOURCE_PATH=${SOURCE_PATH}"
"-DCURRENT_PACKAGES_DIR=${CURRENT_PACKAGES_DIR}"
-P "${CURRENT_PORT_DIR}/install.cmake"
WORKING_DIRECTORY "${VCPKG_ROOT_DIR}"
LOGNAME install
)

file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

z_vcpkg_find_acquire_program_find_internal("${program}"
INTERPRETER "${interpreter}"
PATHS ${paths_to_search}
NAMES ${search_names}
set(VCPKG_POLICY_CMAKE_HELPER_PORT enabled)

set(files
vcpkg.json
portfile.cmake
vcpkg-port-config.cmake
vcpkg_configure_meson.cmake
vcpkg_install_meson.cmake
meson-intl.patch
adjust-python-dep.patch
adjust-args.patch
remove-freebsd-pcfile-specialization.patch
meson.template.in
)

message(STATUS "Using meson: ${MESON}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/meson/version.txt" "${program_version}") # For vcpkg_find_acquire_program
set(MESON_PATH_HASH "")
foreach(to_hash IN LISTS files)
file(SHA1 ${CMAKE_CURRENT_LIST_DIR}/${to_hash} to_append)
string(APPEND MESON_PATH_HASH "${to_append}")
endforeach()
string(SHA512 MESON_PATH_HASH "${MESON_PATH_HASH}")

configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-port-config.cmake" @ONLY)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg_configure_meson.cmake"
"${CMAKE_CURRENT_LIST_DIR}/vcpkg_install_meson.cmake"
"${CMAKE_CURRENT_LIST_DIR}/meson-intl.patch"
"${CMAKE_CURRENT_LIST_DIR}/adjust-python-dep.patch"
"${CMAKE_CURRENT_LIST_DIR}/adjust-args.patch"
"${CMAKE_CURRENT_LIST_DIR}/remove-freebsd-pcfile-specialization.patch"
"${CMAKE_CURRENT_LIST_DIR}/meson.template.in"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

vcpkg_install_copyright(FILE_LIST "${VCPKG_ROOT_DIR}/LICENSE.txt")

include("${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-port-config.cmake")
Loading