Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ See [NEWS](https://gitlab.xfce.org/xfce/xfwm4/-/blob/master/NEWS) for details on
From source:

% cd xfwm4
% ./autogen.sh
% make
% make install
% meson build
% ninja -C build
% ninja -C build install

From release tarball:

Expand Down
3 changes: 3 additions & 0 deletions common/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
xfwm_common = static_library('xfwm-common',
'xfwm-common.c',
dependencies: gtk)
165 changes: 165 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
project('xfwm4', 'c',
version: '4.20.0',
meson_version: '>=0.54',
default_options: 'c_std=gnu11',)

xfwm4_version = meson.project_version()

ver_arr = xfwm4_version.split('.')

xfwm4_major_version = ver_arr[0]
xfwm4_minor_version = ver_arr[1]
xfwm4_micro_version = ver_arr[2]

glib_minimum_version = '2.72.0'
gtk_minimum_version = '3.24.0'
xfce_minimum_version = '4.8.0'
libxfce4ui_minimum_version = '4.12.0'
libxfce4kbd_private_minimum_version = '4.12.0'
xfconf_minimum_version = '4.13.0'
xfconf_legacy_version = '4.12.0'
xcomposite_minimum_version = '0.2'
wnck_minimum_version = '3.14'
startup_notification_minimum_version = '0.5'
intltool_minimum_version = '0.35'
libepoxy_minimum_version = '1.0'
xpresent_minimum_version = '1.0'
presentproto_minimum_version = '1.1'

prefix = get_option('prefix')

bindir = join_paths(prefix, get_option('bindir'))
datadir = join_paths(prefix, get_option('datadir'))
libdir = join_paths(prefix, get_option('libdir'))
libexecdir = join_paths(prefix, get_option('libexecdir'))
includedir = join_paths(prefix, get_option('includedir'))
sysconfdir = get_option('sysconfdir')

pkgname = meson.project_name()

pkgdatadir = join_paths(datadir, pkgname)
pkglibdir = join_paths(libdir, pkgname)
pkgincludedir = join_paths(includedir, pkgname)

pcdir = join_paths(libdir, 'pkgconfig')

gettext_package = meson.project_name()
localedir = join_paths(datadir, 'locale')

top_srcdir = meson.current_source_dir()
builddir = meson.current_build_dir()

#localedir = '"' + get_option('localedir') + '"'


add_project_arguments('-DWLR_USE_UNSTABLE', language: 'c')

cc = meson.get_compiler('c')

wayland_server = dependency('wayland-server')
wayland_client = dependency('wayland-client')
wayland_cursor = dependency('wayland-cursor')
wayland_egl = dependency('wayland-egl')
wayland_protos = dependency('wayland-protocols', version: '>=1.14')
pixman = dependency('pixman-1')
cairo = dependency('cairo')
pango = dependency('pango')
pangocairo = dependency('pangocairo')
glesv2 = dependency('glesv2')
wlroots = dependency('wlroots', version: ['>=0.17.0', '<0.18.0'])
xkbcommon = dependency('xkbcommon')
glib = dependency('glib-2.0', version: '>=' + glib_minimum_version)
x11 = dependency('x11')
compositor = [
dependency('xcomposite'),
dependency('xfixes'),
dependency('xdamage'),
]
xrender = dependency('xrender')
xext = dependency('xext')
xrandr = dependency('xrandr')
libinput = dependency('libinput', version: '>=1.10.0')
egl = dependency('egl', version: '>=1.0.0')
evdev = dependency('libevdev', version: '>=1.5.8')
libxml2 = dependency('libxml-2.0')
gtk = dependency('gtk+-3.0', version: '>=' + gtk_minimum_version)
libxfce4util = dependency('libxfce4util-1.0',
version: '>=' + xfce_minimum_version)
libxfce4ui = dependency('libxfce4ui-2',
version: '>=' + libxfce4ui_minimum_version)
libxfce4kbd_private = dependency('libxfce4kbd-private-3',
version: '>='
+ libxfce4kbd_private_minimum_version)
libxfconf = dependency('libxfconf-0', version: '>=' + xfconf_minimum_version)
libwnck = dependency('libwnck-3.0',
version: '>=' + wnck_minimum_version)
xinerama = dependency('xinerama')

m_dep = cc.find_library('m')

wlroots_features = {
'xwayland': false,
'libinput_backend': false,
'session': false,
}
foreach name, _: wlroots_features
var_name = 'have_' + name.underscorify()
have = wlroots.get_variable(pkgconfig: var_name, internal: var_name) == 'true'
wlroots_features += {name: have}
endforeach

# glibc lacks strl*. if we can't detect them, assume we need libbsd
lacking_libc = false
if cc.has_function('strlcpy') == false or cc.has_function('strlcat') == false
lacking_libc = true
bsd_overlay = dependency('libbsd-overlay')
endif

if wlroots_features['xwayland']
xcb = dependency('xcb', required: true)

if xcb.found()
add_project_arguments('-DUSE_XWAYLAND', language: 'c')
endif
endif



conf_data = configuration_data()
conf_data.set('PACKAGE', '"' + pkgname + '"')
conf_data.set('VERSION', '"' + xfwm4_version + '"')
conf_data.set('REVISION', '"bdb2b4f88"')
conf_data.set('GETTEXT_PACKAGE', '"' + gettext_package + '"')
conf_data.set('PACKAGE_NAME', '"' + pkgname + '"')
conf_data.set('PACKAGE_LOCALE_DIR', '"' + localedir + '"')
conf_data.set('HAVE_LIBX11', 1)
conf_data.set('HAVE_COMPOSITOR', 1)

exec_prefix = get_option ('prefix')
helper_path_prefix = exec_prefix + '/lib'

add_global_arguments('-DHAVE_CONFIG_H', language: 'c')
add_global_arguments('-DDATADIR=' + '"' + datadir + '"', language: 'c')
add_global_arguments('-DPACKAGE_DATADIR=' + '"' + pkgdatadir + '"', language: 'c')
add_global_arguments('-DHELPERDIR=' + '"' + helper_path_prefix + '"', language: 'c')
add_global_arguments('-DBINDIR=' + '"' + bindir + '"', language: 'c')

add_project_arguments(
'-Wno-unused-parameter',
'-Wno-unused-variable',
'-D_DEFAULT_SOURCE',
'-D_POSIX_C_SOURCE=200112L',
'-DWLR_USE_UNSTABLE',
'-DPACKAGE_NAME="' + meson.project_name() + '"',
'-DPACKAGE_VERSION="' + meson.project_version() + '"',
language: 'c')

configure_file(output: 'config.h',
configuration: conf_data
)

incdir = include_directories('.')

subdir('protocol')
subdir('common')
subdir('src')
2 changes: 2 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
option('xwayland', type: 'boolean', value: true,
description: 'Whether Xwayland support is enabled')
36 changes: 36 additions & 0 deletions protocol/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ACLOCAL_AMFLAGS = -I m4

unstable_protocols_SOURCES = \
xfway-shell.xml \
$(NULL)

unstable_protocols_CFLAGS = \
$(WAYLAND_PROTOCOLS_CFLAGS) \
$(NULL)

unstable_protocols_LDADD = \
$(WAYLAND_PROTOCOLS_LIBS) \
$(NULL)

stable_protocols = \
\
$(NULL)

nobase_dist_pkgdata_DATA = \
$(unstable_protocols) \
$(stable_protocols) \
$(NULL)

#dist_noinst_DATA = \
#$(sort $(foreach p,$(unstable_protocols),$(dir $p)README)) \
#$(sort $(foreach p,$(stable_protocols),$(dir $p)README)) \
# $(NULL)

#noarch_pkgconfig_DATA = wayland-protocols.pc

dist_check_SCRIPTS = scan.sh

TESTS = $(unstable_protocols) $(stable_protocols)
TEST_EXTENSIONS = .xml
AM_TESTS_ENVIRONMENT = SCANNER='$(wayland_scanner)'; export SCANNER;
XML_LOG_COMPILER = $(srcdir)/scan.sh
85 changes: 85 additions & 0 deletions protocol/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
wayland_protos_inc = include_directories('.')


wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir')

wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)
if wayland_scanner_dep.found()
wayland_scanner = find_program(
wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'),
native: true,
)
else
wayland_scanner = find_program('wayland-scanner', native: true)
endif

