Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Meson build #6311

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1bf67f4
MWE 1
rusty-snake Oct 29, 2021
b3c20e6
MWE 2
rusty-snake Oct 29, 2021
95451a8
WE 3
rusty-snake Oct 29, 2021
1619d89
Use meson in build/build-extra workflows for now
rusty-snake Oct 29, 2021
9412323
WE 4
rusty-snake Oct 29, 2021
0d2c134
E 5
rusty-snake Oct 29, 2021
ce30f85
E 6
rusty-snake Oct 29, 2021
607a28e
prep for meson
rusty-snake Oct 30, 2021
bd427ec
Build firejail with meson 7
rusty-snake Oct 30, 2021
c658bee
8
rusty-snake Oct 30, 2021
956ccb8
9
rusty-snake Oct 30, 2021
5bfc05b
prep for meson
rusty-snake Oct 30, 2021
6f03cd6
WE 10
rusty-snake Oct 30, 2021
1f09fc0
WE 11
rusty-snake Oct 31, 2021
0756b43
Update .github/workflows/build.yml
rusty-snake Oct 31, 2021
e50afda
Update workflows
rusty-snake Oct 31, 2021
af97761
Update workflows
rusty-snake Oct 31, 2021
d7a175f
Update workflows
rusty-snake Oct 31, 2021
2c077a7
NHWE 11
rusty-snake Oct 31, 2021
46be248
Update workflows
rusty-snake Oct 31, 2021
c1356f2
E 12
rusty-snake Oct 31, 2021
3a7aff3
NHWE 13
rusty-snake Oct 31, 2021
2d03322
NHWE 14
rusty-snake Oct 31, 2021
828f260
NHWE 15
rusty-snake Oct 31, 2021
7ae01d7
NHWE 16
rusty-snake Oct 31, 2021
165db06
Update workflows
rusty-snake Oct 31, 2021
59254b7
Update workflows
rusty-snake Oct 31, 2021
bbd88e2
Update workflows
rusty-snake Oct 31, 2021
775a7fa
17
rusty-snake Oct 31, 2021
9ea43aa
WE 18
rusty-snake Oct 31, 2021
995f7b7
Update workflows
rusty-snake Oct 31, 2021
f27fc9a
WE 19
rusty-snake Oct 31, 2021
b13e588
NHWE 20
rusty-snake Oct 31, 2021
c64f003
Update workflows
rusty-snake Oct 31, 2021
5bf2e28
21
rusty-snake Nov 2, 2021
d2d7b31
WIP: meson build system
topimiettinen Apr 13, 2024
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
Prev Previous commit
Next Next commit
WE 18
rusty-snake authored and topimiettinen committed Apr 13, 2024
commit 9ea43aa7b22b5ce315d30365d63ef226290fd028
20 changes: 19 additions & 1 deletion etc/meson.build
Original file line number Diff line number Diff line change
@@ -11,7 +11,25 @@ foreach dir : ['inc', 'net', 'profile-a-l', 'profile-m-z']
endforeach

if get_option('busybox-workaround')
#TODO: meson.add_install_script()
meson.add_install_script(sh.path(), '-e', '-c',
'''
disable_common_inc="$MESON_INSTALL_DESTDIR_PREFIX/$1/firejail/disable-common.inc"
cat >"$disable_common_inc" <<\EOF
# Workaround for systems where common UNIX utilities are symlinks to busybox.
# If this is not your case you can remove -Dbusybox-workaround=true from
# meson setup options, for added security.
noblacklist ${PATH}/busybox
noblacklist ${PATH}/crontab
noblacklist ${PATH}/mount
noblacklist ${PATH}/nc
noblacklist ${PATH}/su
noblacklist ${PATH}/sudo
noblacklist ${PATH}/umount
EOF
cat >>"$disable_common_inc" <"$2"
''', '--', sysconfdir, meson.current_source_dir() / 'inc/disable-common.inc',
)
else
install_data('inc/disable-common.inc',
install_dir: sysconfdir / project_name,
3 changes: 1 addition & 2 deletions src/bash_completion/meson.build
Original file line number Diff line number Diff line change
@@ -6,8 +6,7 @@ firejail_bash_completion = configure_file(
custom_target('firejail.bash_completion',
build_by_default: true,
capture: true,
# BIG FAT FIXME: This will fail if -Dmanpage=false
command: [gawk, '-f', preproc_awk, '--', facilities, '@INPUT@'],
command: preproc_awk_cmd,
input: firejail_bash_completion,
install: true,
install_dir: bashcompletiondir,
40 changes: 20 additions & 20 deletions src/man/meson.build
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
preproc_awk = files('preproc.awk')

# The kwarg env: of run_command is only supported by meson>=0.50
month = run_command(sh, '-c', 'LC_ALL=C date -u +%b', check: true).stdout().strip()
year = run_command(sh, '-c', 'LC_ALL=C date -u +%Y', check: true).stdout().strip()
date = run_command(sh, '-c', 'LC_ALL=C date -u +%Y-%b',
check: true,
).stdout().strip().split('-')

manconf = configuration_data()
manconf.set('VERSION', meson.project_version())
manconf.set('MONTH', month)
manconf.set('YEAR', year)
manconf.set('YEAR', date[0])
manconf.set('MONTH', date[1])

manpages = {
'firecfg': '1',
'firejail-login': '5',
'firejail-profile': '5',
'firejail': '1',
'firejail-users': '5',
'firemon': '1',
'jailcheck': '1',
}
manpages = [
'firecfg.1',
'firejail-login.5',
'firejail-profile.5',
'firejail.1',
'firejail-users.5',
'firemon.1',
'jailcheck.1',
]

foreach manpage, section : manpages
foreach manpage : manpages
section = manpage.split('.')[1]
configured_manpage = configure_file(
configuration: manconf,
input: manpage + '.txt',
input: manpage.split('.')[0] + '.txt',
output: '@PLAINNAME@',
)
custom_target(manpage + '.' + section,
custom_target(manpage,
build_by_default: true,
capture: true,
command: [gawk, '-f', preproc_awk, '--', facilities, '@INPUT@'],
command: preproc_awk_cmd,
input: configured_manpage,
install: true,
install_dir: get_option('mandir') / 'man' + section,
output: manpage + '.' + section,
output: manpage,
)
endforeach
5 changes: 4 additions & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
@@ -2,11 +2,14 @@
# directly call the compiler. Therefore we need additional flags which
# are set otherwise by meson.
c_args_libtrace = ['-Wall', '-O2', '-shared', '-fPIC', '-Wl,-z,relro']
#c_args_libtrace += ['-O' + get_option('optimization')]
if get_option('werror')
c_args_libtrace += ['-Werror']
endif

preproc_awk_cmd = [
gawk, '-f', files('man/preproc.awk'), '--', facilities, '@INPUT@',
]

# # # # # # # # # #

# APPS
3 changes: 1 addition & 2 deletions src/zsh_completion/meson.build
Original file line number Diff line number Diff line change
@@ -6,8 +6,7 @@ firejail_zsh_completion = configure_file(
custom_target('firejail.zsh_completion',
build_by_default: true,
capture: true,
# BIG FAT FIXME: This will fail if -Dmanpage=false
command: [gawk, '-f', preproc_awk, '--', facilities, '@INPUT@'],
command: preproc_awk_cmd,
input: firejail_zsh_completion,
install: true,
install_dir: zshcompletiondir,