mirror of
https://github.com/Maks1mS/rg552-fancontrol-phosh-plugin.git
synced 2025-03-31 06:33:45 +03:00
Merge pull request #1 from Rirusha/main
Make life easier for specialists with many years of experience
This commit is contained in:
commit
69635cc0f1
15
meson.build
15
meson.build
@ -16,10 +16,19 @@ gobject_dep = dependency('gobject-2.0', version: glib_ver_cmp)
|
||||
gtk_dep = dependency('gtk+-3.0', version: '>=3.22')
|
||||
libhandy_dep = dependency('libhandy-1', version: '>=1.1.90', fallback: ['libhandy', 'libhandy_dep'], default_options: ['introspection=disabled'])
|
||||
libnm_dep = dependency('libnm', version: '>=1.14')
|
||||
phosh_plugins_dep = dependency('phosh-plugins', required: true, method: 'pkg-config')
|
||||
phosh_plugins_dep = dependency('phosh-plugins')
|
||||
|
||||
libphosh_version = get_option('libphosh_version') != '' ? get_option('libphosh_version') : '0.44'
|
||||
libphosh_dep = dependency('libphosh-' + libphosh_version, required: true, method: 'pkg-config')
|
||||
# Detect libphosh API version
|
||||
# Due to the unstable API, the version changes frequently,
|
||||
# which makes it difficult to maintain in the package repository.
|
||||
result = run_command('bash', 'scripts/detect-libphosh-api-version.sh')
|
||||
|
||||
if result.returncode() != 0
|
||||
error(result.stderr())
|
||||
endif
|
||||
|
||||
libphosh_version = result.stdout().strip()
|
||||
libphosh_dep = dependency('libphosh-' + libphosh_version)
|
||||
|
||||
plugin_deps = [
|
||||
gobject_dep,
|
||||
|
18
scripts/detect-libphosh-api-version.sh
Normal file
18
scripts/detect-libphosh-api-version.sh
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
pc_file=$(find "/usr/lib64/pkgconfig" -maxdepth 1 -type f -name "libphosh-*.pc" | head -n 1)
|
||||
|
||||
if [ -z "$pc_file" ]; then
|
||||
echo "File libphosh-*.pc not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
version=$(basename "$pc_file" | sed -E 's/^libphosh-([0-9.]+)\.pc$/\1/')
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
echo "Can't detect version of $pc_file."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo $version
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user