Commit dab769a0 authored by Christoph Reiter's avatar Christoph Reiter

meson: cups: use cups-config for looking up cups

We were looking for the cups headers and the cups lib in the default locations
which for example breaks with OpenBSD where the cups headers are under /usr/local/include/

Instead just use the "cups" dependency type from meson which internally uses cups-config.

Fixes #1967
parent d36fb51c
......@@ -69,38 +69,21 @@ if enabled_print_backends.contains('cloudprint')
endif
if enabled_print_backends.contains('cups')
cups_error = ''
if cc.has_header('cups/cups.h')
cups_major_version = cc.compute_int('CUPS_VERSION_MAJOR', prefix : '#include <cups/cups.h>')
cups_minor_version = cc.compute_int('CUPS_VERSION_MINOR', prefix : '#include <cups/cups.h>')
cups_version = '@0@.@1@'.format(cups_major_version, cups_minor_version)
message('Found CUPS version: @0@'.format(cups_version))
if cups_version.version_compare('<1.7')
cups_error = 'Need CUPS version >= 1.7'
else
libcups = cc.find_library('cups', required : true)
cups_dep = dependency('cups', version : '>=1.7', required: print_strict_deps)
if cups_dep.found()
cups_extra_deps = []
enable_colord = get_option('colord')
if enable_colord != 'no'
want_colord = enable_colord == 'yes'
colord_dep = dependency('colord', version: '>= 0.1.9', required: want_colord)
cdata.set('HAVE_COLORD', colord_dep.found() ? 1 : false)
cups_extra_deps += [colord_dep]
endif
else
cups_error = 'Cannot find CUPS headers in default prefix.'
endif
cups_extra_deps = []
enable_colord = get_option('colord')
if enable_colord != 'no'
want_colord = enable_colord == 'yes'
colord_dep = dependency('colord', version: '>= 0.1.9', required: want_colord)
cdata.set('HAVE_COLORD', colord_dep.found() ? 1 : false)
cups_extra_deps += [colord_dep]
endif
if cups_error != ''
if print_strict_deps
error(cups_error)
else
message(cups_error)
endif
else
print_backends += ['cups']
else
message('\'cups\' backend disabled: missing dependencies')
endif
endif
......@@ -168,7 +151,7 @@ if print_backends.contains('cups')
'cups/gtkcupsutils.c',
'cups/gtkcupssecretsutils.c',
c_args: printbackends_args,
dependencies: [libgtk_dep, libcups] + cups_extra_deps,
dependencies: [libgtk_dep, cups_dep] + cups_extra_deps,
install_dir: printbackends_install_dir,
install : true)
endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment