1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id: Portfile 90940 2012-03-19 01:00:08Z singingwolfboy@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup archcheck 1.0 |
---|
6 | PortGroup muniversal 1.0 |
---|
7 | PortGroup xcodeversion 1.0 |
---|
8 | |
---|
9 | name gtk3-test |
---|
10 | set my_name gtk3 |
---|
11 | set real_name gtk+ |
---|
12 | version 3.4.1 |
---|
13 | set branch [join [lrange [split ${version} .] 0 1] .] |
---|
14 | categories gnome x11 |
---|
15 | license LGPL-2.1+ |
---|
16 | maintainers nomaintainer |
---|
17 | platforms darwin |
---|
18 | description GTK+ widget toolkit |
---|
19 | |
---|
20 | long_description \ |
---|
21 | GTK+ is a highly usable, feature rich toolkit for creating graphical \ |
---|
22 | user interfaces which boasts cross platform compatibility and an easy \ |
---|
23 | to use API. GTK+ it is written in C, but has bindings to many other \ |
---|
24 | popular programming languages such as C++, Python and C# among others. |
---|
25 | |
---|
26 | homepage http://www.gtk.org/ |
---|
27 | distname ${real_name}-${version} |
---|
28 | use_xz yes |
---|
29 | |
---|
30 | master_sites gnome:sources/gtk+/${branch}/ \ |
---|
31 | ftp://ftp.gtk.org/pub/gtk/${branch}/ \ |
---|
32 | http://ftp.gtk.org/pub/gtk/${branch}/ |
---|
33 | |
---|
34 | minimum_xcodeversions {9 3.1} |
---|
35 | checksums sha1 91b68f0dd5f6558eae98811f4031f32ff46ad172 \ |
---|
36 | rmd160 e8c0c8c71167e037eb88689713b8ae05aed29b03 \ |
---|
37 | sha256 0716b533de0ff2ffdec1076bb85c7a95e2b7b6ac9ece71e84625043ae3eb25f7 |
---|
38 | |
---|
39 | depends_build port:pkgconfig |
---|
40 | |
---|
41 | depends_lib port:atk \ |
---|
42 | path:lib/pkgconfig/pango.pc:pango \ |
---|
43 | port:gdk-pixbuf2 \ |
---|
44 | path:lib/pkgconfig/glib-2.0.pc:glib2 |
---|
45 | |
---|
46 | depends_run port:shared-mime-info |
---|
47 | |
---|
48 | archcheck.files \ |
---|
49 | lib/libatk-1.0.dylib \ |
---|
50 | lib/libintl.dylib \ |
---|
51 | lib/libjasper.dylib \ |
---|
52 | lib/libpango-1.0.dylib \ |
---|
53 | lib/libtiff.dylib |
---|
54 | |
---|
55 | configure.args --enable-static \ |
---|
56 | --disable-glibtest \ |
---|
57 | --disable-schemas-compile \ |
---|
58 | --disable-introspection \ |
---|
59 | --enable-colord=no \ |
---|
60 | gio_can_sniff=yes |
---|
61 | |
---|
62 | configure.ccache no |
---|
63 | configure.cppflags-append -DX_LOCALE |
---|
64 | configure.cflags-append -fstrict-aliasing |
---|
65 | |
---|
66 | pre-configure { |
---|
67 | if {![variant_isset quartz] && ![variant_isset x11]} { |
---|
68 | error "Either +x11 or +quartz is required" |
---|
69 | } |
---|
70 | |
---|
71 | if {[variant_isset quartz]} { |
---|
72 | if {![file exists ${prefix}/include/cairo/cairo-quartz.h]} { |
---|
73 | error "cairo must be built with the +quartz variant enabled." |
---|
74 | } |
---|
75 | } elseif {![file exists ${prefix}/include/cairo/cairo-xlib.h]} { |
---|
76 | error "cairo must be built without the +no_x11 variant." |
---|
77 | } |
---|
78 | } |
---|
79 | |
---|
80 | use_parallel_build yes |
---|
81 | |
---|
82 | test.run yes |
---|
83 | test.target check |
---|
84 | |
---|
85 | post-destroot { |
---|
86 | set docdir ${prefix}/share/doc/${my_name} |
---|
87 | xinstall -d ${destroot}${docdir} |
---|
88 | xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING HACKING NEWS README \ |
---|
89 | ${destroot}${docdir} |
---|
90 | |
---|
91 | # avoid conflict with the gtk-update-icon-cache installed by gtk2 |
---|
92 | move ${destroot}${prefix}/bin/gtk-update-icon-cache \ |
---|
93 | ${destroot}${prefix}/bin/gtk-update-icon-cache-3.0 |
---|
94 | |
---|
95 | ui_debug "Creating gtk.immodules..." |
---|
96 | system "DYLD_LIBRARY_PATH=${destroot}${prefix}/lib \ |
---|
97 | ${destroot}${prefix}/bin/gtk-query-immodules-3.0 \ |
---|
98 | ${destroot}${prefix}/lib/gtk-3.0/3.0.0/immodules/*.so \ |
---|
99 | >${destroot}${prefix}/etc/gtk-3.0/gtk.immodules" |
---|
100 | reinplace "s|${destroot}||" ${destroot}${prefix}/etc/gtk-3.0/gtk.immodules |
---|
101 | } |
---|
102 | |
---|
103 | |
---|
104 | post-activate { |
---|
105 | ui_debug "Updating gdk-pixbuf.loaders..." |
---|
106 | system "${prefix}/bin/gdk-pixbuf-query-loaders \ |
---|
107 | >${prefix}/etc/gtk-3.0/gdk-pixbuf.loaders" |
---|
108 | |
---|
109 | # GConf (needs investigation) |
---|
110 | # -- copied from gedit 2.30.4 / gtk2 |
---|
111 | #system "export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` && \ |
---|
112 | # gconftool-2 --makefile-install-rule ${prefix}/etc/gconf/schemas/*.schemas" |
---|
113 | |
---|
114 | # GSettings |
---|
115 | # -- from <https://wiki.archlinux.org/index.php/Gnome_Package_Guidelines#GSettings_schemas> |
---|
116 | system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas" |
---|
117 | } |
---|
118 | |
---|
119 | platform darwin 8 { |
---|
120 | if {[variant_isset quartz] || [variant_isset no_x11]} { |
---|
121 | configure.ldflags-append -framework Cocoa -framework Carbon |
---|
122 | } |
---|
123 | } |
---|
124 | |
---|
125 | if {[variant_isset no_x11]} { |
---|
126 | default_variants +quartz |
---|
127 | } elseif {![variant_isset quartz]} { |
---|
128 | default_variants +x11 |
---|
129 | } |
---|
130 | |
---|
131 | if {[variant_isset universal]} { |
---|
132 | set cups /usr/bin/cups-config |
---|
133 | if {[info exists universal_sysroot]} { |
---|
134 | set cups ${universal_sysroot}${cups} |
---|
135 | } |
---|
136 | configure.env-append CUPS_CONFIG=${cups} |
---|
137 | |
---|
138 | # cups is not 32/64-bit universal on Tiger. |
---|
139 | if {${os.major} == "8"} { |
---|
140 | set merger_configure_args(ppc64) --disable-cups |
---|
141 | set merger_configure_args(x86_64) --disable-cups |
---|
142 | } |
---|
143 | |
---|
144 | # Find architectures which will not run on build platform. |
---|
145 | set cpu64bit_capable [sysctl hw.cpu64bit_capable] |
---|
146 | if {${os.arch} eq "i386"} { |
---|
147 | set cross_archs ppc64 |
---|
148 | if {${os.major} >= 10} { |
---|
149 | lappend cross_archs ppc |
---|
150 | } |
---|
151 | set host_archs "ppc ppc64" |
---|
152 | set run_archs i386 |
---|
153 | if {${cpu64bit_capable}} { |
---|
154 | set run_archs "x86_64 ${run_archs}" |
---|
155 | } |
---|
156 | } else { |
---|
157 | set cross_archs "i386 x86_64" |
---|
158 | set host_archs "i386 x86_64" |
---|
159 | set run_archs ppc |
---|
160 | if {${cpu64bit_capable}} { |
---|
161 | set run_archs "ppc64 ${run_archs}" |
---|
162 | } |
---|
163 | } |
---|
164 | |
---|
165 | pre-configure { |
---|
166 | set run_arch "" |
---|
167 | foreach arch ${run_archs} { |
---|
168 | if {[lsearch ${universal_archs_to_use} ${arch}] != -1} { |
---|
169 | set run_arch ${arch} |
---|
170 | break |
---|
171 | } |
---|
172 | } |
---|
173 | |
---|
174 | if {${run_arch} eq ""} { |
---|
175 | ui_error "" |
---|
176 | ui_error "${my_name} requires at least one architecture runnable on this" |
---|
177 | ui_error "machine to be able to build universally. Please add at least" |
---|
178 | ui_error "one of the following architectures to `universal_archs` in" |
---|
179 | ui_error "\"${prefix}/etc/macports/macports.conf\":" |
---|
180 | ui_error "" |
---|
181 | ui_error "\t${run_archs}" |
---|
182 | ui_error "" |
---|
183 | } |
---|
184 | |
---|
185 | foreach arch ${host_archs} { |
---|
186 | lappend merger_configure_env(${arch}) \ |
---|
187 | NM='/usr/bin/nm -p' |
---|
188 | } |
---|
189 | |
---|
190 | foreach arch ${cross_archs} { |
---|
191 | lappend merger_configure_env(${arch}) \ |
---|
192 | GTK_UPDATE_ICON_CACHE=${worksrcpath}-${run_arch}/gtk/gtk-update-icon-cache \ |
---|
193 | GDK_PIXBUF_CSOURCE=${worksrcpath}-${run_arch}/gdk-pixbuf/gdk-pixbuf-csource |
---|
194 | lappend merger_build_env(${arch}) \ |
---|
195 | GDK_PIXBUF_MODULE_FILE=${worksrcpath}-${run_arch}/gdk-pixbuf/gdk-pixbuf.loaders |
---|
196 | } |
---|
197 | |
---|
198 | # Let gtk_host in .pc files be the same on all architectures |
---|
199 | set host powerpc |
---|
200 | if {${os.arch} eq "i386"} { |
---|
201 | set host i686 |
---|
202 | } |
---|
203 | eval reinplace s/@host@/${host}-apple-darwin${os.version}/ \ |
---|
204 | [glob -directory ${worksrcpath} *.pc.in] |
---|
205 | } |
---|
206 | } |
---|
207 | |
---|
208 | variant no_x11 { |
---|
209 | pre-fetch { |
---|
210 | if {[file exists ${prefix}/lib/libpangox-1.0.dylib]} { |
---|
211 | ui_error "Please uninstall or deactivate the pango port and reinstall it by running `port install pango +no_x11`." |
---|
212 | error "pango must be installed with the no_x11 variant enabled." |
---|
213 | } |
---|
214 | } |
---|
215 | } |
---|
216 | |
---|
217 | variant quartz requires no_x11 conflicts x11 { |
---|
218 | configure.args-append --enable-quartz-backend |
---|
219 | } |
---|
220 | |
---|
221 | variant x11 conflicts quartz description {Enable rendering in X11} { |
---|
222 | depends_lib-append \ |
---|
223 | port:xorg-libXi \ |
---|
224 | port:xorg-libXrandr \ |
---|
225 | port:xorg-libXcursor \ |
---|
226 | port:xorg-libXinerama \ |
---|
227 | port:xorg-libXdamage \ |
---|
228 | port:xorg-libXcomposite \ |
---|
229 | port:xorg-libXfixes |
---|
230 | |
---|
231 | configure.args-append --enable-x11-backend \ |
---|
232 | --enable-xinerama \ |
---|
233 | --enable-xinput \ |
---|
234 | --enable-xrandr \ |
---|
235 | --enable-xfixes \ |
---|
236 | --enable-xcomposite \ |
---|
237 | --enable-xdamage \ |
---|
238 | --with-x \ |
---|
239 | --x-includes=${prefix}/include \ |
---|
240 | --x-libraries=${prefix}/lib |
---|
241 | } |
---|
242 | |
---|
243 | variant introspection description {Enable introspection} { |
---|
244 | depends_lib-append port:gobject-introspection |
---|
245 | configure.args-delete --disable-introspection |
---|
246 | configure.args-append --enable-introspection |
---|
247 | } |
---|
248 | |
---|
249 | variant debug description {turn on debugging} { |
---|
250 | configure.args-append --enable-debug=yes |
---|
251 | } |
---|
252 | |
---|
253 | livecheck.type regex |
---|
254 | livecheck.url ftp://ftp.gnome.org/pub/gnome/sources/${real_name}/${branch}/ |
---|
255 | livecheck.regex {LATEST-IS-(\d+(?:\.\d+)*)} |
---|