mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 19:38:48 +03:00
Add cmark wrap
This commit is contained in:
parent
cbe41e649e
commit
956dbb7230
4 changed files with 112 additions and 7 deletions
21
.gitignore
vendored
21
.gitignore
vendored
|
@ -14,18 +14,19 @@ subprojects/Olm.wrap
|
|||
subprojects/Olm/
|
||||
subprojects/coeurl.wrap
|
||||
subprojects/coeurl/
|
||||
subprojects/curl-7.77.0/
|
||||
subprojects/curl-*/
|
||||
subprojects/curl.wrap
|
||||
subprojects/libevent-2.1.12-stable/
|
||||
subprojects/libevent-*/
|
||||
subprojects/libevent.wrap
|
||||
subprojects/lmdb++/
|
||||
subprojects/lmdb-LMDB_0.9.29/
|
||||
subprojects/nlohmann_json-3.9.1/
|
||||
subprojects/lmdb-LMDB_*/
|
||||
subprojects/nlohmann_json-*/
|
||||
subprojects/nlohmann_json.wrap
|
||||
subprojects/openssl-1.1.1l/
|
||||
subprojects/openssl-*/
|
||||
subprojects/openssl.wrap
|
||||
subprojects/packagecache/
|
||||
subprojects/spdlog-1.9.2/
|
||||
subprojects/spdlog-*/
|
||||
subprojects/cmark-*/
|
||||
|
||||
# GTAGS
|
||||
GTAGS
|
||||
|
@ -143,3 +144,11 @@ package.dir
|
|||
|
||||
# Archives
|
||||
*.bz2
|
||||
|
||||
# analyzer stuff
|
||||
heaptrack.*
|
||||
massif.out.*
|
||||
*.dump
|
||||
.cache/
|
||||
.flatpak-builder/
|
||||
.hunter-emscripen/
|
||||
|
|
|
@ -19,7 +19,7 @@ deps = [
|
|||
dependency('blurhash'),
|
||||
dependency('spdlog'),
|
||||
dependency('cmark'),
|
||||
dependency('lmdb', fallback: ['lmdb', 'lmdb_dep']),
|
||||
dependency('lmdb'),
|
||||
dependency('Qt5Keychain'),
|
||||
dependency('threads'),
|
||||
]
|
||||
|
|
9
subprojects/cmark.wrap
Normal file
9
subprojects/cmark.wrap
Normal file
|
@ -0,0 +1,9 @@
|
|||
[wrap-file]
|
||||
directory = cmark-0.30.2
|
||||
|
||||
source_url = https://github.com/commonmark/cmark/archive/refs/tags/0.30.2.tar.gz
|
||||
source_filename = cmark-0.30.2.tar.gz
|
||||
source_hash = 6c7d2bcaea1433d977d8fed0b55b71c9d045a7cdf616e3cd2dce9007da753db3
|
||||
|
||||
patch_directory = cmark
|
||||
|
87
subprojects/packagefiles/cmark/meson.build
Normal file
87
subprojects/packagefiles/cmark/meson.build
Normal file
|
@ -0,0 +1,87 @@
|
|||
project(
|
||||
'cmark', 'c',
|
||||
version: '0.30.2',
|
||||
default_options: [
|
||||
'warning_level=2'
|
||||
],
|
||||
meson_version: '>= 0.54.0'
|
||||
)
|
||||
|
||||
sources = files(
|
||||
'src/cmark.c',
|
||||
'src/node.c',
|
||||
'src/iterator.c',
|
||||
'src/blocks.c',
|
||||
'src/inlines.c',
|
||||
'src/scanners.c',
|
||||
#'src/scanners.re',
|
||||
'src/utf8.c',
|
||||
'src/buffer.c',
|
||||
'src/references.c',
|
||||
'src/render.c',
|
||||
'src/man.c',
|
||||
'src/xml.c',
|
||||
'src/html.c',
|
||||
'src/commonmark.c',
|
||||
'src/latex.c',
|
||||
'src/houdini_href_e.c',
|
||||
'src/houdini_html_e.c',
|
||||
'src/houdini_html_u.c',
|
||||
'src/cmark_ctype.c'
|
||||
)
|
||||
|
||||
compiler = meson.get_compiler('c')
|
||||
|
||||
conf_data = configuration_data()
|
||||
conf_data.set('HAVE_STDBOOL_H', compiler.has_header('stdbool.h'))
|
||||
conf_data.set('HAVE___BUILTIN_EXPECT', compiler.compiles('int main() { __builtin_expect(0,0); return 0; }'), name: 'Has __builtin_expect')
|
||||
conf_data.set('HAVE___ATTRIBUTE__', compiler.compiles('''
|
||||
int f(void) __attribute__ (());
|
||||
int main() { return 0; }
|
||||
''', name: 'Has __attribute__'))
|
||||
|
||||
config_file = configure_file(input: 'src/config.h.in',
|
||||
output: 'config.h',
|
||||
configuration: conf_data,
|
||||
format: 'cmake',
|
||||
)
|
||||
|
||||
split_version = meson.project_version().split('.')
|
||||
version_file = configure_file(input: 'src/cmark_version.h.in',
|
||||
output: 'cmark_version.h',
|
||||
configuration: {
|
||||
'PROJECT_VERSION_MAJOR': split_version[0].to_int(),
|
||||
'PROJECT_VERSION_MINOR': split_version[1].to_int(),
|
||||
'PROJECT_VERSION_PATCH': split_version[2].to_int(),
|
||||
},
|
||||
format: 'cmake@',
|
||||
)
|
||||
|
||||
install_headers(
|
||||
'src/cmark.h',
|
||||
config_file,
|
||||
version_file,
|
||||
)
|
||||
|
||||
inc = include_directories('src')
|
||||
cmark = library(
|
||||
'cmark',
|
||||
sources,
|
||||
config_file,
|
||||
version_file,
|
||||
include_directories: inc,
|
||||
)
|
||||
|
||||
cmark_dep = declare_dependency(
|
||||
link_with: cmark,
|
||||
include_directories: inc,
|
||||
)
|
||||
meson.override_dependency('cmark', cmark_dep)
|
||||
|
||||
# Generate pc file
|
||||
pkg = import('pkgconfig')
|
||||
|
||||
pkg.generate(cmark,
|
||||
name: 'cmark',
|
||||
description: 'CommonMark parsing and rendering library and program in C')
|
||||
|
Loading…
Reference in a new issue