Skip to content

Commit 4e7a930

Browse files
committed
ell: Add new wrap for ell
Upstream repository is at: https://git.kernel.org/pub/scm/libs/ell/ell.git/
1 parent 6584cbe commit 4e7a930

10 files changed

Lines changed: 847 additions & 0 deletions

File tree

releases.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,14 @@
877877
"3.3.4-1"
878878
]
879879
},
880+
"ell": {
881+
"dependency_names": [
882+
"ell"
883+
],
884+
"versions": [
885+
"0.82-1"
886+
]
887+
},
880888
"emilk-loguru": {
881889
"dependency_names": [
882890
"loguru"

subprojects/ell.wrap

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[wrap-file]
2+
directory = ell-0.82
3+
source_url = https://www.kernel.org/pub/linux/libs/ell/ell-0.82.tar.xz
4+
source_filename = ell-0.82.tar.xz
5+
source_hash = 133a9273151090b4cc37676063cc00ff350a093032ba20a2aaf8b3c5fd6f8b6d
6+
7+
# Maintained in https://github.com/hadess/ell/tree/wip/hadess/add-meson
8+
patch_directory = ell
9+
10+
[provide]
11+
dependency_names = ell
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
lib_headers = [
2+
'ell.h',
3+
'util.h',
4+
'test.h',
5+
'strv.h',
6+
'utf8.h',
7+
'queue.h',
8+
'hashmap.h',
9+
'string.h',
10+
'settings.h',
11+
'main.h',
12+
'idle.h',
13+
'signal.h',
14+
'timeout.h',
15+
'io.h',
16+
'ringbuf.h',
17+
'log.h',
18+
'checksum.h',
19+
'netlink.h',
20+
'genl.h',
21+
'rtnl.h',
22+
'dbus.h',
23+
'dbus-service.h',
24+
'dbus-client.h',
25+
'hwdb.h',
26+
'cipher.h',
27+
'random.h',
28+
'uintset.h',
29+
'base64.h',
30+
'pem.h',
31+
'tls.h',
32+
'uuid.h',
33+
'key.h',
34+
'file.h',
35+
'dir.h',
36+
'net.h',
37+
'dhcp.h',
38+
'dhcp6.h',
39+
'cert.h',
40+
'ecc.h',
41+
'ecdh.h',
42+
'time.h',
43+
'gpio.h',
44+
'path.h',
45+
'icmp6.h',
46+
'acd.h',
47+
'tester.h',
48+
'cleanup.h',
49+
'netconfig.h',
50+
'sysctl.h',
51+
'minheap.h',
52+
'notifylist.h'
53+
]
54+
55+
lib_sources = [
56+
'private.h',
57+
'useful.h',
58+
'missing.h',
59+
'util.c',
60+
'test-private.h',
61+
'test.c',
62+
'test-dbus.c',
63+
'strv.c',
64+
'utf8.c',
65+
'queue.c',
66+
'hashmap.c',
67+
'string.c',
68+
'settings.c',
69+
'main-private.h',
70+
'main.c',
71+
'idle.c',
72+
'signal.c',
73+
'timeout.c',
74+
'io.c',
75+
'ringbuf.c',
76+
'log.c',
77+
'checksum.c',
78+
'netlink-private.h',
79+
'netlink.c',
80+
'genl.c',
81+
'rtnl-private.h',
82+
'rtnl.c',
83+
'dbus-private.h',
84+
'dbus.c',
85+
'dbus-message.c',
86+
'dbus-util.c',
87+
'dbus-service.c',
88+
'dbus-client.c',
89+
'dbus-name-cache.c',
90+
'dbus-filter.c',
91+
'gvariant-private.h',
92+
'gvariant-util.c',
93+
'siphash-private.h',
94+
'siphash.c',
95+
'hwdb.c',
96+
'cipher.c',
97+
'random.c',
98+
'uintset.c',
99+
'base64.c',
100+
'asn1-private.h',
101+
'pem-private.h',
102+
'pem.c',
103+
'tls-private.h',
104+
'tls.c',
105+
'tls-record.c',
106+
'tls-extensions.c',
107+
'tls-suites.c',
108+
'uuid.c',
109+
'key.c',
110+
'file.c',
111+
'dir.c',
112+
'net-private.h',
113+
'net.c',
114+
'dhcp-private.h',
115+
'dhcp.c',
116+
'dhcp-transport.c',
117+
'dhcp-lease.c',
118+
'dhcp6-private.h',
119+
'dhcp6.c',
120+
'dhcp6-transport.c',
121+
'dhcp6-lease.c',
122+
'dhcp-util.c',
123+
'dhcp-server.c',
124+
'cert-private.h',
125+
'cert.c',
126+
'cert-crypto.c',
127+
'ecc-private.h',
128+
'ecc.h',
129+
'ecc-external.c',
130+
'ecc.c',
131+
'ecdh.c',
132+
'time.c',
133+
'time-private.h',
134+
'gpio.c',
135+
'path.c',
136+
'icmp6.c',
137+
'icmp6-private.h',
138+
'acd.c',
139+
'tester.c',
140+
'netconfig.c',
141+
'sysctl.c',
142+
'minheap.c',
143+
'notifylist.c'
144+
]
145+
146+
linux_headers = [
147+
'../linux/gpio.h'
148+
]
149+
150+
libell = library('ell',
151+
sources: lib_headers + lib_sources + linux_headers,
152+
include_directories: include_directories('..'),
153+
implicit_include_directories: false,
154+
gnu_symbol_visibility: 'hidden',
155+
version: '0.2.0',
156+
install: get_option('default_library') != 'static'
157+
)
158+
159+
libell_dep = declare_dependency(include_directories: include_directories('..'),
160+
link_with: libell)
161+
162+
if get_option('default_library') != 'static'
163+
install_headers(lib_headers,
164+
subdir: 'ell'
165+
)
166+
167+
pkgconfig = import('pkgconfig')
168+
pkgconfig.generate(
169+
name: 'ell',
170+
description: 'Embedded Linux library',
171+
version: meson.project_version(),
172+
libraries: libell,
173+
# FIXME requires meson 1.9.0
174+
# license: meson.project_license()
175+
)
176+
endif
177+
178+
libell_private = static_library('ell_private',
179+
sources: lib_headers + lib_sources + linux_headers,
180+
include_directories: include_directories('..'),
181+
implicit_include_directories: false,
182+
install: false
183+
)
184+
185+
libell_private_dep = declare_dependency(
186+
link_with: libell_private
187+
)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
examples = [
2+
'dbus-service',
3+
'https-client-test',
4+
'https-server-test',
5+
'dbus-client',
6+
'dhcp-client',
7+
'dhcp6-client',
8+
'dhcp-server',
9+
'acd-client',
10+
'netconfig-test',
11+
]
12+
13+
if get_option('examples')
14+
foreach example: examples
15+
exe = executable(example,
16+
'@0@.c'.format(example),
17+
include_directories: include_directories('..'),
18+
dependencies: libell_private_dep,
19+
install: false
20+
)
21+
endforeach
22+
endif
23+
24+
if get_option('glib') and get_option('examples')
25+
exe = executable('glib-eventloop',
26+
'glib-eventloop.c',
27+
include_directories: include_directories('..'),
28+
dependencies: [ libell_private_dep, glib_dep ],
29+
install: false
30+
)
31+
endif
32+
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
project(
3+
'ell', 'c',
4+
version: '0.82',
5+
license: 'LGPL-2.1-or-later',
6+
default_options: [
7+
'default_library=shared'
8+
],
9+
meson_version: '>= 1.3.0'
10+
)
11+
12+
cc = meson.get_compiler('c')
13+
find_program('awk', required: true)
14+
config_h = configuration_data()
15+
16+
checked_funcs = [
17+
'explicit_bzero',
18+
'rawmemchr',
19+
]
20+
21+
foreach func: checked_funcs
22+
config_h.set('HAVE_' + func.to_upper(), cc.has_function(func))
23+
endforeach
24+
25+
required_funcs = [
26+
'getrandom',
27+
'signalfd',
28+
'timerfd_create',
29+
'epoll_create'
30+
]
31+
32+
foreach func: required_funcs
33+
cc.has_function(func, required: true)
34+
endforeach
35+
36+
required_headers = [
37+
'linux/types.h',
38+
'linux/if_alg.h'
39+
]
40+
41+
foreach header: required_headers
42+
cc.has_header(header, required: true)
43+
endforeach
44+
45+
glib_dep = dependency('glib-2.0', version: '>= 2.32', required: get_option('glib'))
46+
openssl = find_program('openssl', required: get_option('cert-tests'))
47+
sh = find_program('sh', required: get_option('cert-tests'))
48+
xxd = find_program('xxd', required: get_option('cert-tests'))
49+
50+
if openssl.found()
51+
r = run_command(openssl, 'list', '-providers', check: false)
52+
if r.returncode() == 0
53+
openssl_legacy = [ '-provider', 'legacy', '-provider', 'default' ]
54+
else
55+
openssl_legacy = ''
56+
endif
57+
endif
58+
59+
add_project_arguments('-DHAVE_CONFIG_H', language: 'c')
60+
configure_file(
61+
output: 'config.h',
62+
configuration: config_h
63+
)
64+
65+
subdir('ell')
66+
subdir('tools')
67+
subdir('unit')
68+
subdir('examples')
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
option('glib', type: 'boolean', value: true, description: 'Enable ell/glib main loop example')
2+
option('tests', type: 'boolean', value: true, description: 'Enable unit tests compilation')
3+
option('cert-tests', type: 'boolean', value: true, description: 'Enable OpenSSL cert tests')
4+
option('tools', type: 'boolean', value: true, description: 'Enable extra tools compilation')
5+
option('examples', type: 'boolean', value: true, description: 'Enable code examples compilation')
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
tools = [
2+
'certchain-verify',
3+
'genl-discover',
4+
'genl-watch',
5+
'genl-request',
6+
'gpio'
7+
]
8+
9+
if get_option('tools')
10+
foreach tool: tools
11+
exe = executable(tool,
12+
'@0@.c'.format(tool),
13+
include_directories: include_directories('..'),
14+
dependencies: libell_private_dep,
15+
install: false
16+
)
17+
endforeach
18+
endif
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh -e
2+
3+
echo -n > cert-ca-index.txt
4+
OUTDIR=`mktemp -d`
5+
openssl ca -batch \
6+
-config "$4" -name example \
7+
-cert "$2" \
8+
-keyfile "$3" \
9+
-outdir $OUTDIR \
10+
-rand_serial -extensions cert_ext \
11+
-extfile "$5" -md sha256 \
12+
-startdate 000101120000Z -enddate 010101120000Z \
13+
-preserveDN -notext -in "$1" -out "$6"
14+
rm -rf $OUTDIR cert-ca-index.txt*

0 commit comments

Comments
 (0)