protocols = [
[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
['wlr-layer-shell-unstable-v1.xml'],
['wlr-foreign-toplevel-management-unstable-v1.xml'],
['xfway-shell.xml'],
['wlr-gamma-control-unstable-v1.xml'],
['wlr-screencopy-unstable-v1.xml'],
]

client_protocols = [
[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
['wlr-layer-shell-unstable-v1.xml'],
['wlr-foreign-toplevel-management-unstable-v1.xml'],
['xfway-shell.xml'],
['wlr-gamma-control-unstable-v1.xml'],
['wlr-screencopy-unstable-v1.xml'],
]

wl_protos_src = []
wl_protos_headers = []

foreach p : protocols
xml = join_paths(p)
wl_protos_src += custom_target(
xml.underscorify() + '_server_c',
input: xml,
output: '@[email protected]',
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
)
wl_protos_headers += custom_target(
xml.underscorify() + '_server_h',
input: xml,
output: '@[email protected]',
command: [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'],
)
endforeach


foreach p : client_protocols
xml = join_paths(p)
wl_protos_headers += custom_target(
xml.underscorify() + '_client_h',
input: xml,
output: '@[email protected]',
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
)
endforeach


xfwm_lib_client_protos = static_library(
'xfwm_client_protos',
wl_protos_src + wl_protos_headers,
dependencies: wayland_client.partial_dependency(compile_args: true),
)

xfwm_client_protos = declare_dependency(
link_with: xfwm_lib_client_protos,
sources: wl_protos_headers,
)

xfwm_lib_server_protos = static_library(
'xfwm_server_protos',
wl_protos_src + wl_protos_headers,
dependencies: wayland_server.partial_dependency(compile_args: true),
)

xfwm_server_protos = declare_dependency(
link_with: xfwm_lib_server_protos,
sources: wl_protos_headers,
)
11 changes: 11 additions & 0 deletions protocol/scan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh -e

if [ "x$SCANNER" = "x" ] ; then
echo "No scanner present, test skipped." 1>&2
exit 77
fi

$SCANNER client-header --strict $1 /dev/null
$SCANNER server-header --strict $1 /dev/null
$SCANNER private-code --strict $1 /dev/null
$SCANNER public-code --strict $1 /dev/null
Loading