Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.3KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_girs_gjs.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_GIRS_GJS(MODULE, API_VERSION [, MODULE, API_VERSION...])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check that the GObject Introspection module $MODULE is importable in GJS
  12. # (GNOME's JavaScript engine, https://wiki.gnome.org/Projects/Gjs). The
  13. # API version must be $API_VERSION.
  14. #
  15. # GObject Introspection
  16. # (https://wiki.gnome.org/Projects/GObjectIntrospection) is a tool for
  17. # generating bindings from C libraries to higher-level languages. The
  18. # bindings live in a GObject Introspection repository (GIR) file, which is
  19. # what this macro checks.
  20. #
  21. # Note that for the purposes of GObject Introspection, the API version is
  22. # different from the release version. For example, GTK currently has API
  23. # version 3.0, but that could mean any release from the 3.0, 3.2, 3.4,...
  24. # series. To check for specific API that was added in a later version, use
  25. # AX_CHECK_GIR_SYMBOLS_GJS.
  26. #
  27. # Example:
  28. #
  29. # AX_CHECK_GIRS_GJS([Gdk], [3.0],
  30. # [Gtk], [3.0])
  31. #
  32. # NOTE: This macro depends on AX_PROG_GJS.
  33. #
  34. # LICENSE
  35. #
  36. # Copyright (c) 2013, 2016 Endless Mobile, Inc.; contributed by Philip Chimento <philip@endlessm.com>
  37. #
  38. # Copying and distribution of this file, with or without modification, are
  39. # permitted in any medium without royalty provided the copyright notice
  40. # and this notice are preserved. This file is offered as-is, without any
  41. # warranty.
  42. #serial 3
  43. AC_DEFUN([_AX_CHECK_GIR_GJS], [
  44. AC_MSG_CHECKING([for version $2 of $1])
  45. _AX_GJS_IFELSE([
  46. imports.gi.versions@<:@\"$1\"@:>@ = \"$2\";
  47. const Library = imports.gi.$1;
  48. ],
  49. [AC_MSG_RESULT([yes])],
  50. [
  51. AC_MSG_RESULT([no])
  52. AC_MSG_ERROR([You do not have API version $2 of the GObject
  53. Introspection bindings for the $1 library.
  54. Build a version from source, or find out what package to
  55. install with one of these commands, depending on your system:
  56. apt-file search $1-$2.typelib
  57. dnf provides \*/$1-$2.typelib
  58. ])
  59. ]
  60. )
  61. ])
  62. AC_DEFUN([AX_CHECK_GIRS_GJS], [
  63. AC_REQUIRE([AX_PROG_GJS])
  64. m4_map_args_pair([_AX_CHECK_GIR_GJS], [AC_MSG_ERROR], $@)
  65. ])