pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: gnome-desktop still not building on NetBSD 4.0



On Wed 27 May 2009 at 23:46:14 +0200, Rhialto wrote:
> I have been looking at it if I can just selectively disable some parts
> of gnome-rr.c, but didn't get very far, since the new types seem to be
> used rather a lot. Perhaps someone who can claim to know more about
> Xrandr can have a look at it.

Here are some crude patches to rip out everything that doesn't compile.
Basically it pretends the whole XRandR extension doesn't exist; I feel 
justified in doing that because of yje comment that says

/* Returns NULL if screen could not be created.  For instance, if
 * the driver does not support Xrandr 1.2.
 */

I could probably rip out more, on the assumptions that most non-static
functions won't be called anyway since initialisation always fails, but
I haven't tried that. I haven't even run it this way.

The patches are for the stable pkgsrc branch, i.e. gnome-desktop-2.26.0.
How they are to be applied only when needed, I leave as an exercise for
the experts.

--- libgnome-desktop/gnome-rr-private.h.dist    2009-03-16 23:37:06.000000000 
+0100
+++ libgnome-desktop/gnome-rr-private.h 2009-05-28 22:40:21.000000000 +0200
@@ -10,7 +10,9 @@
     int                        min_height;
     int                        max_height;
 
+#if 0
     XRRScreenResources *resources;
+#endif
     
     GnomeRROutput **   outputs;
     GnomeRRCrtc **     crtcs;

--- libgnome-desktop/gnome-rr.c.dist    2009-03-16 23:37:06.000000000 +0100
+++ libgnome-desktop/gnome-rr.c 2009-05-28 23:17:33.000000000 +0200
@@ -42,7 +42,9 @@
 struct GnomeRROutput
 {
     ScreenInfo *       info;
+#if 0
     RROutput           id;
+#endif
     
     char *             name;
     GnomeRRCrtc *      current_crtc;
@@ -58,13 +60,17 @@
 
 struct GnomeRROutputWrap
 {
+#if 0
     RROutput           id;
+#endif
 };
 
 struct GnomeRRCrtc
 {
     ScreenInfo *       info;
+#if 0
     RRCrtc             id;
+#endif
     
     GnomeRRMode *      current_mode;
     GnomeRROutput **   current_outputs;
@@ -79,7 +85,9 @@
 struct GnomeRRMode
 {
     ScreenInfo *       info;
+#if 0
     RRMode             id;
+#endif
     char *             name;
     int                        width;
     int                        height;
@@ -87,6 +95,7 @@
 };
 
 /* GnomeRRCrtc */
+#if 0
 static GnomeRRCrtc *  crtc_new          (ScreenInfo         *info,
                                         RRCrtc              id);
 static void           crtc_free         (GnomeRRCrtc        *crtc);
@@ -108,6 +117,7 @@
 static void           mode_initialize   (GnomeRRMode        *mode,
                                         XRRModeInfo        *info);
 static void           mode_free         (GnomeRRMode        *mode);
+#endif
 
 
 /* Errors */
@@ -127,6 +137,7 @@
 }
 
 /* Screen */
+#if 0
 static GnomeRROutput *
 gnome_rr_output_by_id (ScreenInfo *info, RROutput id)
 {
@@ -489,6 +500,7 @@
     /* Pass the event on to GTK+ */
     return GDK_FILTER_CONTINUE;
 }
+#endif
 
 /* Returns NULL if screen could not be created.  For instance, if
  * the driver does not support Xrandr 1.2.
@@ -507,6 +519,7 @@
     
     _gnome_desktop_init_i18n ();
 
+#if 0
     if (XRRQueryExtension (dpy, &event_base, &ignore))
     {
        GnomeRRScreen *screen = g_new0 (GnomeRRScreen, 1);
@@ -544,6 +557,7 @@
        return screen;
     }
     else
+#endif
     {
        g_set_error (error, GNOME_RR_ERROR, GNOME_RR_ERROR_NO_RANDR_EXTENSION,
                     _("RANDR extension is not present"));
@@ -556,12 +570,14 @@
 gnome_rr_screen_destroy (GnomeRRScreen *screen)
 {
        g_return_if_fail (screen != NULL);
+#if 0
 
        gdk_window_remove_filter (screen->gdk_root, screen_on_event, screen);
 
        screen_info_free (screen->info);
        screen->info = NULL;
 
+#endif
        g_free (screen);
 }
 
@@ -573,9 +589,11 @@
                          int       mm_height)
 {
     g_return_if_fail (screen != NULL);
+#if 0
     
     XRRSetScreenSize (screen->xdisplay, screen->xroot,
                      width, height, mm_width, mm_height);
+#endif
 }
 
 void
@@ -586,6 +604,7 @@
                            int           *max_height)
 {
     g_return_if_fail (screen != NULL);
+#if 0
     
     if (min_width)
        *min_width = screen->info->min_width;
@@ -598,6 +617,7 @@
     
     if (max_height)
        *max_height = screen->info->max_height;
+#endif
 }
 
 /**
@@ -618,7 +638,11 @@
                         GError       **error)
 {
     g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+#if 0
     return screen_update (screen, FALSE, error);
+#else
+    return FALSE;
+#endif
 }
 
 GnomeRRMode **
@@ -627,7 +651,11 @@
     g_return_val_if_fail (screen != NULL, NULL);
     g_return_val_if_fail (screen->info != NULL, NULL);
     
+#if 0
     return screen->info->modes;
+#else
+    return NULL;
+#endif
 }
 
 GnomeRRMode **
@@ -636,7 +664,11 @@
     g_return_val_if_fail (screen != NULL, NULL);
     g_return_val_if_fail (screen->info != NULL, NULL);
 
+#if 0
     return screen->info->clone_modes;
+#else
+    return NULL;
+#endif
 }
 
 GnomeRRCrtc **
@@ -645,7 +677,11 @@
     g_return_val_if_fail (screen != NULL, NULL);
     g_return_val_if_fail (screen->info != NULL, NULL);
     
+#if 0
     return screen->info->crtcs;
+#else
+    return NULL;
+#endif
 }
 
 GnomeRROutput **
@@ -654,7 +690,11 @@
     g_return_val_if_fail (screen != NULL, NULL);
     g_return_val_if_fail (screen->info != NULL, NULL);
     
+#if 0
     return screen->info->outputs;
+#else
+    return NULL;
+#endif
 }
 
 GnomeRRCrtc *
@@ -666,11 +706,13 @@
     g_return_val_if_fail (screen != NULL, NULL);
     g_return_val_if_fail (screen->info != NULL, NULL);
     
+#if 0
     for (i = 0; screen->info->crtcs[i] != NULL; ++i)
     {
        if (screen->info->crtcs[i]->id == id)
            return screen->info->crtcs[i];
     }
+#endif
     
     return NULL;
 }
@@ -684,15 +726,18 @@
     g_return_val_if_fail (screen != NULL, NULL);
     g_return_val_if_fail (screen->info != NULL, NULL);
     
+#if 0
     for (i = 0; screen->info->outputs[i] != NULL; ++i)
     {
        if (screen->info->outputs[i]->id == id)
            return screen->info->outputs[i];
     }
+#endif
     
     return NULL;
 }
 
+#if 0
 /* GnomeRROutput */
 static GnomeRROutput *
 output_new (ScreenInfo *info, RROutput id)
@@ -844,13 +889,18 @@
     g_free (output->name);
     g_free (output);
 }
