Fix 'mono' package typo
[mono.git] / bockbuild / mac-sdk / gtk+.py
1 class GtkPackage (GnomeGitPackage):
2
3     def __init__(self):
4         GnomeGitPackage.__init__(self, 'gtk+', '2.24', '280fc402be5fb46b66bcd32056963bb1afb8b54b',
5                                  configure_flags=[
6                                      '--with-gdktarget=%{gdk_target}',
7                                      #                          '--disable-cups',
8                                  ]
9                                  )
10         self.gdk_target = 'x11'
11
12         if Package.profile.name == 'darwin':
13             self.gdk_target = 'quartz'
14             self.sources.extend([
15                 # Custom gtkrc
16                 'patches/gtkrc',
17
18                 # smooth scrolling, scrollbars, overscroll, retina,
19                 # gtknsview
20                 'patches/gtk/0001-Add-invariant-that-a-child-is-unmapped-if-parent-is-.patch',
21                 'patches/gtk/0002-Maintain-map-unmap-invariants-in-GtkRecentChooserDia.patch',
22                 'patches/gtk/0003-GtkPlug-preserve-map-unmap-invariants.patch',
23                 'patches/gtk/0004-Add-gdk_screen_get_monitor_workarea-and-use-it-all-o.patch',
24                 'patches/gtk/0005-gtk-don-t-scroll-combo-box-menus-if-less-than-3-item.patch',
25                 'patches/gtk/0006-gtk-paint-only-the-exposed-region-in-gdk_window_expo.patch',
26                 'patches/gtk/0007-Implement-gtk-enable-overlay-scrollbars-GtkSetting.patch',
27                 'patches/gtk/0008-Smooth-scrolling.patch',
28                 'patches/gtk/0009-gtk-Add-a-way-to-do-event-capture.patch',
29                 'patches/gtk/0010-gtk-don-t-let-insensitive-children-eat-scroll-events.patch',
30                 'patches/gtk/0011-scrolledwindow-Kinetic-scrolling-support.patch',
31                 'patches/gtk/0012-gtk-paint-to-the-right-windows-in-gtk_scrolled_windo.patch',
32                 'patches/gtk/0013-GtkScrolledWindow-add-overlay-scrollbars.patch',
33                 'patches/gtk/0014-gtk-add-event-handling-to-GtkScrolledWindow-s-overla.patch',
34                 'patches/gtk/0015-Use-gtk-enable-overlay-scrollbars-in-GtkScrolledWind.patch',
35                 'patches/gtk/0016-gtk-correctly-handle-toggling-of-the-scrollbar-visib.patch',
36                 'patches/gtk/0017-gtk-handle-gtk-primary-button-warps-slider-for-the-o.patch',
37                 'patches/gtk/0018-Introduce-phase-field-in-GdkEventScroll.patch',
38                 'patches/gtk/0019-Add-hack-to-lock-flow-of-scroll-events-to-window-whe.patch',
39                 'patches/gtk/0020-Introduce-a-background-window.patch',
40                 'patches/gtk/0021-Make-scrolled-window-work-well-with-Mac-touchpad.patch',
41                 'patches/gtk/0022-Use-start-end-phase-in-event-handling.patch',
42                 'patches/gtk/0023-Improve-overshooting-behavior.patch',
43                 'patches/gtk/0024-Cancel-out-smaller-delta-component.patch',
44                 'patches/gtk/0025-quartz-Add-a-dummy-NSView-serving-as-layer-view.patch',
45                 'patches/gtk/0026-gtk-port-overlay-scrollbars-to-native-CALayers.patch',
46                 'patches/gtk/0027-Refrain-from-starting-fading-out-while-a-gesture-is-.patch',
47                 'patches/gtk/0028-gtk-don-t-show-the-olverlay-scrollbars-if-only-the-s.patch',
48                 'patches/gtk/0029-Reclamp-unclamped-adjustments-after-resize.patch',
49                 'patches/gtk/0030-gtk-fix-size_request-of-scrolled-window.patch',
50                 'patches/gtk/0031-Hackish-fix-for-bug-8493-Min-size-of-GtkScrolledWind.patch',
51                 'patches/gtk/0032-Add-momentum_phase-to-GdkEventScroll.patch',
52                 'patches/gtk/0033-Never-intervene-in-the-event-stream-for-legacy-mice.patch',
53                 'patches/gtk/0034-Do-not-start-overshooting-for-legacy-mouse-scroll-ev.patch',
54                 'patches/gtk/0035-gtk-remove-the-overlay-scrollbar-grab-on-unrealize.patch',
55                 'patches/gtk/0036-gtk-add-GtkScrolledWindow-API-to-disable-overshoot-p.patch',
56                 'patches/gtk/0037-quartz-return-events-on-embedded-foreign-NSViews-bac.patch',
57                 'patches/gtk/0038-quartz-don-t-forward-events-to-the-toplevel-nswindow.patch',
58                 'patches/gtk/0039-gdk-add-a-move-native-children-signal-to-GdkWindow.patch',
59                 'patches/gtk/0040-gtk-add-new-widget-GtkNSView-which-alows-to-embed-an.patch',
60                 'patches/gtk/0041-tests-add-a-notebook-to-testnsview.c.patch',
61                 'patches/gtk/0042-gtk-connect-GtkNSView-to-move-native-children-and-re.patch',
62                 'patches/gtk/0043-tests-add-a-scrolled-window-test-widget-to-testnsvie.patch',
63                 'patches/gtk/0044-gtknsview-clip-drawRect-to-a-parent-GtkViewport-s-wi.patch',
64                 'patches/gtk/0045-gtk-clip-NSViews-to-the-scrolled-window-s-overshoot_.patch',
65                 'patches/gtk/0046-gtk-implement-clipping-to-multiple-parent-viewports-.patch',
66                 'patches/gtk/0047-gtk-first-attempt-to-also-clip-NSWindow-s-field-edit.patch',
67                 'patches/gtk/0048-gtk-also-clip-the-NSView-s-subviews.patch',
68                 'patches/gtk/0049-nsview-also-swizzle-DidAddSubview-and-clip-all-subvi.patch',
69                 'patches/gtk/0050-nsview-clip-text-field-cursor-drawing.patch',
70                 'patches/gtk/0051-nsview-factor-out-almost-all-code-from-the-overridde.patch',
71                 'patches/gtk/0052-nsview-also-focus-the-GtkNSView-if-a-focussable-subv.patch',
72                 'patches/gtk/0053-gtk-add-an-overlay-policy-API-to-GtkScrolledWindow.patch',
73                 'patches/gtk/0054-quartz-add-gdk_screen_-and-gdk_window_get_scale_fact.patch',
74                 'patches/gtk/0055-gtk-add-gtk_widget_get_scale_factor.patch',
75                 'patches/gtk/0056-iconfactory-Add-_scaled-variants.patch',
76                 'patches/gtk/0057-widget-Add-_scaled-variants-for-icon-rendering.patch',
77                 'patches/gtk/0058-icontheme-Add-support-for-high-resolution-icons.patch',
78                 'patches/gtk/0059-iconfactory-Add-scale-info-to-GtkIconSource.patch',
79                 'patches/gtk/0060-iconfactory-Add-gtk_cairo_set_source_icon_set.patch',
80                 'patches/gtk/0061-image-Use-scaled-icons-on-windows-with-a-scaling-fac.patch',
81                 'patches/gtk/0062-cellrendererpixbuf-Use-scaled-icons-on-windows-with-.patch',
82                 'patches/gtk/0063-entry-Use-scaled-icons-on-windows-with-a-scale-facto.patch',
83                 'patches/gtk/0064-gdk-Lookup-double-scaled-variants-on-pixbufs.patch',
84                 'patches/gtk/0065-Make-usual-calls-to-get-a-GdkPixbuf-attach-a-2x-vari.patch',
85                 'patches/gtk/0066-cellrendererpixbuf-let-2x-variants-go-through-pixel-.patch',
86                 'patches/gtk/0067-quartz-Make-event-loop-deal-with-recursive-poll-invo.patch',
87                 'patches/gtk/0068-nsview-implement-a-few-text-view-command-accelerator.patch',
88                 'patches/gtk/0069-menu-scrolling.patch',
89                 'patches/gtk/0070-tooltips-focus.patch',
90                 'patches/gtk/0071-light-and-dark-overlay-scrollbars.patch',
91                 'patches/gtk/0072-let-global-keyboard-shortcuts-pass-through.patch',
92                 'patches/gtk/0073-disable-combobox-scrolling.patch',
93                 'patches/gtk/0074-fix-NULL-pointer-in-clipboard.patch',
94                 'patches/gtk/0075-filechooserwidget-location-entry-activation.patch',
95                 'patches/gtk/0076-iconfactory-treat-gt-1-0-icons-as-2-0.patch',
96
97                 # Bug 702841 - GdkQuartz does not distinguish Eisu, Kana and Space keys on Japanese keyrboard
98                 # https://bugzilla.gnome.org/show_bug.cgi?id=702841
99                 'patches/gtk/bgo702841-fix-kana-eisu-keys.patch',
100
101                 # make new modifier behviour opt-in, so as not to break old
102                 # versions of MonoDevelop
103                 'patches/gdk-quartz-set-fix-modifiers-hack-v3.patch',
104
105                 # attempt to work around 2158 - [GTK] crash triggering context menu
106                 # also prints some warnings that may help to debug the real issue
107                 # https://bugzilla.xamarin.com/attachment.cgi?id=1644
108                 'patches/gtk/bxc2158_workaround_crash_triggering_context_menu.patch',
109
110                 # Zoom, rotate, swipe events
111                 'patches/gtk-gestures.patch',
112
113                 # Fix gtk_window_begin_move_drag on Quartz
114                 'patches/gtk-quartz-move-drag.patch',
115
116                 # Bug 3457 - [GTK] Support more standard keyboard shortcuts in dialogs
117                 # https://bugzilla.xamarin.com/attachment.cgi?id=2240
118                 'patches/gtk/bxc3457_more_standard_keyboard_shortcuts.patch',
119
120                 # Bug  10256 - Mac window manipulation tools get confused by Xamarin Studio
121                 # https://bugzilla.xamarin.com/attachment.cgi?id=3465
122                 'patches/gtk/bxc_10256_window_tools_get_confused.diff',
123
124                 #                                'patches/gtk/gdk-pixmap-get-cgimage-2.patch',
125
126                 # https://bugzilla.xamarin.com/show_bug.cgi?id=18157
127                 'patches/gtk/gtk-check-grab_toplevel-is-destroyed.patch',
128
129                 # https://bugzilla.xamarin.com/show_bug.cgi?id=18241
130                 # https://bugzilla.xamarin.com/show_bug.cgi?id=17631
131                 # https://bugzilla.xamarin.com/show_bug.cgi?id=17692
132                 'patches/gtk/gtk-imquartz-defer-signals-in-output_result.patch',
133
134                 # https://bugzilla.xamarin.com/show_bug.cgi?id=17401
135                 'patches/gtk/gtknsview-defer-map-and-lock-in-clipping.patch',
136                 'patches/gtk/gtknsview-timeout-fix.patch',
137
138                 'patches/gtk/nsview-embedding.patch',
139
140                 'patches/gtk/enable-swizzle-property.patch',
141
142                 # https://bugzilla.xamarin.com/show_bug.cgi?id=12618
143                 'patches/gtk/disable-eye-dropper.patch',
144
145                 # https://bugzilla.xamarin.com/show_bug.cgi?id=13100
146                 'patches/gtk/flip-command-mask-between-mod1-and-mod2.patch',
147                 'patches/gtk/nsview-embedding-fix-keyboard-routing.patch',
148                 'patches/gtk/nsview-check-for-superview.patch',
149
150                 'patches/gtk/gtknsview-forward-cmdz-to-textview-undo-manager.patch',
151
152                 # https://bugzilla.xamarin.com/show_bug.cgi?id=20732
153                 'patches/gtk/embedded-nstextview-has-focus.patch',
154                 'patches/gtk/remove-demos-from-build.patch',
155
156                 # This fixes an issue in where in some situations the user needed
157                 # to click a native text entry twice in order to be able to
158                 # focus it.
159                 'patches/gtk/gtknsview-only-unset-first-responder-if-it-is-our-view.patch',
160
161                 # For the test framework to be able to traverse down the
162                 # NSView hierarchy
163                 'patches/gtk/gtknsview-getter.patch',
164
165                 # https://bugzilla.xamarin.com/show_bug.cgi?id=29301#c3
166                 'patches/gtk/gtknsview-fix-invalid-casts.patch',
167
168                 # https://bugzilla.xamarin.com/show_bug.cgi?id=29001
169                 'patches/gtk/quartz-call-undo-redo-on-cmdz.patch',
170
171                 'patches/gtk/scrolled-window-draw-child-bg.patch',
172
173                 # https://bugzilla.xamarin.com/show_bug.cgi?id=37239
174                 'patches/gtk/fix-imquartz-crasher.patch',
175
176                 # https://bugzilla.gnome.org/show_bug.cgi?id=630226
177                 # https://bugzilla.xamarin.com/show_bug.cgi?id=34973
178                 'patches/gtk/remove-mouse-scrolling-from-GtkNotebook-tabs.patch',
179
180                 # https://bugzilla.xamarin.com/show_bug.cgi?id=37951
181                 'patches/gtk/dont-call-CopySymbolicHotKeys-so-much.patch',
182
183                 # https://bugzilla.xamarin.com/show_bug.cgi?id=38664
184                 'patches/gtk/combobox-crossing-events.patch',
185
186                 # https://bugzilla.xamarin.com/show_bug.cgi?id=41657
187                 'patches/gtk/bxc-41657.patch',
188
189                 'patches/gtk/emit-container-add.patch',
190                 'patches/gtk/create-accessibility-object.patch',
191                 'patches/gtk/make-gtkpaned-emit-signals.patch'
192             ])
193
194     def prep(self):
195         Package.prep(self)
196         if Package.profile.name == 'darwin':
197             for p in range(2, len(self.local_sources)):
198                 self.sh(
199                     'patch -p1 --ignore-whitespace < "%{local_sources[' + str(p) + ']}"')
200
201     def install(self):
202         Package.install(self)
203         if Package.profile.name == 'darwin':
204             self.install_gtkrc()
205
206     def install_gtkrc(self):
207         gtkrc = self.local_sources[1]
208         destdir = os.path.join(self.staged_prefix, "etc", "gtk-2.0")
209         if not os.path.exists(destdir):
210             os.makedirs(destdir)
211         self.sh('cp %s %s' % (gtkrc, destdir))
212
213 GtkPackage()