Advertisement
Guest User

mutter 3.24.2 with fglrx/catalyst patches

a guest
May 29th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.28 KB | None | 0 0
  1. # $Id: PKGBUILD 289103 2017-02-17 19:00:25Z heftig $
  2. # Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
  3. # Maintainer: Ionut Biru <ibiru@archlinux.org>
  4. # Contributor: Michael Kanis <mkanis_at_gmx_dot_de>
  5.  
  6. pkgname=mutter
  7. pkgver=3.24.2
  8. pkgrel=1.1
  9. pkgdesc="A window manager for GNOME"
  10. url="https://git.gnome.org/browse/mutter"
  11. arch=(i686 x86_64)
  12. license=(GPL)
  13. depends=(dconf gobject-introspection-runtime gsettings-desktop-schemas
  14.          libcanberra startup-notification zenity libsm gnome-desktop upower
  15.          libxkbcommon-x11 gnome-settings-daemon libgudev libinput)
  16. makedepends=(intltool gobject-introspection git gnome-common)
  17. groups=(gnome)
  18. options=(!emptydirs)
  19. _commit=01b6e32e8796a96298ea388a557ab0c1df329d37  # tags/3.24.2^0
  20. source=("git+https://git.gnome.org/browse/mutter#commit=$_commit"
  21.         startup-notification.patch
  22.         cogl-driver-glsl150_mutter_v2.patch
  23.         catalyst-workaround.patch)
  24. sha256sums=('SKIP'
  25.             '5a35ca4794fc361219658d9fae24a3ca21a365f2cb1901702961ac869c759366'
  26.             '62cfe7086090b99cfcc38c73b9d3e826e03caa93f047cff02f7b2416bf8d28c4'
  27.             'ad1165dab73d97428a8ff60a9d76b98fd7f0c9f396452b87f18b2123917428c4')
  28.  
  29. pkgver() {
  30.   cd $pkgname
  31.   git describe --tags | sed 's/-/+/g'
  32. }
  33.  
  34. prepare() {
  35.   cd $pkgname
  36.  
  37.   # https://bugs.archlinux.org/task/51940
  38.   patch -Np1 -i ../startup-notification.patch
  39.  
  40.     patch -Np1 -i ../cogl-driver-glsl150_mutter_v2.patch
  41.     #https://bugzilla.gnome.org/show_bug.cgi?id=741581
  42.     patch -Np1 < ../catalyst-workaround.patch
  43.  
  44.   NOCONFIGURE=1 ./autogen.sh
  45. }
  46.  
  47. build() {
  48.   cd $pkgname
  49.  
  50.   ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
  51.       --libexecdir=/usr/lib/$pkgname --disable-static \
  52.       --disable-schemas-compile --enable-compile-warnings=minimum \
  53.       --enable-gtk-doc
  54.  
  55.   #https://bugzilla.gnome.org/show_bug.cgi?id=655517
  56.   sed -e 's/ -shared / -Wl,-O1,--as-needed\0/g' \
  57.       -i {.,cogl,clutter}/libtool
  58.  
  59.   make
  60. }
  61.  
  62. package() {
  63.   cd $pkgname
  64.   make DESTDIR="$pkgdir" install
  65. }
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. startup-notification.patch
  75. ---------------------------------------
  76. From 4ed430b4ef3013c96fa56cdc57b925b42d20ead9 Mon Sep 17 00:00:00 2001
  77. From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
  78. Date: Thu, 20 Oct 2016 18:00:04 +0200
  79. Subject: [PATCH] gtk-shell: Work around non-working startup notifications
  80.  
  81. GNOME Shell relies on the MetaScreen::startup-sequence-changed signal,
  82. which is tied to (lib)startup-notification and therefore X11. As a result,
  83. when we remove the startup sequence of a wayland client, GNOME Shell will
  84. not be notified about this until startup-notification's timeout is hit.
  85. As a temporary stop-gap, go through XWayland even for wayland clients,
  86. so that the signal is emitted when expected.
  87.  
  88. https://bugzilla.gnome.org/show_bug.cgi?id=768531
  89. ---
  90. src/wayland/meta-wayland-gtk-shell.c | 10 ++++++++++
  91. 1 file changed, 10 insertions(+)
  92.  
  93. diff --git a/src/wayland/meta-wayland-gtk-shell.c b/src/wayland/meta-wayland-gtk-shell.c
  94. index d6e249f..9d1a19e 100644
  95. --- a/src/wayland/meta-wayland-gtk-shell.c
  96. +++ b/src/wayland/meta-wayland-gtk-shell.c
  97. @@ -219,11 +219,21 @@ gtk_shell_set_startup_id (struct wl_client   *client,
  98.                           struct wl_resource *resource,
  99.                           const char         *startup_id)
  100. {
  101. +#if 0
  102.   MetaDisplay *display;
  103.  
  104.   display = meta_get_display ();
  105.   meta_startup_notification_remove_sequence (display->startup_notification,
  106.                                              startup_id);
  107. +#else
  108. +  /* HACK: MetaScreen::startup-sequence-changed is currently tied to
  109. +           (lib)startup-notification, which means it only works on X11;
  110. +           so for now, always go through XWayland, even for wayland clients */
  111. +  gdk_x11_display_broadcast_startup_message (gdk_display_get_default (),
  112. +                                             "remove",
  113. +                                             "ID", startup_id,
  114. +                                             NULL);
  115. +#endif
  116. }
  117.  
  118. static void
  119. --
  120. 2.9.3
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128. cogl-driver-glsl150_mutter_v2.patch
  129. ---------------------------------------
  130. --- mutter3221/cogl/cogl/driver/gl/gl/cogl-driver-gl.c  2016-10-17 20:43:31.283749432 +0200
  131. +++ mutter3221b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c 2016-10-17 20:47:44.000000000 +0200
  132. @@ -416,9 +416,13 @@
  133.                                       &ctx->glsl_minor);
  134.     }
  135.  
  136. -  if (COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 2))
  137. -    /* We want to use version 120 if it is available so that the
  138. -     * gl_PointCoord can be used. */
  139. +  if (COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 5))
  140. +    ctx->glsl_version_to_use = 150;
  141. +  else if (COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 4))
  142. +    ctx->glsl_version_to_use = 140;
  143. +  else if (COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 3))
  144. +    ctx->glsl_version_to_use = 130;
  145. +  else if (COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 2))
  146.     ctx->glsl_version_to_use = 120;
  147.   else
  148.     ctx->glsl_version_to_use = 110;
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159. catalyst-workaround.patch
  160. ---------------------------------------
  161. --- a/src/backends/x11/meta-monitor-manager-xrandr.c    2017-05-29 22:05:54.341322317 +0200
  162. +++ b/src/backends/x11/meta-monitor-manager-xrandr.c    2017-05-29 22:09:00.614901230 +0200
  163. @@ -1060,6 +1060,41 @@
  164.     }
  165. }
  166.  
  167. +static int
  168. +output_get_fglrx_kernel_module_loaded()
  169. +{
  170. +  /* Checks if fglrx module has been loaded by parsing /proc/modules.
  171. +   * Returns 1 if the module was found (and thus has been loaded), 0 if the
  172. +   * module was not found and -1 if /proc/modules couldn't be opened.
  173. +   */
  174. +
  175. +  int retval = 0; // defaults to not found
  176. +
  177. +  FILE* fp;
  178. +  char line[256];
  179. +
  180. +  fp = fopen("/proc/modules", "r");
  181. +  if (!fp)
  182. +    {
  183. +      retval = -1;
  184. +    }
  185. +  else
  186. +    {
  187. +      while (fgets(line, sizeof(line), fp) != NULL)
  188. +        {
  189. +          char *entry = strtok(line, " \n");
  190. +
  191. +          if (strcmp(entry, "fglrx") == 0)
  192. +            {
  193. +              retval = 1;
  194. +              break;
  195. +            }
  196. +        }
  197. +      fclose(fp);
  198. +    }
  199. +  return retval;
  200. +}
  201. +
  202.  static void
  203.  apply_crtc_assignments (MetaMonitorManager *manager,
  204.                          MetaCrtcInfo      **crtcs,
  205. @@ -1235,6 +1270,8 @@
  206.          }
  207.      }
  208.  
  209. +  int fglrx_kernel_module_loaded = output_get_fglrx_kernel_module_loaded();
  210. +
  211.    for (i = 0; i < n_outputs; i++)
  212.      {
  213.        MetaOutputInfo *output_info = outputs[i];
  214. @@ -1247,9 +1284,13 @@
  215.                                 (XID)output_info->output->winsys_id);
  216.          }
  217.  
  218. -      output_set_presentation_xrandr (manager_xrandr,
  219. -                                      output_info->output,
  220. -                                      output_info->is_presentation);
  221. +      /* Don't call output_set_presentation_xrandr if fglrx/catalyst is used, because that causes a crash. */
  222. +      if (fglrx_kernel_module_loaded != 1)
  223. +        {
  224. +          output_set_presentation_xrandr (manager_xrandr,
  225. +                                          output_info->output,
  226. +                                          output_info->is_presentation);
  227. +        }
  228.  
  229.       if (output_get_supports_underscanning_xrandr (manager_xrandr, output_info->output))
  230.         output_set_underscanning_xrandr (manager_xrandr,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement