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

Initial support for meson build system #216

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
adf5dac
Initial support for meson build system
xbjfk Apr 29, 2022
0370115
Make library versioning logic more concise
xbjfk Apr 30, 2022
c55044e
abidw support
xbjfk May 1, 2022
2ea974a
Enable library install
xbjfk May 1, 2022
974e5cb
Add ABI compatibility as meson test
xbjfk May 1, 2022
283b173
Add header include path
xbjfk May 1, 2022
29357c4
make makeguids a native (host) target
xbjfk May 1, 2022
2693936
Add gen_guids to all targets
xbjfk May 1, 2022
d47a55b
Install headers
xbjfk May 1, 2022
7f64d95
ignore removal of efi_well_known_*_end symbols
xbjfk May 1, 2022
3da9d07
Update specfile for meson use
xbjfk May 1, 2022
c340cc9
Remove redundant .in prefix off version maps
xbjfk May 1, 2022
b5d429f
Remove old package config files
xbjfk May 1, 2022
e1cd3d2
Remove .in suffix in meson.build file access
xbjfk May 1, 2022
816bcf6
Use script to skip not fail compatible abi changes
xbjfk May 1, 2022
714b8d7
Make meson.build simpler
xbjfk May 1, 2022
e1873ba
Use disabler object for abidiff and abidw
xbjfk May 2, 2022
3b57f7f
Add dependency on -ldl for libefivar
xbjfk May 2, 2022
e76d12a
Add test for efivar
xbjfk May 27, 2022
d3d6efe
Start of GitHub CI
xbjfk May 27, 2022
c65842a
Add libdl dependency to efivar executable too
xbjfk May 27, 2022
fc1ad4c
Add shebang to abidiff_wrapper
xbjfk May 27, 2022
ddced4a
Add more paths that trigger workflow
xbjfk May 27, 2022
c0597f4
Add abignore to abidw
xbjfk May 27, 2022
2f64c30
Add efisecdb tests
xbjfk May 28, 2022
3cf1ff6
Add thread testing
xbjfk May 28, 2022
2dd8073
Only include tests when can run target binaries
xbjfk Oct 9, 2022
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
68 changes: 42 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
{
"name": "pull-request",
"on": {
"push": { "branches": "main" },
"pull_request": { "branches": "main" },
},
"jobs": {
"linux": {
"runs-on": "ubuntu-latest",
"strategy": {
"fail-fast": false,
"matrix": {
"container": [
"f33", "f34", "f35", "f36", "centos8", "centos9",
],
},
},
"container": "vathpela/efi-ci:${{ matrix.container }}-x64",
"steps": [
{ "uses": "actions/checkout@v2" },
{ "run": "make all test" },
{ "run": "make abicheck" },
],
},
},
}
name: ci_meson

on:
workflow_dispatch:
push:
paths:
- "**.c"
- "**.h"
- "tests/**"
- "**/meson.build"
- "src/abignore"
- "src/*.abixml"
- "src/*.map"
pull_request:
paths:
- "**.c"
- "**.h"
- "tests/**"
- "**/meson.build"
- "src/abignore"
- "src/*.abixml"
- "src/*.map"

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- run: sudo apt-get update && sudo apt-get install -y abigail-tools
- run: pip install meson ninja
- run: meson setup -Dtest_abi_compat=enabled -Dgenerate_abi_xml=enabled -Dconvert_mandocs=disabled builddir/
env:
CC: gcc
- run: meson test -C builddir/ -v
- uses: actions/upload-artifact@v1
with:
name: Linux_Meson_Testlog
path: builddir/meson-logs/testlog.txt

86 changes: 0 additions & 86 deletions Makefile

This file was deleted.

58 changes: 0 additions & 58 deletions docs/Makefile

This file was deleted.

