meson: Add pest rust dependencies

Including its dependency ucd-trie.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: @LingMan
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28869>
This commit is contained in:
Christian Gmeiner
2024-01-18 16:13:39 +01:00
committed by Marge Bot
parent 87ad3ca0ac
commit e28ff81869
13 changed files with 169 additions and 1 deletions

View File

@@ -104,7 +104,7 @@ rm -rf _build
meson setup _build \
--native-file=native.file \
--wrap-mode=nofallback \
--force-fallback-for perfetto,syn,paste \
--force-fallback-for perfetto,syn,paste,pest,pest_derive,pest_generator,pest_meta \
${CROSS+--cross "$CROSS_FILE"} \
-D prefix=$PWD/install \
-D libdir=lib \

View File

@@ -0,0 +1,6 @@
[wrap-file]
directory = once_cell-1.8.0
source_url = https://crates.io/api/v1/crates/once_cell/1.8.0/download
source_filename = once_cell-1.8.0.tar.gz
source_hash = 692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56
patch_directory = once_cell

View File

@@ -0,0 +1,23 @@
project(
'once_cell',
'rust',
version : '1.8.0',
license :'MIT OR Apache-2.0',
)
rust_args = [
'--cfg', 'feature="std"'
]
lib = static_library(
'once_cell',
'src/lib.rs',
rust_args : rust_args,
override_options : ['rust_std=2018', 'build.rust_std=2018'],
rust_abi : 'rust',
native : true,
)
dep_once_cell = declare_dependency(
link_with : [lib],
)

View File

@@ -0,0 +1,21 @@
project(
'pest',
'rust',
version : '2.7.11',
license :'MIT OR Apache-2.0',
)
ucd = subproject('ucd-trie').get_variable('lib')
lib = static_library(
'pest',
'src/lib.rs',
override_options : ['rust_std=2021', 'build.rust_std=2021'],
link_with : [ucd],
rust_abi : 'rust',
native : true,
)
dep_pest = declare_dependency(
link_with : [lib, ucd],
)

View File

@@ -0,0 +1,22 @@
project(
'pest_derive',
'rust',
version : '2.7.11',
license :'MIT OR Apache-2.0',
)
pest = subproject('pest').get_variable('lib')
pest_generator = subproject('pest_generator').get_variable('lib')
rust = import('rust')
lib = rust.proc_macro(
'pest_derive',
'src/lib.rs',
override_options : ['rust_std=2021', 'build.rust_std=2021'],
link_with : [pest, pest_generator],
)
dep_pest_derive = declare_dependency(
link_with : [lib, pest, pest_generator],
)

View File

@@ -0,0 +1,30 @@
project(
'pest_generator',
'rust',
version : '2.7.11',
license :'MIT OR Apache-2.0',
)
pest = subproject('pest').get_variable('lib')
pest_meta = subproject('pest_meta').get_variable('lib')
quote = subproject('quote').get_variable('lib')
pm2 = subproject('proc-macro2').get_variable('lib')
syn = subproject('syn').get_variable('lib')
rust_args = [
'--cfg', 'feature="std"',
]
lib = static_library(
'pest_generator',
'src/lib.rs',
rust_args : rust_args,
override_options : ['rust_std=2021', 'build.rust_std=2021'],
link_with : [pest, pest_meta, pm2, quote, syn],
rust_abi : 'rust',
native : true,
)
dep_pest_generator = declare_dependency(
link_with : [lib, pest, pest_meta, quote, syn],
)

View File

@@ -0,0 +1,22 @@
project(
'pest_meta',
'rust',
version : '2.7.11',
license :'MIT OR Apache-2.0',
)
once_cell = subproject('once_cell').get_variable('lib')
pest = subproject('pest').get_variable('lib')
lib = static_library(
'pest_meta',
'src/lib.rs',
override_options : ['rust_std=2021', 'build.rust_std=2021'],
link_with : [once_cell, pest],
rust_abi : 'rust',
native : true,
)
deb_pest_meta = declare_dependency(
link_with : [lib, once_cell, pest],
)

View File

@@ -0,0 +1,14 @@
project(
'ucd_trie',
'rust',
version : '0.1.6',
license : '(MIT or Apache-2.0) AND Unicode-DFS-2016)',
)
lib = static_library(
'ucd_trie',
'src/lib.rs',
override_options : ['rust_std=2018', 'build.rust_std=2018'],
rust_abi : 'rust',
native : true,
)

6
subprojects/pest.wrap Normal file
View File

@@ -0,0 +1,6 @@
[wrap-file]
directory = pest-2.7.11
source_url = https://crates.io/api/v1/crates/pest/2.7.11/download
source_filename = pest-2.7.11.tar.gz
source_hash = cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95
patch_directory = pest

View File

@@ -0,0 +1,6 @@
[wrap-file]
directory = pest_derive-2.7.11
source_url = https://crates.io/api/v1/crates/pest_derive/2.7.11/download
source_filename = pest_derive-2.7.11.tar.gz
source_hash = 2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a
patch_directory = pest_derive

View File

@@ -0,0 +1,6 @@
[wrap-file]
directory = pest_generator-2.7.11
source_url = https://crates.io/api/v1/crates/pest_generator/2.7.11/download
source_filename = pest_generator-2.7.11.tar.gz
source_hash = 3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183
patch_directory = pest_generator

View File

@@ -0,0 +1,6 @@
[wrap-file]
directory = pest_meta-2.7.11
source_url = https://crates.io/api/v1/crates/pest_meta/2.7.11/download
source_filename = pest_meta-2.7.11.tar.gz
source_hash = a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f
patch_directory = pest_meta

View File

@@ -0,0 +1,6 @@
[wrap-file]
directory = ucd-trie-0.1.6
source_url = https://crates.io/api/v1/crates/ucd-trie/0.1.6/download
source_filename = ucd-trie-0.1.6.tar.gz
source_hash = ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9
patch_directory = ucd-trie