Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions ci_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,23 @@
],
"fatal_warnings": false
},
"ell": {
"_comment": "- relies on Linux specific APIs (getrandom)",
"build_on": {
"darwin": false,
"windows": false
},
"alpine_packages": [
"glib-dev",
"openssl",
"xxd"
],
"debian_packages": [
"libglib2.0-dev",
"openssl",
"xxd"
]
},
"enlog": {
"build_options": [
"enlog:color=true",
Expand Down
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,14 @@
"3.3.4-1"
]
},
"ell": {
"dependency_names": [
"ell"
],
"versions": [
"0.83-1"
]
},
"emilk-loguru": {
"dependency_names": [
"loguru"
Expand Down
10 changes: 10 additions & 0 deletions subprojects/ell.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[wrap-file]
directory = ell-0.83
source_url = https://www.kernel.org/pub/linux/libs/ell/ell-0.83.tar.xz
source_filename = ell-0.83.tar.xz
source_hash = 39a562f5ab2768e69da1ffbb1f98a8eb3483baffc7d2ef6adc3705e4fd4e53fb
# Maintained in https://github.com/hadess/ell/tree/wip/hadess/add-meson
patch_directory = ell

[provide]
dependency_names = ell
504 changes: 504 additions & 0 deletions subprojects/packagefiles/ell/LICENSE.build

Large diffs are not rendered by default.

192 changes: 192 additions & 0 deletions subprojects/packagefiles/ell/ell/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
lib_headers = [
'ell.h',
'util.h',
'test.h',
'strv.h',
'utf8.h',
'queue.h',
'hashmap.h',
'string.h',
'settings.h',
'main.h',
'idle.h',
'signal.h',
'timeout.h',
'io.h',
'ringbuf.h',
'log.h',
'checksum.h',
'netlink.h',
'genl.h',
'rtnl.h',
'dbus.h',
'dbus-service.h',
'dbus-client.h',
'hwdb.h',
'cipher.h',
'random.h',
'uintset.h',
'base64.h',
'pem.h',
'tls.h',
'uuid.h',
'key.h',
'file.h',
'dir.h',
'net.h',
'dhcp.h',
'dhcp6.h',
'cert.h',
'ecc.h',
'ecdh.h',
'time.h',
'gpio.h',
'path.h',
'icmp6.h',
'acd.h',
'tester.h',
'cleanup.h',
'netconfig.h',
'sysctl.h',
'minheap.h',
'notifylist.h',
]

lib_sources = [
'private.h',
'useful.h',
'missing.h',
'util.c',
'test-private.h',
'test.c',
'test-dbus.c',
'strv.c',
'utf8.c',
'queue.c',
'hashmap.c',
'string.c',
'settings.c',
'main-private.h',
'main.c',
'idle.c',
'signal.c',
'timeout.c',
'io.c',
'ringbuf.c',
'log.c',
'checksum.c',
'netlink-private.h',
'netlink.c',
'genl.c',
'rtnl-private.h',
'rtnl.c',
'dbus-private.h',
'dbus.c',
'dbus-message.c',
'dbus-util.c',
'dbus-service.c',
'dbus-client.c',
'dbus-name-cache.c',
'dbus-filter.c',
'gvariant-private.h',
'gvariant-util.c',
'siphash-private.h',
'siphash.c',
'hwdb.c',
'cipher.c',
'random.c',
'uintset.c',
'base64.c',
'asn1-private.h',
'pem-private.h',
'pem.c',
'tls-private.h',
'tls.c',
'tls-record.c',
'tls-extensions.c',
'tls-suites.c',
'uuid.c',
'key.c',
'file.c',
'dir.c',
'net-private.h',
'net.c',
'dhcp-private.h',
'dhcp.c',
'dhcp-transport.c',
'dhcp-lease.c',
'dhcp6-private.h',
'dhcp6.c',
'dhcp6-transport.c',
'dhcp6-lease.c',
'dhcp-util.c',
'dhcp-server.c',
'cert-private.h',
'cert.c',
'cert-crypto.c',
'ecc-private.h',
'ecc.h',
'ecc-external.c',
'ecc.c',
'ecdh.c',
'time.c',
'time-private.h',
'gpio.c',
'path.c',
'icmp6.c',
'icmp6-private.h',
'acd.c',
'tester.c',
'netconfig.c',
'sysctl.c',
'minheap.c',
'notifylist.c',
]

linux_headers = ['../linux/gpio.h']

libell = library(
'ell',
sources: lib_headers + lib_sources + linux_headers,
include_directories: include_directories('..'),
implicit_include_directories: false,
gnu_symbol_visibility: 'hidden',
version: '0.2.0',
install: get_option('default_library') != 'static',
)

libell_dep = declare_dependency(
include_directories: include_directories('..'),
link_with: libell,
)

meson.override_dependency('ell', libell_dep)

if get_option('default_library') != 'static'
install_headers(
lib_headers,
subdir: 'ell',
)

pkgconfig = import('pkgconfig')
pkgconfig.generate(
name: 'ell',
description: 'Embedded Linux library',
version: meson.project_version(),
libraries: libell,
# FIXME requires meson 1.9.0
# license: meson.project_license()
)
endif

libell_private = static_library(
'ell_private',
sources: lib_headers + lib_sources + linux_headers,
include_directories: include_directories('..'),
implicit_include_directories: false,
install: false,
)

libell_private_dep = declare_dependency(
link_with: libell_private,
)
34 changes: 34 additions & 0 deletions subprojects/packagefiles/ell/examples/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
examples = [
'dbus-service',
'https-client-test',
'https-server-test',
'dbus-client',
'dhcp-client',
'dhcp6-client',
'dhcp-server',
'acd-client',
'netconfig-test',
]

if get_option('examples')
foreach example : examples
exe = executable(
example,
'@0@.c'.format(example),
include_directories: include_directories('..'),
dependencies: libell_private_dep,
install: false,
)
endforeach
endif

if get_option('glib') and get_option('examples')
exe = executable(
'glib-eventloop',
'glib-eventloop.c',
include_directories: include_directories('..'),
dependencies: [libell_private_dep, glib_dep],
install: false,
)
endif

86 changes: 86 additions & 0 deletions subprojects/packagefiles/ell/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
project(
'ell',
'c',
version: '0.83',
license: 'LGPL-2.1-or-later',
default_options: ['default_library=shared'],
meson_version: '>= 1.3.0',

Check notice on line 8 in subprojects/packagefiles/ell/meson.build

View workflow job for this annotation

GitHub Actions / Ubuntu (x86_64)

Minimum Meson version is 1.3.0

0.56.0: oldest version supported by WrapDB 0.59.0: feed arg in custom_target 1.3.0: required arg in compiler.has_function
)

cc = meson.get_compiler('c')
find_program(
'awk',
required: true,
)
config_h = configuration_data()

checked_funcs = ['explicit_bzero', 'rawmemchr']

foreach func : checked_funcs
config_h.set('HAVE_' + func.to_upper(), cc.has_function(func))
endforeach

required_funcs = ['getrandom', 'signalfd', 'timerfd_create', 'epoll_create']

foreach func : required_funcs
cc.has_function(
func,
required: true,
)
endforeach

required_headers = ['linux/types.h', 'linux/if_alg.h']

foreach header : required_headers
cc.has_header(
header,
required: true,
)
endforeach

glib_dep = dependency(
'glib-2.0',
version: '>= 2.32',
required: get_option('glib'),
)
openssl = find_program(
'openssl',
required: get_option('cert-tests'),
)
sh = find_program(
'sh',
required: get_option('cert-tests'),
)
xxd = find_program(
'xxd',
required: get_option('cert-tests'),
)

if openssl.found()
r = run_command(
openssl,
'list',
'-providers',
check: false,
)
if r.returncode() == 0
openssl_legacy = ['-provider', 'legacy', '-provider', 'default']
else
openssl_legacy = ''
endif
endif

add_project_arguments(
'-DHAVE_CONFIG_H',
language: 'c',
)
configure_file(
output: 'config.h',
configuration: config_h,
)

subdir('ell')
subdir('tools')
subdir('unit')
subdir('examples')
30 changes: 30 additions & 0 deletions subprojects/packagefiles/ell/meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
option(
'glib',
type: 'boolean',
value: true,
description: 'Enable ell/glib main loop example',
)
option(
'tests',
type: 'boolean',
value: true,
description: 'Enable unit tests compilation',
)
option(
'cert-tests',
type: 'boolean',
value: true,
description: 'Enable OpenSSL cert tests',
)
option(
'tools',
type: 'boolean',
value: true,
description: 'Enable extra tools compilation',
)
option(
'examples',
type: 'boolean',
value: true,
description: 'Enable code examples compilation',
)
Loading
Loading