+#endif
 
 guint32
 gnome_rr_output_get_id (GnomeRROutput *output)
 {
     g_assert(output != NULL);
     
+#if 0
     return output->id;
+#else
+    return 0;
+#endif
 }
 
 const guint8 *
@@ -1076,7 +1126,11 @@
                          * as usual.  */
                         _("requested position/size for CRTC %d is outside the 
allowed limit: "
                           "position=(%d, %d), size=(%d, %d), maximum=(%d, 
%d)"),
+#if 0
                         (int) crtc->id,
+#else
+                        0,
+#endif
                         x, y,
                         mode->width, mode->height,
                         info->max_width, info->max_height);
@@ -1084,6 +1138,7 @@
        }
     }
     
+#if 0
     output_ids = g_array_new (FALSE, FALSE, sizeof (RROutput));
     
     if (outputs)
@@ -1095,12 +1150,17 @@
     status = XRRSetCrtcConfig (DISPLAY (crtc), info->resources, crtc->id,
                               CurrentTime, 
                               x, y,
+#if 0
                               mode ? mode->id : None,
+#else
+                              None,
+#endif
                               xrotation_from_rotation (rotation),
                               (RROutput *)output_ids->data,
                               output_ids->len);
     
     g_array_free (output_ids, TRUE);
+#endif
 
     if (status == RRSetConfigSuccess)
        result = TRUE;
@@ -1108,7 +1168,11 @@
        result = FALSE;
        g_set_error (error, GNOME_RR_ERROR, GNOME_RR_ERROR_RANDR_ERROR,
                     _("could not set the configuration for CRTC %d"),
+#if 0
                     (int) crtc->id);
+#else
+                    0);
+#endif
     }
     
     return result;
@@ -1127,7 +1191,11 @@
 {
     g_return_val_if_fail (crtc != NULL, 0);
     
+#if 0
     return crtc->id;
+#else
+    return 0;
+#endif
 }
 
 gboolean
@@ -1186,6 +1254,7 @@
     return (crtc->rotations & rotation);
 }
 
+#if 0
 static GnomeRRCrtc *
 crtc_new (ScreenInfo *info, RROutput id)
 {
@@ -1267,8 +1336,10 @@
     g_free (crtc->possible_outputs);
     g_free (crtc);
 }
+#endif
 
 /* GnomeRRMode */
+#if 0
 static GnomeRRMode *
 mode_new (ScreenInfo *info, RRMode id)
 {
@@ -1279,12 +1350,17 @@
     
     return mode;
 }
+#endif
 
 guint32
 gnome_rr_mode_get_id (GnomeRRMode *mode)
 {
     g_return_val_if_fail (mode != NULL, 0);
+#if 0
     return mode->id;
+#else
+    return 0;
+#endif
 }
 
 guint
@@ -1308,6 +1384,7 @@
     return mode->height;
 }
 
+#if 0
 static void
 mode_initialize (GnomeRRMode *mode, XRRModeInfo *info)
 {
@@ -1326,3 +1403,4 @@
     g_free (mode->name);
     g_free (mode);
 }
+#endif


-Olaf.
-- 
___ Olaf 'Rhialto' Seibert    -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl      -- Cetero censeo "authored" delendum esse.


Home | Main Index | Thread Index | Old Index