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

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

In all openmaintainer and nomaintainer ports and my ports, depend on glib2 via a path in ${prefix} so that either glib2 or glib2-devel can satisfy the dependency

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.8 KB
RevLine 
[31357]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
[20497]2# $Id: Portfile 38077 2008-07-05 21:37:56Z ryandesign@macports.org $
[2129]3
[33205]4PortSystem      1.0
[31320]5
[33206]6name            gtk2
[35036]7version         2.12.9
[33205]8set branch      [join [lrange [split ${version} .] 0 1] .]
[33206]9categories      x11
10maintainers     nox openmaintainer
11platforms       darwin
12description     Gimp ToolKit version 2
[1491]13
[22173]14long_description \
[33205]15    This is GTK+ version 2.x. GTK+, which stands for Gimp \
[31320]16    ToolKit, is a library for creating GUIs for the X Windows \
17    System.
[1491]18
[33206]19homepage        http://www.gtk.org/
20distname        gtk+-${version}
21use_bzip2       yes
[1324]22
[33205]23master_sites    gnome:sources/gtk+/${branch}/ \
24                ftp://ftp.gtk.org/pub/gtk/v${branch}/ \
25                http://ftp.gtk.org/pub/gtk/v${branch}/
[1324]26
[36184]27if {[variant_isset no_x11]} {
28    default_variants    +quartz
29}
30
[33208]31if {![variant_isset quartz]} {
[31844]32    default_variants    +x11
33}
[31423]34
[36623]35if {[variant_isset universal]} {
36    configure.env-append    CUPS_CONFIG="${configure.universal_sysroot}/usr/bin/cups-config"
37}
38
[31423]39pre-fetch {
[33208]40    if {![variant_isset quartz] && ![variant_isset x11]} {
41        error "Either +x11 or +quartz is required"
[31434]42    }
[33205]43
[33208]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."
[31320]47    }
[33208]48}
[33205]49
[35036]50checksums       md5 33499772fdc3bea569c6d5673e5831b4 \
51                sha1 95e375f8478940a5b096845a9bff76004f265eba \
52                rmd160 c93c046aa30b26bbf4d53b6f3e900283eb2d5616
[33208]53
54patchfiles      patch-gtk-xdgmime-xdgmime.c.diff
55
56post-patch {
57    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/gtk/xdgmime/xdgmime.c
[19342]58}
[29116]59
[36623]60depends_build   port:pkgconfig
[33205]61
62depends_lib     port:cairo \
63                port:fontconfig \
64                port:freetype \
[38077]65                path:${prefix}/lib/pkgconfig/glib-2.0.pc:glib2 \
[33205]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
[35061]76depends_run     port:shared-mime-info
77
[33205]78configure.args  --disable-shm \
[33208]79                --disable-glibtest \
80                --with-included-loaders
[33205]81
[36623]82configure.ccache            no
[31320]83configure.cppflags-append   -no-cpp-precomp -DX_LOCALE
84configure.cflags-append     -funroll-loops -fstrict-aliasing
[19342]85
[36623]86use_parallel_build  yes
87
[33208]88test.run        yes
89test.target     check
[1781]90
[33205]91post-destroot {
[33208]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
[33205]96}
97
98post-activate {
[33208]99    ui_debug "Updating gdk-pixbuf.loaders..."
100    system "${prefix}/bin/gdk-pixbuf-query-loaders >${prefix}/etc/gtk-2.0/gdk-pixbuf.loaders"
[33205]101}
102
[31320]103platform darwin 6 {
[33206]104    patchfiles-append   patch-gtk-xdgmime-xdgmimemagic.c.diff
[31320]105}
[8466]106
[28266]107platform darwin 7 {
[33205]108    depends_build-append    port:cups-headers
[28266]109}
110
[36184]111variant no_x11 description {Same as +quartz} {
[33208]112    pre-fetch {
[36184]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`."
[36380]115            error "pango must be installed with the no_x11 variant enabled."
[36184]116        }
117    }
118}
119
120variant quartz requires no_x11 conflicts x11 description {Enable Quartz rendering} {
121    pre-fetch {
[33208]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
[33205]128    configure.args-append   --with-gdktarget=quartz
[31320]129}
[19342]130
[31870]131variant x11 conflicts quartz description {Enable rendering in X11 (default)} {
[36623]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
[33205]142    depends_lib-append  port:xrender \
143                        lib:libX11.6:xorg
144
[33208]145    configure.cppflags-append   -I${x11prefix}/include
[31362]146}
147
[29212]148livecheck.check regex
[36184]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.