8000 Add Meson · void-linux/xbps@c952ac9 · GitHub
[go: up one dir, main page]

Skip to content

Commit c952ac9

Browse files
committed
Add Meson
-Werror is dropped, because Meson's werror is more strict than configure one. This implementation does not support running tests. The Kyua testsuite heavily relies on in-source builds. Tests would have to be rewritten (at least the Kyuafile files, but probably more) to support Meson. Meson does not support retrieving git info and providing it as a compiler flag. Meson's vcs_tag() mechanism supports outputting to a (header or source) file only. This would mean that xbps.h.in would have to be modified. No substitution is done on xbps.h.in. See #598 for explanation. _DEFAULT_SOURCE is dropped, because _GNU_SOURCE implies _DEFAULT_SOURCE. -D_FILE_OFFSET_BITS=64 is set automatically by Meson. Work in progress!
1 parent e82437f commit c952ac9

File tree

31 files changed

+745
-0
lines changed

31 files changed

+745
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ tests/*/*/*_test
3535
tests/*/*/*_tests
3636
include/xbps.h
3737

38+
subprojects/libarchive-*
39+
subprojects/openssl-*
40+
subprojects/packagecache
41+
subprojects/zlib-*
42+
3843
# vim backup files
3944
.*.swp
4045
*~

bin/meson.build

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
subdir('xbps-alternatives')
2+
subdir('xbps-create')
3+
subdir('xbps-dgraph')
4+
subdir('xbps-install')
5+
subdir('xbps-pkgdb')
6+
subdir('xbps-query')
7+
subdir('xbps-reconfigure')
8+
subdir('xbps-remove')
9+
subdir('xbps-rindex')
10+
subdir('xbps-uhelper')
11+
subdir('xbps-checkvers')
12+
subdir('xbps-fbulk')
13+
subdir('xbps-digest')
14+
subdir('xbps-fetch')
15+
16+
if host_machine.system() == 'linux'
17+
subdir('xbps-uchroot')
18+
subdir('xbps-uunshare')
19+
endif

bin/xbps-alternatives/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src = ['main.c']
2+
3+
install_man('xbps-alternatives.1')
4+
executable('xbps-alternatives', src, dependencies: libxbps_dep, install: true)

bin/xbps-checkvers/meson.build

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
src = ['main.c']
2+
3+
install_man('xbps-checkvers.1')
4+
executable(
5+
'xbps-checkvers',
6+
src,
7+
c_args: '-Wno-deprecated-declarations',
8+
dependencies: libxbps_dep,
9+
install: true,
10+
)

bin/xbps-create/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src = ['main.c']
2+
3+
install_man('xbps-create.1')
4+
executable('xbps-create', src, dependencies: libxbps_dep, install: true)

bin/xbps-dgraph/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src = ['main.c']
2+
3+
install_man('xbps-dgraph.1')
4+
executable('xbps-dgraph', src, dependencies: libxbps_dep, install: true)

bin/xbps-digest/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src = ['main.c']
2+
3+
install_man('xbps-digest.1')
4+
executable('xbps-digest', src, dependencies: libxbps_dep, install: true)

bin/xbps-fbulk/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src = ['main.c']
2+
3+
install_man('xbps-fbulk.1')
4+
executable('xbps-fbulk', src, dependencies: libxbps_dep, install: true)

bin/xbps-fetch/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src = ['main.c', '../xbps-install/fetch_cb.c']
2+
3+
install_man('xbps-fetch.1')
4+
executable('xbps-fetch', src, dependencies: libxbps_dep, install: true)

bin/xbps-install/meson.build

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
src = [
2+
'main.c',
3+
'transaction.c',
4+
'question.c',
5+
'fetch_cb.c',
6+
'state_cb.c',
7+
'util.c',
8+
]
9+
10+
clock_gettime_code = '''
11+
#include <time.h>
12+
int main(void) {
13+
struct timespec ts;
14+
clock_gettime(CLOCK_MONOTONIC, &ts);
15+
return 0;
16+
}
17+
'''
18+
19+
CC = meson.get_compiler('c')
20+
21+
rt = CC.find_library('rt', required: false)
22+
extra_flags = []
23+
24+
if rt.found()
25+
if CC.compiles(
26+
clock_gettime_code,
27+
name: 'clock_gettime() available',
28+
args 57AE : '-D_GNU_SOURCE',
29+
dependencies: rt,
30+
)
31+
extra_flags = '-DHAVE_CLOCK_GETTIME'
32+
endif
33+
else
34+
if CC.compiles(
35+
clock_gettime_code,
36+
name: 'clock_gettime() available',
37+
args: '-D_GNU_SOURCE',
38+
)
39+
extra_flags = '-DHAVE_CLOCK_GETTIME'
40+
endif
41+
endif
42+
43+
install_man('xbps-install.1')
44+
executable(
45+
'xbps-install',
46+
src,
47+
c_args: extra_flags,
48+
dependencies: libxbps_dep,
49+
install: true,
50+
)

0 commit comments

Comments
 (0)
0