source: trunk/dports/gnome/gtk2/Portfile

Last change on this file was 152460, checked in by devans@…, 15 months ago

gtk2: update to version 2.24.31, reformat long description.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.4 KB
Line 
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 152460 2016-09-10 07:08:00Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           active_variants 1.1
6PortGroup           muniversal 1.0
7PortGroup           xcodeversion 1.0
8
9name                gtk2
10version             2.24.31
11set branch          [join [lrange [split ${version} .] 0 1] .]
12categories          gnome x11
13license             LGPL-2+
14maintainers         nomaintainer
15platforms           darwin
16description         GTK+ widget toolkit
17                   
18long_description    GTK+ is a highly usable, feature rich toolkit for creating graphical \
19                    user interfaces which boasts cross platform compatibility and an easy \
20                    to use API. GTK+ it is written in C, but has bindings to many other \
21                    popular programming languages such as C++, Python and C# among others.
22
23homepage            http://www.gtk.org/
24distname            gtk+-${version}
25use_xz              yes
26
27master_sites        gnome:sources/gtk+/${branch}/
28
29minimum_xcodeversions {9 3.1}
30
31checksums           rmd160  71feedd14b1a52eaa070a6cbf26d00e64d41de42 \
32                    sha256  68c1922732c7efc08df4656a5366dcc3afdc8791513400dac276009b40954658
33
34depends_build       port:gtk-doc \
35                    port:pkgconfig \
36                    port:perl5
37
38depends_lib         port:atk \
39                    path:lib/pkgconfig/pango.pc:pango \
40                    port:gdk-pixbuf2 \
41                    port:gobject-introspection
42
43# gtk2 applications would need librsvg to display SVG icons, however librsvg
44# indirectly depends on gtk2, so we can not list it as a dependency here.
45#                    port:librsvg
46
47depends_run         port:shared-mime-info \
48                    port:hicolor-icon-theme
49
50patchfiles-append   patch-aliases.diff
51patchfiles-append   patch-gtk-builder-convert.diff
52
53# autoreconf to deal with stupid issues during install (install: .libs/libferret.lai: No such file or directory)
54use_autoreconf      yes
55autoreconf.args     -fvi
56
57configure.args      --enable-static \
58                    --disable-glibtest \
59                    --enable-introspection \
60                    gio_can_sniff=yes
61
62configure.ccache    no
63configure.cppflags-append   -DX_LOCALE -D_IPP_PRIVATE_STRUCTURES=1
64configure.cflags-append     -fstrict-aliasing
65
66# gobject-introspection uses g-ir-scanner, which uses $CC from env
67if {[variant_isset universal]} {
68    foreach arch ${configure.universal_archs} {
69        lappend merger_build_args(${arch})  CC='${configure.cc} -arch ${arch}'
70        lappend merger_destroot_args(${arch})  CC='${configure.cc} -arch ${arch}'
71    }
72} else {
73    build.args-append       CC="${configure.cc} ${configure.cc_archflags}"
74    destroot.args-append    CC="${configure.cc} ${configure.cc_archflags}"
75}
76
77post-extract {
78    # gtk2's Makefiles don't have proper dependencies,
79    # so we must delete these to get them remade
80    file delete ${worksrcpath}/gdk/gdkalias.h
81    file delete ${worksrcpath}/gdk/gdkaliasdef.c
82    file delete ${worksrcpath}/gtk/gtkalias.h
83    file delete ${worksrcpath}/gtk/gtkaliasdef.c
84}
85
86pre-configure {
87    if {![variant_isset quartz] && ![variant_isset x11]} {
88        error "Either +x11 or +quartz is required"
89    }
90}
91
92use_parallel_build  yes
93
94test.run            yes
95test.target         check
96
97post-destroot {
98    set docdir ${prefix}/share/doc/${name}
99    xinstall -d ${destroot}${docdir}
100    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING HACKING NEWS README \
101        ${destroot}${docdir}
102
103    ui_debug "Creating gtk.immodules..."
104    system "DYLD_LIBRARY_PATH=${destroot}${prefix}/lib \
105        ${destroot}${prefix}/bin/gtk-query-immodules-2.0 \
106        ${destroot}${prefix}/lib/gtk-2.0/2.10.0/immodules/*.so \
107        >${destroot}${prefix}/etc/gtk-2.0/gtk.immodules"
108    reinplace "s|${destroot}||" ${destroot}${prefix}/etc/gtk-2.0/gtk.immodules
109}
110
111post-activate {
112    ui_debug "Updating gdk-pixbuf.loaders..."
113    system "${prefix}/bin/gdk-pixbuf-query-loaders \
114        >${prefix}/etc/gtk-2.0/gdk-pixbuf.loaders"
115    ui_debug "Updating immodules.cache..."
116    system "${prefix}/bin/gtk-query-immodules-2.0 --update-cache"
117}
118
119platform darwin 8 {
120    if {[variant_isset quartz] || ![variant_isset x11]} {
121        configure.ldflags-append  -framework Cocoa -framework Carbon
122    }
123
124    # latest versions are incompatible with the CUPS in Tiger (#33262)
125    configure.args-append --disable-cups
126
127    # The rules enabled by gobject-introspection require GNU make 3.81+ (#38927)
128    depends_build-append    port:gmake
129    build.cmd               ${prefix}/bin/gmake
130}
131
132if {![variant_isset quartz]} {
133    default_variants +x11
134}
135
136if {[variant_isset universal]} {
137    set cups /usr/bin/cups-config
138    if {[info exists universal_sysroot]} {
139        set cups ${universal_sysroot}${cups}
140    }
141    configure.env-append CUPS_CONFIG=${cups}
142
143    # Find architectures which will not run on build platform.
144    if {${os.major} >= 9} {
145        set cpu64bit_capable [sysctl hw.cpu64bit_capable]
146    } elseif {(![catch {sysctl hw.optional.x86_64} is_x86_64] && $is_x86_64)
147            || (![catch {sysctl hw.optional.64bitops} is_ppc64] && $is_ppc64)} {
148        set cpu64bit_capable 1
149    } else {
150        set cpu64bit_capable 0
151    }
152    if {${os.arch} eq "i386"} {
153        set cross_archs ppc64
154        if {${os.major} >= 10} {
155            lappend cross_archs ppc
156        }
157        set host_archs "ppc ppc64"
158        set run_archs i386
159        if {${cpu64bit_capable}} {
160            set run_archs "x86_64 ${run_archs}"
161        }
162    } else {
163        set cross_archs "i386 x86_64"
164        set host_archs "i386 x86_64"
165        set run_archs ppc
166        if {${cpu64bit_capable}} {
167            set run_archs "ppc64 ${run_archs}"
168        }
169    }
170
171    pre-configure {
172        set run_arch ""
173        foreach arch ${run_archs} {
174            if {[lsearch ${universal_archs_to_use} ${arch}] != -1} {
175                set run_arch ${arch}
176                break
177            }
178        }
179
180        if {${run_arch} eq ""} {
181            ui_error ""
182            ui_error "gtk2 requires at least one architecture runnable on this"
183            ui_error "machine to be able to build universally. Please add at least"
184            ui_error "one of the following architectures to `universal_archs` in"
185            ui_error "\"${prefix}/etc/macports/macports.conf\":"
186            ui_error ""
187            ui_error "\t${run_archs}"
188            ui_error ""
189        }
190
191        foreach arch ${host_archs} {
192            lappend merger_configure_env(${arch}) \
193                NM='/usr/bin/nm -p'
194        }
195
196        foreach arch ${cross_archs} {
197            lappend merger_configure_env(${arch}) \
198                GTK_UPDATE_ICON_CACHE=${worksrcpath}-${run_arch}/gtk/gtk-update-icon-cache \
199                GDK_PIXBUF_CSOURCE=${worksrcpath}-${run_arch}/gdk-pixbuf/gdk-pixbuf-csource
200            lappend merger_build_env(${arch}) \
201                GDK_PIXBUF_MODULE_FILE=${worksrcpath}-${run_arch}/gdk-pixbuf/gdk-pixbuf.loaders
202        }
203
204        # Let gtk_host in .pc files be the same on all architectures
205        set host powerpc
206        if {${os.arch} eq "i386"} {
207            set host i686
208        }
209        reinplace s/@host@/${host}-apple-darwin${os.version}/ \
210            {*}[glob -directory ${worksrcpath} *.pc.in]
211    }
212}
213
214variant quartz conflicts x11 {
215    require_active_variants path:lib/pkgconfig/cairo.pc:cairo quartz
216    require_active_variants path:lib/pkgconfig/pango.pc:pango quartz
217
218    configure.args-append   --with-gdktarget=quartz
219}
220
221variant x11 conflicts quartz {
222    require_active_variants path:lib/pkgconfig/cairo.pc:cairo x11
223    require_active_variants path:lib/pkgconfig/pango.pc:pango x11
224
225    depends_lib-append \
226        port:xorg-libXi \
227        port:xorg-libXrandr \
228        port:xorg-libXcursor \
229        port:xorg-libXinerama \
230        port:xorg-libXdamage \
231        port:xorg-libXcomposite \
232        port:xorg-libXfixes
233
234    configure.args-append      --with-xinput --enable-xinerama \
235                               --x-include=${prefix}/include --x-lib=${prefix}/lib
236}
237
238variant bundle requires quartz description {Support including into a bundle} {
239    configure.args-append --enable-quartz-relocation
240    notes "You have enabled 'bundle' variant which breaks GTK2 when used outside of application bundle!"
241}
242
243livecheck.type  regex
244livecheck.url   ftp://ftp.gnome.org/pub/gnome/sources/gtk+/${branch}/
245livecheck.regex {LATEST-IS-(\d+(?:\.\d+)*)}
Note: See TracBrowser for help on using the repository browser.