source: trunk/dports/gnome/gtk3-devel/Portfile @ 115615

Last change on this file since 115615 was 115615, checked in by cal@…, 5 years ago

add gtk3-devel port at the request of devans, rewrite dependencies to be satisfyable using gtk3-devel, closes #42040

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.3 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 115615 2014-01-07 00:28:17Z cal@macports.org $
3
4PortSystem          1.0
5PortGroup           archcheck 1.0
6PortGroup           muniversal 1.0
7PortGroup           xcodeversion 1.0
8PortGroup           active_variants 1.1
9
10name                gtk3-devel
11set real_name       gtk+
12epoch               1
13version             3.11.2
14set branch          [join [lrange [split ${version} .] 0 1] .]
15categories          gnome x11
16license             LGPL-2.1+
17maintainers         cal openmaintainer
18platforms           darwin
19
20checksums           rmd160  1d591207a119124d8c46d025908d6bd0af97b1ed \
21                    sha256  3c24c57fc5cb7a5ea39d3a3ff7b12be63d7f21a52fd6f20f7b983e19b7b0268a
22
23description         GTK+ widget toolkit
24
25long_description    \
26    GTK+ is a highly usable, feature rich toolkit for creating graphical \
27    user interfaces which boasts cross platform compatibility and an easy \
28    to use API. GTK+ it is written in C, but has bindings to many other \
29    popular programming languages such as C++, Python and C# among others.
30
31homepage            http://www.gtk.org/
32distname            ${real_name}-${version}
33use_xz              yes
34
35master_sites        gnome:sources/gtk+/${branch}/ \
36                    ftp://ftp.gtk.org/pub/gtk/${branch}/ \
37                    http://ftp.gtk.org/pub/gtk/${branch}/
38
39minimum_xcodeversions {9 3.1}
40depends_build       port:pkgconfig
41
42depends_lib         port:atk \
43                    path:lib/pkgconfig/pango.pc:pango \
44                    port:gdk-pixbuf2 \
45                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
46                    port:gobject-introspection
47
48depends_run         port:shared-mime-info \
49                    port:hicolor-icon-theme
50
51patchfiles          patch-gdk_quartz_gdkevents-quartz.c-syntax-error.diff
52
53archcheck.files \
54    lib/libatk-1.0.dylib \
55    lib/libintl.dylib \
56    lib/libjasper.dylib \
57    lib/libpango-1.0.dylib \
58    lib/libtiff.dylib
59
60configure.args      --enable-static \
61                    --disable-glibtest \
62                    --enable-introspection \
63                    --disable-wayland-backend \
64                    --disable-schemas-compile \
65                    gio_can_sniff=yes
66
67# gobject-introspection uses g-ir-scanner, which uses $CC from env
68if {[variant_isset universal]} {
69    foreach arch ${configure.universal_archs} {
70        lappend merger_build_args(${arch})  CC='${configure.cc} -arch ${arch}'
71        lappend merger_build_args(${arch})  CC_FOR_BUILD='${configure.cc} -arch ${arch}'
72        lappend merger_destroot_args(${arch})  CC='${configure.cc} -arch ${arch}'
73        lappend merger_destroot_args(${arch})  CC_FOR_BUILD='${configure.cc} -arch ${arch}'
74    }
75} else {
76    build.args-append       CC="${configure.cc} ${configure.cc_archflags}" \
77                            CC_FOR_BUILD="${configure.cc} ${configure.cc_archflags}"
78    destroot.args-append    CC="${configure.cc} ${configure.cc_archflags}" \
79                            CC_FOR_BUILD="${configure.cc} ${configure.cc_archflags}"
80}
81
82build.args-append   V=1 \
83                    CPP_FOR_BUILD="${configure.cpp}"
84
85configure.ccache    no
86configure.cppflags-append   -DX_LOCALE
87configure.cflags-append     -fstrict-aliasing
88
89pre-configure {
90    if {![variant_isset quartz] && ![variant_isset x11]} {
91        error "Either +x11 or +quartz is required"
92    }
93}
94
95test.run            yes
96test.target         check
97
98post-destroot {
99    set docdir ${prefix}/share/doc/${name}
100    xinstall -d ${destroot}${docdir}
101    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING HACKING NEWS README \
102        ${destroot}${docdir}
103
104    # avoid conflict with the gtk-update-icon-cache installed by gtk2
105    move ${destroot}${prefix}/bin/gtk-update-icon-cache \
106         ${destroot}${prefix}/bin/gtk-update-icon-cache-3.0
107   
108    ui_debug "Creating gtk.immodules..."
109    system "DYLD_LIBRARY_PATH=${destroot}${prefix}/lib \
110        ${destroot}${prefix}/bin/gtk-query-immodules-3.0 \
111        ${destroot}${prefix}/lib/gtk-3.0/3.0.0/immodules/*.so \
112        >${destroot}${prefix}/etc/gtk-3.0/gtk.immodules"
113    reinplace "s|${destroot}||" ${destroot}${prefix}/etc/gtk-3.0/gtk.immodules
114}
115
116post-activate {
117    ui_debug "Updating gdk-pixbuf.loaders..."
118    system "${prefix}/bin/gdk-pixbuf-query-loaders \
119        >${prefix}/etc/gtk-3.0/gdk-pixbuf.loaders"
120    ui_debug "Updating GLib schemas..."
121    system "${prefix}/bin/glib-compile-schemas \
122        ${prefix}/share/glib-2.0/schemas"
123}
124
125platform darwin 8 {
126    # The rules enabled by gobject-introspection require GNU make 3.81+
127    depends_build-append    port:gmake
128    build.cmd               ${prefix}/bin/gmake
129
130    if {[variant_isset quartz] || ![variant_isset x11]} {
131        configure.ldflags-append  -framework Cocoa -framework Carbon
132    }
133}
134
135if {${os.major} <= 8} {
136    configure.args-append --disable-cups
137}
138
139if {[variant_isset no_x11]} {
140    default_variants +quartz
141} elseif {![variant_isset quartz]} {
142    default_variants +x11
143}
144
145if {[variant_isset universal]} {
146    set cups /usr/bin/cups-config
147    if {[info exists universal_sysroot]} {
148        set cups ${universal_sysroot}${cups}
149    }
150    configure.env-append CUPS_CONFIG=${cups}
151
152    # Find architectures which will not run on build platform.
153    set cpu64bit_capable [sysctl hw.cpu64bit_capable]
154    if {${os.arch} eq "i386"} {
155        set cross_archs ppc64
156        if {${os.major} >= 10} {
157            lappend cross_archs ppc
158        }
159        set host_archs "ppc ppc64"
160        set run_archs i386
161        if {${cpu64bit_capable}} {
162            set run_archs "x86_64 ${run_archs}"
163        }
164    } else {
165        set cross_archs "i386 x86_64"
166        set host_archs "i386 x86_64"
167        set run_archs ppc
168        if {${cpu64bit_capable}} {
169            set run_archs "ppc64 ${run_archs}"
170        }
171    }
172
173    pre-configure {
174        set run_arch ""
175        foreach arch ${run_archs} {
176            if {[lsearch ${universal_archs_to_use} ${arch}] != -1} {
177                set run_arch ${arch}
178                break
179            }
180        }
181
182        if {${run_arch} eq ""} {
183            ui_error ""
184            ui_error "${name} requires at least one architecture runnable on this"
185            ui_error "machine to be able to build universally. Please add at least"
186            ui_error "one of the following architectures to `universal_archs` in"
187            ui_error "\"${prefix}/etc/macports/macports.conf\":"
188            ui_error ""
189            ui_error "\t${run_archs}"
190            ui_error ""
191        }
192
193        foreach arch ${host_archs} {
194            lappend merger_configure_env(${arch}) \
195                NM='/usr/bin/nm -p'
196        }
197
198        foreach arch ${cross_archs} {
199            lappend merger_configure_env(${arch}) \
200                GTK_UPDATE_ICON_CACHE=${worksrcpath}-${run_arch}/gtk/gtk-update-icon-cache \
201                GDK_PIXBUF_CSOURCE=${worksrcpath}-${run_arch}/gdk-pixbuf/gdk-pixbuf-csource
202            lappend merger_build_env(${arch}) \
203                GDK_PIXBUF_MODULE_FILE=${worksrcpath}-${run_arch}/gdk-pixbuf/gdk-pixbuf.loaders
204        }
205
206        # Let gtk_host in .pc files be the same on all architectures
207        set host powerpc
208        if {${os.arch} eq "i386"} {
209            set host i686
210        }
211        eval reinplace s/@host@/${host}-apple-darwin${os.version}/ \
212            [glob -directory ${worksrcpath} *.pc.in]
213    }
214   
215    merger_arch_compiler yes
216} else {
217    configure.cc "${configure.cc} ${configure.cc_archflags}"
218}
219
220variant quartz conflicts x11 {
221    require_active_variants path:lib/pkgconfig/cairo.pc:cairo quartz
222    require_active_variants path:lib/pkgconfig/pango.pc:pango quartz
223
224    configure.args-append   --enable-quartz-backend
225}
226
227variant x11 conflicts quartz no_x11 {
228    require_active_variants path:lib/pkgconfig/cairo.pc:cairo x11
229    require_active_variants path:lib/pkgconfig/pango.pc:pango x11
230
231    depends_lib-append \
232        port:xorg-libXi \
233        port:xorg-libXrandr \
234        port:xorg-libXcursor \
235        port:xorg-libXinerama \
236        port:xorg-libXdamage \
237        port:xorg-libXcomposite \
238        port:xorg-libXfixes \
239        port:at-spi2-atk
240
241    configure.args-append      --enable-xinerama \
242                               --x-include=${prefix}/include --x-lib=${prefix}/lib \
243                               --enable-x11-backend
244}
245
246variant no_x11 conflicts x11 description {Legacy compatibility variant} {}
247
248livecheck.type  gnome-with-unstable
249livecheck.name  gtk+
Note: See TracBrowser for help on using the repository browser.