diff --git a/config.h.meson b/config.h.meson index 73836bb9ee..54dec7fa82 100644 --- a/config.h.meson +++ b/config.h.meson @@ -293,3 +293,5 @@ #mesondefine HAVE_HARFBUZZ #mesondefine HAVE_PANGOFT + +#mesondefine ISO_CODES_PREFIX diff --git a/demos/gtk-demo/language-names.c b/demos/gtk-demo/language-names.c index 2d433cff06..0c0076bbd8 100644 --- a/demos/gtk-demo/language-names.c +++ b/demos/gtk-demo/language-names.c @@ -17,7 +17,6 @@ #include "language-names.h" -#define ISO_CODES_PREFIX "/usr" #define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes" #define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale" diff --git a/gtk/language-names.c b/gtk/language-names.c index 2d433cff06..0c0076bbd8 100644 --- a/gtk/language-names.c +++ b/gtk/language-names.c @@ -17,7 +17,6 @@ #include "language-names.h" -#define ISO_CODES_PREFIX "/usr" #define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes" #define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale" diff --git a/meson.build b/meson.build index 64c73e4a01..2b189db816 100644 --- a/meson.build +++ b/meson.build @@ -336,6 +336,7 @@ harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false) xkbdep = dependency('xkbcommon', version: xkbcommon_req, required: wayland_enabled) graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req, fallback: ['graphene', 'graphene_dep']) +iso_codes_dep = dependency('iso-codes', required: false) fontconfig_dep = [] # only used in x11 backend atkbridge_dep = [] # only used in x11 backend @@ -349,6 +350,12 @@ endif cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found()) cdata.set('HAVE_PANGOFT', pangoft_dep.found()) +if iso_codes_dep.found() + cdata.set_quoted('ISO_CODES_PREFIX', iso_codes_dep.get_pkgconfig_variable('prefix')) +else + cdata.set_quoted('ISO_CODES_PREFIX', '/usr') +endif + backend_immodules = [] pc_gdk_extra_libs = []