From c339b0c354549b4f6818b42895c2ba94d135b877 Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Sun, 19 May 2024 04:47:02 +0200 Subject: [PATCH 01/12] Initial commit of meson.build files. This right now is not working yet, but shortly I will have some more time to make it working. --- demo/meson.build | 17 +++++++++ docs/meson.build | 6 ++++ img/meson.build | 25 ++++++++++++++ meson.build | 28 +++++++++++++++ src/meson.build | 90 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 166 insertions(+) create mode 100644 demo/meson.build create mode 100644 docs/meson.build create mode 100644 img/meson.build create mode 100644 meson.build create mode 100644 src/meson.build diff --git a/demo/meson.build b/demo/meson.build new file mode 100644 index 0000000..81c232e --- /dev/null +++ b/demo/meson.build @@ -0,0 +1,17 @@ +state_files = ['Clarett\ Plus\ 2Pre.state', +'Clarett\ Plus\ 4Pre.state', +'Clarett\ Plus\ 8Pre.state', +'Scarlett\ Gen\ 2\ 18i20.state', +'Scarlett\ Gen\ 2\ 18i8.state', +'Scarlett\ Gen\ 2\ 6i6.state', +'Scarlett\ Gen\ 3\ 18i20.state', +'Scarlett\ Gen\ 3\ 18i8.state', +'Scarlett\ Gen\ 3\ 2i2.state', +'Scarlett\ Gen\ 3\ 4i4.state', +'Scarlett\ Gen\ 3\ 8i6.state', +'Scarlett\ Gen\ 3\ Solo.state', +'Scarlett\ Gen\ 4\ 2i2.state', +'Scarlett\ Gen\ 4\ 4i4.state', +'Scarlett\ Gen\ 4\ Solo.state', +'Vocaster\ One.state', +'Vocaster\ Two.state'] diff --git a/docs/meson.build b/docs/meson.build new file mode 100644 index 0000000..bd0d3f7 --- /dev/null +++ b/docs/meson.build @@ -0,0 +1,6 @@ +docs = ['INSTALL.md', +'OLDKERNEL.md', +'USAGE.md', +'iface-4th-gen.md', +'iface-large.md', +'iface-small.md'] diff --git a/img/meson.build b/img/meson.build new file mode 100644 index 0000000..18e4d53 --- /dev/null +++ b/img/meson.build @@ -0,0 +1,25 @@ +images = ['demo.gif', +'firmware-missing.png', +'firmware-update-required.png', +'firmware-updating.png', +'iface-4th-gen.png', +'iface-msd.png', +'iface-none.png', +'iface-small-gen3.png', +'main-global.png', +'main-inputs.png', +'main-outputs.png', +'routing-direct.png', +'scarlett-4th-gen-2i2-monitor.gif', +'scarlett-4th-gen-2i2-routing.png', +'scarlett-4th-gen-4i4-routing.png', +'scarlett-4th-gen-solo-mix-e-f.png', +'scarlett-4th-gen-solo-mix.gif', +'scarlett-4th-gen-solo-monitor.gif', +'window-levels-3rd-gen.png', +'window-levels-4th-gen.gif', +'window-main.png', +'window-mixer.png', +'window-routing.png', +'window-startup.png'] + diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..22c0200 --- /dev/null +++ b/meson.build @@ -0,0 +1,28 @@ +project('alsa-scarlett-gui','c', + version: '0.4.0', + license: 'GPLv3, LGPLv3', + meson_version: '>= 1.0.0', + ) + +add_global_arguments( '-DSOME_TOKEN=value', language : 'c') + +cc = meson.get_compiler('c') + +prefix = get_option('prefix') + +bindir = join_paths(prefix, get_option('bindir')) +datadir = join_paths(prefix, get_option('datadir')) +libexecdir = join_paths(prefix, get_option('libexecdir')) +localedir = join_paths(prefix, get_option('localedir')) + +glib_dep = dependency('glib-2.0', version : '>= 2.56.0') +gtk4_dep = dependency('gtk4', version : '>= 4.5.0') +alsa_dep = dependency('alsa', version : '>= 1.2.0') + +root_inc = include_directories('.') + +subdir('src') +subdir('demo') +subdir('img') +subdir('docs') + diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..e5b1c1a --- /dev/null +++ b/src/meson.build @@ -0,0 +1,90 @@ +sources = ['about.c', +'about.h', +'alsa-sim.c', +'alsa-sim.h', +'alsa.c', +'alsa.h', +'const.h', +'device-reset-config.c', +'device-reset-config.h', +'device-update-firmware.c', +'device-update-firmware.h', +'error.c', +'error.h', +'file.c', +'file.h', +'gtkdial.c', +'gtkdial.h', +'gtkhelper.c', +'gtkhelper.h', +'hardware.c', +'hardware.h', +'iface-mixer.c', +'iface-mixer.h', +'iface-no-mixer.c', +'iface-no-mixer.h', +'iface-none.c', +'iface-none.h', +'iface-unknown.c', +'iface-unknown.h', +'iface-update.c', +'iface-update.h', +'main.c', +'main.h', +'menu.c', +'menu.h', +'routing-drag-line.c', +'routing-drag-line.h', +'routing-lines.c', +'routing-lines.h', +'scarlett2-firmware.c', +'scarlett2-firmware.h', +'scarlett2-ioctls.c', +'scarlett2-ioctls.h', +'scarlett2.h', +'stringhelper.c', +'stringhelper.h', +'tooltips.c', +'tooltips.h', +'widget-boolean.c', +'widget-boolean.h', +'widget-drop-down.c', +'widget-drop-down.h', +'widget-dual.c', +'widget-dual.h', +'widget-gain.c', +'widget-gain.h', +'widget-input-select.c', +'widget-input-select.h', +'widget-label.c', +'widget-label.h', +'widget-sample-rate.c', +'widget-sample-rate.h', +'window-hardware.c', +'window-hardware.h', +'window-helper.c', +'window-helper.h', +'window-iface.c', +'window-iface.h', +'window-levels.c', +'window-levels.h', +'window-mixer.c', +'window-mixer.h', +'window-modal.c', +'window-modal.h', +'window-routing.c', +'window-routing.h', +'window-startup.c', +'window-startup.h'] + +executable( 'alsa-scarlett-gui' , sources , + dependencies: [ + glib_dep, + gtk4_dep, + alsa_dep + ], + install: true ) + +#alsa-scarlett-gui-resources.xml +#alsa-scarlett-gui.css +#vu.b4.alsa-scarlett-gui.desktop.template From f543a9169d40fef94d61cbca55a3a0ac8a221668 Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Sun, 19 May 2024 22:53:44 +0200 Subject: [PATCH 02/12] Added add_project_arguments function to make sure we get the correct VERSION variable substitution at complie time. This is how the original MAkefile does it, it adds the VERSION at complie time to be replaced in the .c files. Probably an more elegant solution would be to use the config.h file. --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 22c0200..e415159 100644 --- a/meson.build +++ b/meson.build @@ -4,7 +4,8 @@ project('alsa-scarlett-gui','c', meson_version: '>= 1.0.0', ) -add_global_arguments( '-DSOME_TOKEN=value', language : 'c') +#add_global_arguments( '-DSOME_TOKEN=value', language : 'c') +add_project_arguments( '-DVERSION="@0@"'.format(meson.project_version()), language : 'c') cc = meson.get_compiler('c') From d458d3cad2212f2e8d39c01f1970233a08d63103 Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Sun, 19 May 2024 22:59:52 +0200 Subject: [PATCH 03/12] Added functionality to find the libm dependency. --- meson.build | 2 ++ src/meson.build | 1 + 2 files changed, 3 insertions(+) diff --git a/meson.build b/meson.build index e415159..817030b 100644 --- a/meson.build +++ b/meson.build @@ -9,6 +9,8 @@ add_project_arguments( '-DVERSION="@0@"'.format(meson.project_version()), langua cc = meson.get_compiler('c') +m_dep = cc.find_library('m', required : false) + prefix = get_option('prefix') bindir = join_paths(prefix, get_option('bindir')) diff --git a/src/meson.build b/src/meson.build index e5b1c1a..6eaa668 100644 --- a/src/meson.build +++ b/src/meson.build @@ -79,6 +79,7 @@ sources = ['about.c', executable( 'alsa-scarlett-gui' , sources , dependencies: [ + m_dep, glib_dep, gtk4_dep, alsa_dep From 9c88252335e3324acc07abc7a93b1cb57255ab1a Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Sun, 19 May 2024 23:36:21 +0200 Subject: [PATCH 04/12] Added also dependency for libcrypto which is required by the project. --- meson.build | 6 ++++-- src/meson.build | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 817030b..c0498b8 100644 --- a/meson.build +++ b/meson.build @@ -9,8 +9,6 @@ add_project_arguments( '-DVERSION="@0@"'.format(meson.project_version()), langua cc = meson.get_compiler('c') -m_dep = cc.find_library('m', required : false) - prefix = get_option('prefix') bindir = join_paths(prefix, get_option('bindir')) @@ -18,6 +16,10 @@ datadir = join_paths(prefix, get_option('datadir')) libexecdir = join_paths(prefix, get_option('libexecdir')) localedir = join_paths(prefix, get_option('localedir')) +# Compile time and link time dependencies. +m_dep = cc.find_library('m', required : false) +crypto_dep = dependency('libcrypto', required : true) + glib_dep = dependency('glib-2.0', version : '>= 2.56.0') gtk4_dep = dependency('gtk4', version : '>= 4.5.0') alsa_dep = dependency('alsa', version : '>= 1.2.0') diff --git a/src/meson.build b/src/meson.build index 6eaa668..36aa1bd 100644 --- a/src/meson.build +++ b/src/meson.build @@ -80,6 +80,7 @@ sources = ['about.c', executable( 'alsa-scarlett-gui' , sources , dependencies: [ m_dep, + crypto_dep, glib_dep, gtk4_dep, alsa_dep From d4d6ec82aee721ab238ac9f7052f7a6affafc2f5 Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Mon, 20 May 2024 02:10:43 +0200 Subject: [PATCH 05/12] Added -pie option to the executable as in the original Makefile. --- src/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/src/meson.build b/src/meson.build index 36aa1bd..b0d83c2 100644 --- a/src/meson.build +++ b/src/meson.build @@ -85,6 +85,7 @@ executable( 'alsa-scarlett-gui' , sources , gtk4_dep, alsa_dep ], + pie: true, install: true ) #alsa-scarlett-gui-resources.xml From 9a0b327dd2fa8a0de261bbede3a9b82e780cf7d4 Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Mon, 20 May 2024 02:13:12 +0200 Subject: [PATCH 06/12] Fixed version variable to be set from git as in the original Makefile. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c0498b8..c2f0c4f 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('alsa-scarlett-gui','c', - version: '0.4.0', + version: run_command('git', 'describe', '--abbrev=4', '--dirty', '--always', check: true).stdout().strip(), license: 'GPLv3, LGPLv3', meson_version: '>= 1.0.0', ) From 02f69435d0530071c45bcd89ab1d6e80c58c6e4a Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Sun, 26 May 2024 03:28:30 +0200 Subject: [PATCH 07/12] Added resources compilation stuff. Still not buildable, need to fix it. --- meson.build | 2 ++ src/meson.build | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index c2f0c4f..fbbc870 100644 --- a/meson.build +++ b/meson.build @@ -7,6 +7,8 @@ project('alsa-scarlett-gui','c', #add_global_arguments( '-DSOME_TOKEN=value', language : 'c') add_project_arguments( '-DVERSION="@0@"'.format(meson.project_version()), language : 'c') +gnome = import('gnome') + cc = meson.get_compiler('c') prefix = get_option('prefix') diff --git a/src/meson.build b/src/meson.build index b0d83c2..0468285 100644 --- a/src/meson.build +++ b/src/meson.build @@ -77,7 +77,13 @@ sources = ['about.c', 'window-startup.c', 'window-startup.h'] -executable( 'alsa-scarlett-gui' , sources , + +resources = gnome.compile_resources('alsa-scarlett-gui-resources', + 'alsa-scarlett-gui-resources.xml', + source_dir: '.', + c_name: 'alsa-scarlett-gui-resources') + +executable( 'alsa-scarlett-gui' , sources + resources , dependencies: [ m_dep, crypto_dep, @@ -88,6 +94,5 @@ executable( 'alsa-scarlett-gui' , sources , pie: true, install: true ) -#alsa-scarlett-gui-resources.xml #alsa-scarlett-gui.css #vu.b4.alsa-scarlett-gui.desktop.template From 6817ecd6eec1f2f4ec62542fc3fd46b25e93f9ae Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Sun, 26 May 2024 04:16:46 +0200 Subject: [PATCH 08/12] Fixed the resources c_name to make the project compile. --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index 0468285..c6b27f0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -81,7 +81,7 @@ sources = ['about.c', resources = gnome.compile_resources('alsa-scarlett-gui-resources', 'alsa-scarlett-gui-resources.xml', source_dir: '.', - c_name: 'alsa-scarlett-gui-resources') + c_name: 'resources') executable( 'alsa-scarlett-gui' , sources + resources , dependencies: [ From 78edc43728baa5251ae71035bc93bdaae2aa2fc1 Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Mon, 27 May 2024 01:36:12 +0200 Subject: [PATCH 09/12] Started work for installing files into proper locations. --- img/meson.build | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/img/meson.build b/img/meson.build index 18e4d53..a4b883d 100644 --- a/img/meson.build +++ b/img/meson.build @@ -1,4 +1,4 @@ -images = ['demo.gif', +images = files('demo.gif', 'firmware-missing.png', 'firmware-update-required.png', 'firmware-updating.png', @@ -21,5 +21,11 @@ images = ['demo.gif', 'window-main.png', 'window-mixer.png', 'window-routing.png', -'window-startup.png'] +'window-startup.png') + +install_data( + images , + install_dir: datadir / 'alsa-scarlett-gui/img', +) + From b4e468701e9b655583574ae86fb11063313a9a58 Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Mon, 27 May 2024 01:43:39 +0200 Subject: [PATCH 10/12] Started work for installing files into proper locations. --- docs/meson.build | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/meson.build b/docs/meson.build index bd0d3f7..fd3c45a 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -1,6 +1,12 @@ -docs = ['INSTALL.md', +docs = files('INSTALL.md', 'OLDKERNEL.md', 'USAGE.md', 'iface-4th-gen.md', 'iface-large.md', -'iface-small.md'] +'iface-small.md') + +install_data( + docs, + install_dir: datadir / 'alsa-scarlett-gui/docs', +) + From a7496b7877b4b69d6a58655321eca5dae3f443d7 Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Mon, 27 May 2024 01:47:31 +0200 Subject: [PATCH 11/12] Started work for installing files into proper locations. --- demo/meson.build | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/demo/meson.build b/demo/meson.build index 81c232e..6ddcc9c 100644 --- a/demo/meson.build +++ b/demo/meson.build @@ -1,4 +1,4 @@ -state_files = ['Clarett\ Plus\ 2Pre.state', +state_files = files('Clarett\ Plus\ 2Pre.state', 'Clarett\ Plus\ 4Pre.state', 'Clarett\ Plus\ 8Pre.state', 'Scarlett\ Gen\ 2\ 18i20.state', @@ -14,4 +14,10 @@ state_files = ['Clarett\ Plus\ 2Pre.state', 'Scarlett\ Gen\ 4\ 4i4.state', 'Scarlett\ Gen\ 4\ Solo.state', 'Vocaster\ One.state', -'Vocaster\ Two.state'] +'Vocaster\ Two.state') + +install_data( + state_files, + install_dir: datadir / 'alsa-scarlett-gui/demo', +) + From 52dabd0464e51bb879b6054e4f5015a792b97a63 Mon Sep 17 00:00:00 2001 From: Sasa Ostrouska Date: Mon, 27 May 2024 02:01:34 +0200 Subject: [PATCH 12/12] Removed a backslash in filenames as its not needed. --- demo/meson.build | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/demo/meson.build b/demo/meson.build index 6ddcc9c..d22de53 100644 --- a/demo/meson.build +++ b/demo/meson.build @@ -1,20 +1,20 @@ -state_files = files('Clarett\ Plus\ 2Pre.state', -'Clarett\ Plus\ 4Pre.state', -'Clarett\ Plus\ 8Pre.state', -'Scarlett\ Gen\ 2\ 18i20.state', -'Scarlett\ Gen\ 2\ 18i8.state', -'Scarlett\ Gen\ 2\ 6i6.state', -'Scarlett\ Gen\ 3\ 18i20.state', -'Scarlett\ Gen\ 3\ 18i8.state', -'Scarlett\ Gen\ 3\ 2i2.state', -'Scarlett\ Gen\ 3\ 4i4.state', -'Scarlett\ Gen\ 3\ 8i6.state', -'Scarlett\ Gen\ 3\ Solo.state', -'Scarlett\ Gen\ 4\ 2i2.state', -'Scarlett\ Gen\ 4\ 4i4.state', -'Scarlett\ Gen\ 4\ Solo.state', -'Vocaster\ One.state', -'Vocaster\ Two.state') +state_files = files('Clarett Plus 2Pre.state', +'Clarett Plus 4Pre.state', +'Clarett Plus 8Pre.state', +'Scarlett Gen 2 18i20.state', +'Scarlett Gen 2 18i8.state', +'Scarlett Gen 2 6i6.state', +'Scarlett Gen 3 18i20.state', +'Scarlett Gen 3 18i8.state', +'Scarlett Gen 3 2i2.state', +'Scarlett Gen 3 4i4.state', +'Scarlett Gen 3 8i6.state', +'Scarlett Gen 3 Solo.state', +'Scarlett Gen 4 2i2.state', +'Scarlett Gen 4 4i4.state', +'Scarlett Gen 4 Solo.state', +'Vocaster One.state', +'Vocaster Two.state') install_data( state_files,