Skip to content
Snippets Groups Projects
Commit b96b7eb0 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Merge branch 'wraps' into 'master'

Add wraps for all dependencies

See merge request !2
parents 417821a0 5996b403
No related branches found
No related tags found
1 merge request!2Add wraps for all dependencies
Pipeline #1316 passed
......@@ -5,4 +5,8 @@
compile_commands.json
/subprojects/packagecache
/subprojects/doctest-*
/subprojects/libevent-*/
/subprojects/spdlog-*/
/subprojects/curl-*/
/subprojects/packagecache/
/*.pem
......@@ -9,7 +9,7 @@ build:
tags: [docker]
before_script:
- echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
- apk update && apk add clang-extra-tools meson git python3 py3-pip py3-flask lcov gcovr curl-dev libevent-dev spdlog-dev grep g++ cmake pkgconf openssl
- apk update && apk add meson git python3 py3-pip py3-flask lcov gcovr curl-dev libevent-dev spdlog-dev grep g++ cmake pkgconf openssl
- export PATH="$PATH:/root/.local/bin"
- pip3 install --user reuse
- ./scripts/run_tls_testserver.sh &
......@@ -26,6 +26,27 @@ build:
reports:
junit: http*.xml
build-with-wraps:
stage: build
image: alpine:latest
tags: [docker]
before_script:
- echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
- apk update && apk add meson git python3 py3-pip py3-flask g++ cmake pkgconf openssl openssl-dev make
- export PATH="$PATH:/root/.local/bin"
- pip3 install --user reuse
- ./scripts/run_tls_testserver.sh &
- ./scripts/run_testserver.sh &
script:
- meson setup builddir -Dtests=true -Dexamples=true --wrap-mode=forcefallback -Ddefault_library=static
- meson compile -C builddir
- ./builddir/tests/requests_tls -d --reporters=junit --out=https.xml
- ./builddir/tests/requests -d --reporters=junit --out=http.xml
- ./builddir/examples/coeurl_example
artifacts:
reports:
junit: http*.xml
build-cmake:
stage: build
image: alpine:latest
......
project('coeurl', 'cpp',
version : '0.1',
default_options : ['warning_level=3',
'cpp_std=c++17'])
'cpp_std=c++17'])
deps = [
dependency('threads', required: true),
dependency('libevent_core', required: true),
dependency('libcurl', required: true),
dependency('spdlog', required: true)
dependency('threads', required: true),
dependency('spdlog', required: true)
]
libcurl_dep = dependency('libcurl', required: get_option('wrap_mode') == 'nofallback')
libevent_dep = dependency('libevent_core', required: get_option('wrap_mode') == 'nofallback',)
if target_machine.system() == 'windows'
deps += dependency('libevent_windows', required: true)
libevent_threads_dep = dependency('libevent_windows', required: get_option('wrap_mode') == 'nofallback',)
else
deps += dependency('libevent_pthreads', required: true)
libevent_threads_dep = dependency('libevent_pthreads', required: get_option('wrap_mode') == 'nofallback',)
endif
if (not libevent_dep.found()
or not libevent_threads_dep.found()
or get_option('wrap_mode') == 'forcefallback'
or 'libevent' in get_option('force_fallback_for'))
cmake = import('cmake')
libevent_options = cmake.subproject_options()
libevent_options.add_cmake_defines({
'CMAKE_C_FLAGS': '-fPIC',
'EVENT_LIBRARY_TYPE': 'STATIC',
'BUILD_SHARED_LIBS': false,
'BUILD_SHARED_AND_STATIC_LIBS': false,
'EVENT__DISABLE_OPENSSL': true,
'EVENT__DISABLE_BENCHMARK': true,
})
libevent_options.set_override_option('werror', 'false')
libevent_options.set_override_option('warning_level', '0')
libevent_proj = cmake.subproject('libevent', options: libevent_options)
libevent_dep = libevent_proj.dependency('event_core_static')
if target_machine.system() == 'windows'
# the cmake project links the thread support into the library directly...
libevent_threads_dep = dependency('', required : false)
else
libevent_threads_dep = libevent_proj.dependency('event_pthreads_static')
endif
endif
deps += [libevent_dep, libevent_threads_dep]
if (not libcurl_dep.found()
or get_option('wrap_mode') == 'forcefallback'
or 'libcurl' in get_option('force_fallback_for'))
cmake = import('cmake')
libcurl_options = cmake.subproject_options()
libcurl_options.add_cmake_defines({
'CMAKE_C_FLAGS': '-fPIC',
'BUILD_SHARED_LIBS': false,
'BUILD_SHARED_AND_STATIC_LIBS': false,
'HTTP_ONLY': true,
})
libcurl_options.set_override_option('werror', 'false')
libcurl_options.set_override_option('warning_level', '0')
libcurl_proj = cmake.subproject('curl', options: libcurl_options)
libcurl_dep = libcurl_proj.dependency('libcurl')
endif
deps += [libcurl_dep]
include = include_directories('include')
lib = library('coeurl', ['lib/client.cpp', 'lib/request.cpp'],
......@@ -37,11 +85,11 @@ endif
pkg = import('pkgconfig')
pkg.generate(lib,
libraries : [lib],
version : meson.project_version(),
filebase : meson.project_name(),
description : 'Simple library to do http requests asynchronously via CURL in C++.',
url : 'https://nheko.im/nheko-reborn/cocurl')
libraries : [lib],
version : meson.project_version(),
filebase : meson.project_name(),
description : 'Simple library to do http requests asynchronously via CURL in C++.',
url : 'https://nheko.im/nheko-reborn/cocurl')
# No idea how to export working cmake config files, so don't do that for now
#cmake = import('cmake')
......
[wrap-file]
directory = curl-7.77.0
source_url = https://github.com/curl/curl/releases/download/curl-7_77_0/curl-7.77.0.tar.xz
source_filename = curl-7.77.0.tar.xz
source_hash = 0f64582c54282f31c0de9f0a1a596b182776bd4df9a4c4a2a41bbeb54f62594b
[provides]
dependency_names = libcurl
[wrap-file]
directory = libevent-2.1.12-stable
source_url = https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
source_filename = libevent-2.1.12-stable.tar.gz
source_hash = 92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
[wrap-file]
directory = spdlog-1.8.5
source_url = https://github.com/gabime/spdlog/archive/v1.8.5.tar.gz
source_filename = v1.8.5.tar.gz
source_hash = 944d0bd7c763ac721398dca2bb0f3b5ed16f67cef36810ede5061f35a543b4b8
patch_url = https://wrapdb.mesonbuild.com/v1/projects/spdlog/1.8.5/1/get_zip
patch_filename = spdlog-1.8.5-1-wrap.zip
patch_hash = 3c38f275d5792b1286391102594329e98b17737924b344f98312ab09929b74be
[provide]
spdlog = spdlog_dep
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment