fix(linux): Fix packaging on Ubuntu and Debian servers

When building packages warnings are treated as errors. When building on
Ubuntu and Debian servers we don't have a patched ibus version but still
want to build the packages. So this change outputs a message instead of
a warning when building packages.
This commit is contained in:
Eberhard Beilharz 2024-01-29 15:29:14 +01:00
parent eeb03e1c0c
commit 6b5b44eddd
No known key found for this signature in database
GPG key ID: E9140597606020D3
5 changed files with 23 additions and 5 deletions

View file

@ -33,7 +33,8 @@ override_dh_auto_configure:
linux/keyman-system-service/build.sh configure -- \
--wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var
linux/ibus-keyman/build.sh configure -- \
--wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var
--wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
-Dkeyman_deb_pkg_build=true
linux/keyman-config/build.sh configure
override_dh_auto_build:

View file

@ -1,10 +1,6 @@
project('ibus-keyman', 'c', 'cpp',
version: run_command('cat', '../../VERSION.md', check: true).stdout().strip(),
license: 'GPL-2+',
# default_options : ['buildtype=release',
# 'cpp_std=c++14',
# 'b_vscrt=static_from_buildtype',
# 'warning_level=2'],
meson_version: '>=0.53.0')
cc = meson.get_compiler('c')
conf = configuration_data()
@ -23,6 +19,10 @@ keymancore_lib = cc.find_library(
dirs: [ core_dir / 'build/arch' / get_option('buildtype') / 'src' ]
)
if get_option('keyman_deb_pkg_build')
add_global_arguments('-DKEYMAN_PKG_BUILD', language: ['cpp', 'c'])
endif
env = find_program('env')
# Check if we have patched ibus (https://github.com/ibus/ibus/pull/2440)

View file

@ -0,0 +1 @@
option('keyman_deb_pkg_build', type: 'boolean', value: false, description: 'Building .deb package?')

View file

@ -40,7 +40,15 @@
// Fallback for older ibus versions that don't define IBUS_PREFILTER_MASK
#ifndef IBUS_HAS_PREFILTER
#ifdef KEYMAN_PKG_BUILD
// When building packages on Ubuntu and Debian servers we probably don't have
// a patched ibus available and additionally treat warnings as errors, but
// still want to build packages.
#pragma message "Compiling against ibus version that does not include prefilter mask patch\n(https://github.com/ibus/ibus/pull/2440). Output ordering guarantees will be disabled."
#else
#warning Compiling against ibus version that does not include prefilter mask patch (https://github.com/ibus/ibus/pull/2440). Output ordering guarantees will be disabled.
#endif
#define IBUS_PREFILTER_MASK (1 << 23)
#endif

View file

@ -31,7 +31,15 @@
#include <config.h>
#ifndef IBUS_HAS_PREFILTER
#ifdef KEYMAN_PKG_BUILD
// When building packages on Ubuntu and Debian servers we probably don't have
// a patched ibus available and additionally treat warnings as errors, but
// still want to build packages.
#pragma message "Compiling against ibus version that does not include prefilter mask patch\n(https://github.com/ibus/ibus/pull/2440). Output ordering guarantees will be disabled."
#else
#warning Compiling against ibus version that does not include prefilter mask patch (https://github.com/ibus/ibus/pull/2440). Output ordering guarantees will be disabled.
#endif
#define IBUS_PREFILTER_MASK (1 << 23)
#endif