Merge pull request #1 from Rirusha/main

Make life easier for specialists with many years of experience
This commit is contained in:
Maxim Slipenko 2025-01-17 18:00:18 +03:00 committed by GitHub
commit 69635cc0f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 3 deletions

View File

@ -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,

View 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