0001-Revert-Meson-Simplify-pkgconfig-file-generator.patch 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. From 5f5fd77f096174c45f8335afe6efd6745796d9a5 Mon Sep 17 00:00:00 2001
  2. From: Kalev Lember <klember@redhat.com>
  3. Date: Mon, 25 Jul 2022 16:21:50 +0200
  4. Subject: [PATCH] Revert "Meson: Simplify pkgconfig file generator"
  5. Temporarily revert this until we figure out how to best restore
  6. private requires that are needed for rpm automatic dep extraction.
  7. https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4756
  8. This reverts commit 802bf4199911c811938b0454a876089bafa97dba.
  9. ---
  10. meson.build | 47 +++++++++++++++++++++++++++++++++--------------
  11. 1 file changed, 33 insertions(+), 14 deletions(-)
  12. diff --git a/meson.build b/meson.build
  13. index 1b8f2d0248..4fc808dbd4 100644
  14. --- a/meson.build
  15. +++ b/meson.build
  16. @@ -471,6 +471,9 @@ if not os_win32
  17. endif
  18. endif
  19. +
  20. +pc_gdk_extra_libs = []
  21. +
  22. cairo_backends = []
  23. foreach backend: [ ['cairo-xlib', cairo_req, x11_enabled],
  24. ['cairo-win32', cairo_req, win32_enabled],
  25. @@ -601,14 +604,26 @@ if x11_enabled
  26. cdata.set('HAVE_RANDR15', xrandr15_dep.found())
  27. endif
  28. +if broadway_enabled
  29. + pc_gdk_extra_libs += ['-lz']
  30. +endif
  31. +
  32. +if macos_enabled
  33. + pc_gdk_extra_libs += ['-framework Cocoa', '-framework Carbon']
  34. +endif
  35. +
  36. extra_demo_ldflags = []
  37. if win32_enabled
  38. + pc_gdk_extra_libs += ['-lgdi32', '-limm32', '-lshell32', '-lole32']
  39. if cc.get_id() == 'msvc'
  40. # Since the demo programs are now built as pure GUI programs, we
  41. # need to pass in /entry:mainCRTStartup so that they will properly
  42. # link on Visual Studio builds
  43. extra_demo_ldflags = ['/entry:mainCRTStartup']
  44. + else
  45. + pc_gdk_extra_libs += ['-Wl,-luuid']
  46. endif
  47. + pc_gdk_extra_libs += ['-lwinmm', '-ldwmapi', '-lsetupapi', '-lcfgmgr32', '-lhid']
  48. # Check whether libepoxy is built with EGL support on Windows
  49. endif
  50. @@ -826,7 +841,16 @@ gsk_private_packages = [] # all already in gdk_private_packages
  51. pangoft2_pkgs = (wayland_enabled or x11_enabled) ? ['pangoft2'] : []
  52. gtk_private_packages = pangoft2_pkgs
  53. -pkgs = []
  54. +gdk_extra_libs = pc_gdk_extra_libs
  55. +gsk_extra_libs = []
  56. +gtk_extra_libs = []
  57. +
  58. +gdk_extra_cflags = []
  59. +gsk_extra_cflags = []
  60. +gtk_extra_cflags = []
  61. +
  62. +pkgs = [ 'gtk4' ]
  63. +
  64. pkg_targets = []
  65. display_backends = []
  66. foreach backend: [ 'broadway', 'macos', 'wayland', 'win32', 'x11', ]
  67. @@ -843,23 +867,18 @@ common_pc_variables = [
  68. 'gtk_host=@0@-@1@'.format(host_machine.cpu_family(), host_machine.system()), # FIXME
  69. ]
  70. -pkg_config.generate(libgtk,
  71. - filebase: 'gtk4',
  72. - unescaped_variables: common_pc_variables,
  73. - name: 'GTK',
  74. - description: 'GTK Graphical UI Library',
  75. - requires: gdk_packages + gsk_packages + gtk_packages,
  76. - subdirs: ['gtk-@0@'.format(gtk_api_version)],
  77. -)
  78. -meson.override_dependency('gtk4', libgtk_dep)
  79. -
  80. foreach pkg: pkgs
  81. pkg_config.generate(
  82. filebase: pkg,
  83. unescaped_variables: common_pc_variables,
  84. name: 'GTK',
  85. description: 'GTK Graphical UI Library',
  86. - requires: 'gtk4',
  87. + requires: gdk_packages + gsk_packages + gtk_packages,
  88. + requires_private: gdk_private_packages + gsk_private_packages + gtk_private_packages,
  89. + libraries: ['-L${libdir}', '-lgtk-4'],
  90. + libraries_private: gdk_extra_libs + gsk_extra_libs + gtk_extra_libs,
  91. + subdirs: ['gtk-@0@'.format(gtk_api_version)],
  92. + extra_cflags: gdk_extra_cflags + gsk_extra_cflags + gtk_extra_cflags,
  93. )
  94. meson.override_dependency(pkg, libgtk_dep)
  95. endforeach
  96. @@ -870,10 +889,10 @@ if os_unix
  97. unescaped_variables: common_pc_variables,
  98. name: 'GTK',
  99. description: 'GTK Unix print support',
  100. - requires: 'gtk4',
  101. + requires: ['gtk4'] + gtk_packages,
  102. + libraries: [],
  103. subdirs: ['gtk-@0@/unix-print'.format(gtk_api_version)],
  104. )
  105. - meson.override_dependency('gtk4-unix-print', libgtk_dep)
  106. endif
  107. subdir('po')
  108. --
  109. 2.37.1