source: trunk/dports/x11/gtk2/Portfile @ 36623

Last change on this file since 36623 was 36623, checked in by nox@…, 11 years ago

gtk2:

  • The check for Leopard is not anymore in a platform block.
  • Fixed CUPS support in universal build (closes #15132).
  • gtk-doc removed from the list of the build dependencies, it's not even needed at all to install the documentation (closes #14892).
  • Turned off ccache support which is broken (closes #14766).
  • Enabled parallel build support.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.8 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 36623 2008-05-08 15:38:21Z nox@macports.org $
3
4PortSystem      1.0
5
6name            gtk2
7version         2.12.9
8set branch      [join [lrange [split ${version} .] 0 1] .]
9categories      x11
10maintainers     nox openmaintainer
11platforms       darwin
12description     Gimp ToolKit version 2
13
14long_description \
15    This is GTK+ version 2.x. GTK+, which stands for Gimp \
16    ToolKit, is a library for creating GUIs for the X Windows \
17    System.
18
19homepage        http://www.gtk.org/
20distname        gtk+-${version}
21use_bzip2       yes
22
23master_sites    gnome:sources/gtk+/${branch}/ \
24                ftp://ftp.gtk.org/pub/gtk/v${branch}/ \
25                http://ftp.gtk.org/pub/gtk/v${branch}/
26
27if {[variant_isset no_x11]} {
28    default_variants    +quartz
29}
30
31if {![variant_isset quartz]} {
32    default_variants    +x11
33}
34
35if {[variant_isset universal]} {
36    configure.env-append    CUPS_CONFIG="${configure.universal_sysroot}/usr/bin/cups-config"
37}
38
39pre-fetch {
40    if {![variant_isset quartz] && ![variant_isset x11]} {
41        error "Either +x11 or +quartz is required"
42    }
43
44    if {[rpm-vercomp ${os.version} 8.0] >= 0 && [file exists ${prefix}/bin/cups-config]} {
45        ui_error "You are running Darwin 8.0, cups-headers should not be installed on your system. Please uninstall or deactivate it."
46        error "Please uninstall or deactivate cups-headers."
47    }
48}
49
50checksums       md5 33499772fdc3bea569c6d5673e5831b4 \
51                sha1 95e375f8478940a5b096845a9bff76004f265eba \
52                rmd160 c93c046aa30b26bbf4d53b6f3e900283eb2d5616
53
54patchfiles      patch-gtk-xdgmime-xdgmime.c.diff
55
56post-patch {
57    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/gtk/xdgmime/xdgmime.c
58}
59
60depends_build   port:pkgconfig
61
62depends_lib     port:cairo \
63                port:fontconfig \
64                port:freetype \
65                port:glib2 \
66                port:jpeg \
67                port:tiff \
68                port:libiconv \
69                port:libpng \
70                port:atk \
71                port:pango \
72                port:gettext \
73                port:render \
74                port:zlib
75
76depends_run     port:shared-mime-info
77
78configure.args  --disable-shm \
79                --disable-glibtest \
80                --with-included-loaders
81
82configure.ccache            no
83configure.cppflags-append   -no-cpp-precomp -DX_LOCALE
84configure.cflags-append     -funroll-loops -fstrict-aliasing
85
86use_parallel_build  yes
87
88test.run        yes
89test.target     check
90
91post-destroot {
92    ui_debug "Creating gtk.immodules..."
93    system "DYLD_LIBRARY_PATH=${destroot}${prefix}/lib ${destroot}${prefix}/bin/gtk-query-immodules-2.0 \
94        ${destroot}${prefix}/lib/gtk-2.0/2.10.0/immodules/*.so >${destroot}${prefix}/etc/gtk-2.0/gtk.immodules"
95    reinplace "s|${destroot}||" ${destroot}${prefix}/etc/gtk-2.0/gtk.immodules
96}
97
98post-activate {
99    ui_debug "Updating gdk-pixbuf.loaders..."
100    system "${prefix}/bin/gdk-pixbuf-query-loaders >${prefix}/etc/gtk-2.0/gdk-pixbuf.loaders"
101}
102
103platform darwin 6 {
104    patchfiles-append   patch-gtk-xdgmime-xdgmimemagic.c.diff
105}
106
107platform darwin 7 {
108    depends_build-append    port:cups-headers
109}
110
111variant no_x11 description {Same as +quartz} {
112    pre-fetch {
113        if {[file exists ${prefix}/lib/libpangox-1.0.dylib]} {
114            ui_error "Please uninstall or deactivate the pango port and reinstall it by running `port install pango +no_x11`."
115            error "pango must be installed with the no_x11 variant enabled."
116        }
117    }
118}
119
120variant quartz requires no_x11 conflicts x11 description {Enable Quartz rendering} {
121    pre-fetch {
122        if {![file exists ${prefix}/include/cairo/cairo-quartz.h]} {
123            ui_error "Please uninstall or deactivate the cairo port and reinstall it by running `port install cairo +quartz`."
124            error "cairo must be installed with the quartz variant enabled."
125        }
126    }
127
128    configure.args-append   --with-gdktarget=quartz
129}
130
131variant x11 conflicts quartz description {Enable rendering in X11 (default)} {
132    pre-fetch {
133        if {${os.platform} == "darwin" && [lindex [split ${os.version} .] 0] eq 9} {
134            if {![file exists /usr/X11/lib/libXrandr.2.0.0.dylib]} {
135                ui_error "Some libs are missing from your X11 installation. Please run this command:"
136                ui_error "sudo ln -s libXrandr.2.dylib /usr/X11/lib/libXrandr.2.0.0.dylib"
137                error "missing /usr/X11/lib/libXrandr.2.0.0.dylib"
138            }
139        }
140    }
141
142    depends_lib-append  port:xrender \
143                        lib:libX11.6:xorg
144
145    configure.cppflags-append   -I${x11prefix}/include
146}
147
148livecheck.check regex
149livecheck.url   ftp://ftp.gnome.org/pub/gnome/sources/gtk+/${branch}/
150livecheck.regex {LATEST-IS-(\d+(?:\.\d+)*)}
Note: See TracBrowser for help on using the repository browser.