Skip to content

Commit

Permalink
Make brightnesscontroller wayland compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
fossfreedom committed Oct 31, 2024
1 parent 88cb751 commit e68a9de
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 95 deletions.
60 changes: 31 additions & 29 deletions budgie-brightness-controller/meson.build
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
am_cflags = [
'-fstack-protector',
'-pedantic',
'-Wstrict-prototypes',
'-Wundef',
'-Werror-implicit-function-declaration',
'-Wformat',
'-Wformat-security',
'-Werror=format-security',
'-Wconversion',
'-Wunused-variable',
'-Wunreachable-code',
'-Wall',
'-W'
]

PLUGIN = 'budgie-brightness-controller'
LIB_INSTALL_DIR = join_paths(prefix, libdir, 'budgie-desktop', 'plugins', PLUGIN)

DEPENDENCY_GNOME_SETTINGS_DAEMON = dependency('gnome-settings-daemon', version: '>=3.36.0')
DEPENDENCY_XRANDR = dependency('xrandr', version: '>=1.5.0')
DEPENDENCY_GTK = dependency('gtk+-3.0', version: '>=3.18')
DEPENDENCY_BUDGIE = dependency('budgie-1.0', version: '>=2')


message('Installing applet...')

subdir('src')
subdir('icons')
am_cflags = [
'-fstack-protector',
'-pedantic',
'-Wstrict-prototypes',
'-Wundef',
'-Werror-implicit-function-declaration',
'-Wformat',
'-Wformat-security',
'-Werror=format-security',
'-Wconversion',
'-Wunused-variable',
'-Wunreachable-code',
'-Wall',
'-W'
]

PLUGIN = 'budgie-brightness-controller'
LIB_INSTALL_DIR = join_paths(prefix, libdir, 'budgie-desktop', 'plugins', PLUGIN)

DEPENDENCY_GNOME_SETTINGS_DAEMON = dependency('gnome-settings-daemon', version: '>=3.36.0')

if for_wayland == false
DEPENDENCY_XRANDR = dependency('xrandr', version: '>=1.5.0')
endif
DEPENDENCY_GTK = dependency('gtk+-3.0', version: '>=3.18')
DEPENDENCY_BUDGIE = budgie_dep

message('Installing applet...')

subdir('src')
subdir('icons')
130 changes: 65 additions & 65 deletions budgie-brightness-controller/src/meson.build
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@

custom_target('plugin-brightness',
input : 'brightnesscontroller.plugin.in',
output : 'brightnesscontroller.plugin',
command : [intltool, '--desktop-style', podir, '@INPUT@', '@OUTPUT@'],
install : true,
install_dir : LIB_INSTALL_DIR)

AppletSources = [
'Applet.vala',
'widgets/IndicatorButton.vala',
'widgets/CustomMenuButton.vala',
'widgets/Popover.vala',
'widgets/CustomScale.vala',
'helpers/DimHelper.vala',
'helpers/LightHelper.vala',
'helpers/SubprocessHelper.vala',
'helpers/ConfigHelper.vala',
'models/Flame.vala',
'models/Dim.vala',
'models/Light.vala'
]

AppletDependencies = [
DEPENDENCY_GTK,
DEPENDENCY_BUDGIE
]

BudgieWmStatusValaArgs = []

if DEPENDENCY_GNOME_SETTINGS_DAEMON.version().version_compare('>=3.36.0')
BudgieWmStatusValaArgs += ['-D', 'HAVE_GNOME_SETTINGS_DAEMON_3_36_0']
endif

if DEPENDENCY_GNOME_SETTINGS_DAEMON.version().version_compare('>=3.32.0')
BudgieWmStatusValaArgs += ['-D', 'HAVE_GNOME_SETTINGS_DAEMON_3_32_0']
endif

if DEPENDENCY_GNOME_SETTINGS_DAEMON.version().version_compare('<3.32.0')
BudgieWmStatusValaArgs += ['-D', 'HAVE_GNOME_SETTINGS_DAEMON_OLDER_THAN_3_32_0']
endif

if DEPENDENCY_XRANDR.version().version_compare('>=1.5.0')
BudgieWmStatusValaArgs += ['-D', 'HAVE_XRANDR_1_5_0']
endif

AppletValaArgs = [
'--pkg=config',
'--vapidir=' + VAPI_DIR,
'--target-glib=2.38',
'--enable-deprecated',
BudgieWmStatusValaArgs
]

AppletCArgs = [
]

shared_library('brightnesscontroller',
AppletSources,
dependencies: AppletDependencies,
vala_args: AppletValaArgs,
c_args: AppletCArgs,
include_directories: config_inc_dir,
install: true,
install_dir: LIB_INSTALL_DIR)

custom_target('plugin-brightness',
input : 'brightnesscontroller.plugin.in',
output : 'brightnesscontroller.plugin',
command : [intltool, '--desktop-style', podir, '@INPUT@', '@OUTPUT@'],
install : true,
install_dir : LIB_INSTALL_DIR)

AppletSources = [
'Applet.vala',
'widgets/IndicatorButton.vala',
'widgets/CustomMenuButton.vala',
'widgets/Popover.vala',
'widgets/CustomScale.vala',
'helpers/DimHelper.vala',
'helpers/LightHelper.vala',
'helpers/SubprocessHelper.vala',
'helpers/ConfigHelper.vala',
'models/Flame.vala',
'models/Dim.vala',
'models/Light.vala'
]

AppletDependencies = [
DEPENDENCY_GTK,
DEPENDENCY_BUDGIE
]

BudgieWmStatusValaArgs = []

if DEPENDENCY_GNOME_SETTINGS_DAEMON.version().version_compare('>=3.36.0')
BudgieWmStatusValaArgs += ['-D', 'HAVE_GNOME_SETTINGS_DAEMON_3_36_0']
endif

if DEPENDENCY_GNOME_SETTINGS_DAEMON.version().version_compare('>=3.32.0')
BudgieWmStatusValaArgs += ['-D', 'HAVE_GNOME_SETTINGS_DAEMON_3_32_0']
endif

if DEPENDENCY_GNOME_SETTINGS_DAEMON.version().version_compare('<3.32.0')
BudgieWmStatusValaArgs += ['-D', 'HAVE_GNOME_SETTINGS_DAEMON_OLDER_THAN_3_32_0']
endif

if for_wayland == false and DEPENDENCY_XRANDR.version().version_compare('>=1.5.0')
BudgieWmStatusValaArgs += ['-D', 'HAVE_XRANDR_1_5_0']
endif

AppletValaArgs = [
'--pkg=config',
'--vapidir=' + VAPI_DIR,
'--target-glib=2.38',
'--enable-deprecated',
BudgieWmStatusValaArgs
]

AppletCArgs = [
]

shared_library('brightnesscontroller',
AppletSources,
dependencies: AppletDependencies,
vala_args: AppletValaArgs,
c_args: AppletCArgs,
include_directories: config_inc_dir,
install: true,
install_dir: LIB_INSTALL_DIR)
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ if build_recommended == true or build_fuzzyclock == true
endif

build_brightness_controller = get_option('build-brightness-controller')
if for_wayland == false and (build_recommended == true or build_brightness_controller == true)
#if for_wayland == false and (build_recommended == true or build_brightness_controller == true)
if build_recommended == true or build_brightness_controller == true
subdir('budgie-brightness-controller')
endif

Expand Down

0 comments on commit e68a9de

Please sign in to comment.