29 changes: 29 additions & 0 deletions docs/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
mans = ['efi_append_variable.3', 'efi_del_variable.3', 'efidp_make_generic.3', 'efi_get_next_variable_name.3', 'efi_get_variable.3', 'efi_get_variable_attributes.3', 'efi_get_variable_size.3', 'efi_guid_to_id_guid.3', 'efi_guid_to_name.3', 'efi_guid_to_str.3', 'efi_guid_to_symbol.3', 'efi_id_guid_to_guid.3', 'efi_name_to_guid.3', 'efi_set_variable.3', 'efi_str_to_guid.3', 'efi_symbol_to_guid.3', 'efivar.1', 'efi_variable_alloc.3', 'efi_variable_export.3', 'efi_variable_free.3', 'efi_variable_get_attributes.3', 'efi_variable_get_data.3', 'efi_variable_get_guid.3', 'efi_variable_get_name.3', 'efi_variable_import.3', 'efi_variable_realize.3', 'efi_variable_set_attributes.3', 'efi_variable_set_data.3', 'efi_variable_set_guid.3', 'efi_variable_set_name.3', 'efi_variables_supported.3', 'efi_variable_t.3']

mdocs = ['efisecdb.1.mdoc']

foreach man : mans
install_man(man)
endforeach

mandoc = find_program('mandoc', required : get_option('convert_mandocs'))

foreach mdoc : mdocs
if mandoc.found()
# Unfortunately install_man won't take target or generator output: meson bug #1550
man = custom_target(mdoc.substring(0, -5),
input : mdoc,
output : mdoc.substring(0, -5),
command : [mandoc, '-mdoc', '-Tman',
'-Ios=Linux', '@INPUT@'],
capture : true,
install : true,
install_dir : join_paths(get_option('mandir'), 'man' + mdoc[-6]))
else
# configure_file is used to remove .mdoc extension
man = configure_file(input : mdoc,
output : mdoc.substring(0, -5),
copy : true)
install_man(man)
endif
endforeach
11 changes: 6 additions & 5 deletions efivar.spec.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: efivar
Version: @@VERSION@@
Version: @version@
Release: 1%{?dist}
Summary: Tools to manage UEFI variables
License: LGPL-2.1-only
Expand All @@ -13,7 +13,7 @@ BuildRequires: git
BuildRequires: glibc-static
BuildRequires: libabigail
BuildRequires: mandoc
BuildRequires: make
BuildRequires: meson
# please don't fix this to reflect github's incomprehensible url that goes
# to a different tarball.
Source0: https://github.com/rhboot/efivar/releases/download/%{version}/efivar-%{version}.tar.bz2
Expand Down Expand Up @@ -48,15 +48,16 @@ git config --unset user.name
%build
%define _lto_cflags %{nil}

make LIBDIR=%{_libdir} BINDIR=%{_bindir} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS"
%meson -Dconvert_mandocs=enabled -Dtest_abi_compat=enabled
%meson_build

%install
%makeinstall
%meson_install
install -m 0644 src/abignore %{buildroot}%{_includedir}/efivar/.abignore

%check
%ifarch x86_64
make abicheck
%meson_test
%endif

%ldconfig_scriptlets libs
Expand Down
15 changes: 15 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
project('efivar', 'c', license: 'LGPL-2.1-only', version: '38')

lib_ver = '1.@0@'.format(meson.project_version())
add_project_arguments('-DLIBEFIVAR_VERSION=@0@'.format(meson.project_version()), language : 'c')

configure_file(input : 'efivar.spec.in', output : 'efivar.spec', configuration : {'version' : meson.project_version()})

subdir('src')
subdir('docs')

if meson.can_run_host_binaries()
subdir('tests')
else
warning('Your build machine cannot run target binaries: Disabling tests.\n\tIf you are cross compiling, ensure the exe_wrapper option is set.')
endif
4 changes: 4 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
option('convert_mandocs', type : 'feature', value : 'auto', description : 'Convert man pages in mdoc format to man format.')
option('generate_abi_xml', type : 'feature', value : 'disabled', description : 'Generate ABI XML files with abidw')
option('test_abi_compat', type : 'feature', value : 'disabled', description : 'Test ABI compatibility with abidiff')
option('test_with_grubenv', type : 'feature', value : 'auto', description : 'Enable testing with grubenv')
Loading