Merge branch 'split_package' into 'master'

build: support split packaging for buffyboard and unl0kr

Closes #48

See merge request postmarketOS/buffybox!54
This commit is contained in:
Johannes Marbach 2025-05-12 12:39:12 +00:00
commit ba3f08698e
6 changed files with 83 additions and 23 deletions

View file

@ -11,6 +11,7 @@ If a change only affects particular applications, they are listed in parentheses
## Unreleased
- misc: Use standard C library instead of builtin functions (!49, thanks @vstoiakin)
- feat: Add support for split packaging of buffyboard and unl0kr (!54, thanks @vstoiakin)
## 3.3.0 (2025-04-15)

View file

@ -54,6 +54,38 @@ On distributions based on systemd, `unl0kr` can be used as a [password agent](ht
# systemd-ask-password --no-tty # Unl0kr is started
```
## Packaging
Create a full package:
```
meson setup builddir/
meson compile -C builddir/
meson install -C builddir/ --destdir "$pkgdir"
```
Create separate packages for Buffyboard and Unl0kr:
```
meson setup builddir/
meson compile -C builddir/
meson install -C builddir/ --tags=unl0kr --destdir "$pkgdir_unl0kr"
meson install -C builddir/ --tags=buffyboard --destdir "$pkgdir_buffyboard"
```
Create a package for Unl0kr only:
```
meson setup builddir/
meson compile -C builddir/ unl0kr/unl0kr
meson compile -C builddir/ unl0kr/unl0kr-agent # on systemd-based distributions
meson install -C builddir/ --tags=unl0kr --destdir "$pkgdir"
```
Create a package for Buffyboard only:
```
meson setup builddir/
meson compile -C builddir/ buffyboard/buffyboard
meson install -C builddir/ --tags=buffyboard --destdir "$pkgdir"
```
## Making a release
To make it easier for distributions to package BuffyBox, we include source tarballs including the LVGL submodule in GitLab releases. See [unl0kr#42] for more background on this.

View file

@ -19,25 +19,25 @@ executable('buffyboard',
include_directories: common_include_dirs,
sources: buffyboard_sources + shared_sources + squeek2lvgl_sources + lvgl_sources,
dependencies: buffyboard_dependencies,
install: true
install: true,
install_tag: 'buffyboard'
)
install_data('buffyboard.conf', install_dir: get_option('sysconfdir'))
install_data('buffyboard.conf',
install_dir: get_option('sysconfdir'),
install_tag: 'buffyboard'
)
systemd = dependency('systemd', required: get_option('systemd-buffyboard-service'))
if systemd.found()
system_unit_dir = systemd.get_variable(
pkgconfig: 'systemd_system_unit_dir',
pkgconfig_define: ['prefix', get_option('prefix')],
)
depsystemd = dependency('systemd', required: get_option('systemd-buffyboard-service'))
if depsystemd.found()
system_unit_dir = depsystemd.get_variable(pkgconfig: 'systemd_system_unit_dir')
configure_file(
input : 'buffyboard.service.in',
output : 'buffyboard.service',
install : true,
install_dir : system_unit_dir,
configuration : {
'bindir' : get_option('prefix') / get_option('bindir'),
},
configuration: {'bindir': get_option('prefix') / get_option('bindir')},
input: 'buffyboard.service.in',
output: 'buffyboard.service',
install: true,
install_dir: system_unit_dir,
install_tag: 'buffyboard'
)
endif

View file

@ -2,7 +2,24 @@ progscdoc = depscdoc.get_variable(pkgconfig: 'scdoc')
foreach file : [
'buffyboard.1',
'buffyboard.conf.5',
'buffyboard.conf.5'
]
section = file.split('.')[-1]
custom_target(file,
command: progscdoc,
feed: true,
capture: true,
input: file + '.scd',
output: file,
install: true,
install_dir: get_option('mandir') / 'man' + section,
install_tag: 'buffyboard'
)
endforeach
foreach file : [
'unl0kr.1',
'unl0kr.conf.5'
]
@ -16,6 +33,7 @@ foreach file : [
input: file + '.scd',
output: file,
install: true,
install_dir: get_option('mandir') / 'man' + section
install_dir: get_option('mandir') / 'man' + section,
install_tag: 'unl0kr'
)
endforeach

View file

@ -1,7 +1,7 @@
project('buffybox', 'c',
version: '3.3.0',
default_options: ['warning_level=3', 'b_ndebug=if-release'],
meson_version: '>= 0.59.0'
meson_version: '>= 0.60.0'
)
add_project_arguments(

View file

@ -30,10 +30,14 @@ executable('unl0kr',
sources: unl0kr_sources + shared_sources + squeek2lvgl_sources + lvgl_sources,
dependencies: unl0kr_dependencies,
c_args: unl0kr_args,
install: true
install: true,
install_tag: 'unl0kr'
)
install_data('unl0kr.conf', install_dir: get_option('sysconfdir'))
install_data('unl0kr.conf',
install_dir: get_option('sysconfdir'),
install_tag: 'unl0kr'
)
depsystemd = dependency('systemd', required: get_option('systemd-password-agent'))
if depsystemd.found()
@ -42,18 +46,23 @@ if depsystemd.found()
dependencies: depinih,
c_args: '-DUNL0KR_BINARY="@0@"'.format(get_option('prefix') / get_option('bindir') / 'unl0kr'),
install: true,
install_dir: get_option('libexecdir')
install_dir: get_option('libexecdir'),
install_tag: 'unl0kr'
)
system_unit_dir = depsystemd.get_variable(pkgconfig: 'systemd_system_unit_dir')
install_data('unl0kr-agent.path', install_dir: system_unit_dir)
install_data('unl0kr-agent.path',
install_dir: system_unit_dir,
install_tag: 'unl0kr'
)
configure_file(
configuration: {'LIBEXECDIR': get_option('prefix') / get_option('libexecdir')},
input: 'unl0kr-agent.service.in',
output: 'unl0kr-agent.service',
install: true,
install_dir: system_unit_dir
install_dir: system_unit_dir,
install_tag: 'unl0kr'
)
endif