Compare commits

...

4 Commits

Author SHA1 Message Date
2d5195957d build: remove useless build deps 2025-01-17 18:06:09 +03:00
69635cc0f1
Merge pull request #1 from Rirusha/main
Make life easier for specialists with many years of experience
2025-01-17 18:00:18 +03:00
Vladimir Vaskov
ef57081f00
build: Remove some unnecessary args 2025-01-17 17:57:37 +03:00
Vladimir Vaskov
3663272063
build: Add detection script for a better package maintenance experience 2025-01-17 17:56:31 +03:00
2 changed files with 29 additions and 8 deletions

View File

@ -14,19 +14,22 @@ i18n = import('i18n')
# Dependencies
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')
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', check: true)
if result.returncode() != 0
error(result.stderr())
endif
libphosh_version = result.stdout().strip()
libphosh_dep = dependency('libphosh-' + libphosh_version)
plugin_deps = [
gobject_dep,
gtk_dep,
libhandy_dep,
libnm_dep,
phosh_plugins_dep,
libphosh_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