1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id: Portfile 106101 2013-05-14 23:21:43Z ryandesign@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup conflicts_build 1.0 |
---|
6 | |
---|
7 | name glib2 |
---|
8 | conflicts glib2-devel |
---|
9 | set my_name glib |
---|
10 | version 2.36.2 |
---|
11 | revision 1 |
---|
12 | set branch [join [lrange [split ${version} .] 0 1] .] |
---|
13 | categories devel |
---|
14 | maintainers ryandesign openmaintainer |
---|
15 | license LGPL-2+ |
---|
16 | homepage http://www.gtk.org/ |
---|
17 | platforms darwin |
---|
18 | dist_subdir glib2 |
---|
19 | distname ${my_name}-${version} |
---|
20 | use_xz yes |
---|
21 | use_parallel_build yes |
---|
22 | |
---|
23 | description Library with data structure functions and other constructs |
---|
24 | |
---|
25 | long_description Glib is a library which includes support routines \ |
---|
26 | for C, such as lists, trees, hashes, memory \ |
---|
27 | allocation, and many other things. |
---|
28 | |
---|
29 | master_sites gnome:sources/${my_name}/${branch}/ \ |
---|
30 | ftp://ftp.gtk.org/pub/${my_name}/${branch}/ |
---|
31 | |
---|
32 | checksums rmd160 3a409e1adbad0dc8e57a2396d207e16a7978b3fd \ |
---|
33 | sha256 5ea98451fb57d0ba523a1e836545f0a919b498863056fdd9da69d148c1347f80 |
---|
34 | |
---|
35 | # ${prefix}/include/glib-2.0/glib/gi18n.h requires -I${prefix}/include to find libintl.h |
---|
36 | # See https://trac.macports.org/changeset/27148 |
---|
37 | patchfiles patch-configure.diff \ |
---|
38 | patch-glib-2.0.pc.in.diff \ |
---|
39 | patch-glib_gunicollate.c.diff \ |
---|
40 | patch-gi18n.h.diff \ |
---|
41 | patch-gio_xdgmime_xdgmime.c.diff \ |
---|
42 | patch-gio_gdbusprivate.c.diff \ |
---|
43 | patch-get-launchd-dbus-session-address.diff |
---|
44 | |
---|
45 | # https://bugzilla.gnome.org/show_bug.cgi?id=700350 |
---|
46 | depends_build-append port:autoconf port:automake |
---|
47 | |
---|
48 | depends_lib port:gettext \ |
---|
49 | port:libiconv \ |
---|
50 | port:zlib \ |
---|
51 | port:libffi \ |
---|
52 | path:bin/perl:perl5 |
---|
53 | |
---|
54 | # TODO: compiling with clang produces a glib that breaks other ports; see #32202, #32204, #32233. |
---|
55 | compiler.blacklist clang |
---|
56 | |
---|
57 | # https://bugzilla.gnome.org/show_bug.cgi?id=697017 |
---|
58 | compiler.blacklist-append gcc-3.3 gcc-4.0 apple-gcc-4.0 |
---|
59 | |
---|
60 | # TODO: Remove this block once 2.2 is released |
---|
61 | compiler.fallback-append apple-gcc-4.2 |
---|
62 | if {[info exists portconfigure::compiler_name_map(${configure.compiler})]} { |
---|
63 | depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler}) |
---|
64 | |
---|
65 | # base 2.1.x ignores the argument and just use ${configure.compiler} |
---|
66 | if {[portconfigure::arch_flag_supported ${configure.compiler}]} { |
---|
67 | depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler}) |
---|
68 | } |
---|
69 | |
---|
70 | if {[string match macports-gcc* ${configure.compiler}]} { |
---|
71 | depends_lib-append port:$portconfigure::compiler_name_map(${configure.compiler}) |
---|
72 | } |
---|
73 | } |
---|
74 | |
---|
75 | # -lresolv is needed at least on Tiger PPC. |
---|
76 | configure.ldflags-append -lresolv \ |
---|
77 | -bind_at_load |
---|
78 | |
---|
79 | configure.cflags-append -fstrict-aliasing |
---|
80 | |
---|
81 | configure.args --enable-static --disable-libelf |
---|
82 | |
---|
83 | configure.perl ${prefix}/bin/perl |
---|
84 | configure.python /usr/bin/python |
---|
85 | configure.env-append PERL_PATH=${configure.perl} \ |
---|
86 | PKG_CONFIG=false \ |
---|
87 | ZLIB_CFLAGS="-I${prefix}/include" \ |
---|
88 | ZLIB_LIBS="-L${prefix}/lib -lz" |
---|
89 | |
---|
90 | post-patch { |
---|
91 | reinplace "s|data_dirs = \"/usr|data_dirs = \"${prefix}/share:/usr|g" ${worksrcpath}/glib/gutils.c |
---|
92 | reinplace "s|path = \"/bin|path = \"${prefix}/bin:/bin|g" ${worksrcpath}/glib/gutils.c ${worksrcpath}/glib/gspawn.c |
---|
93 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/gio/xdgmime/xdgmime.c |
---|
94 | reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/gio/gdbusprivate.c |
---|
95 | reinplace "s|#! */usr/bin/env python|#!${configure.python}|g" ${worksrcpath}/glib/gtester-report |
---|
96 | reinplace "s|-Werror=missing-prototypes||" ${worksrcpath}/configure |
---|
97 | } |
---|
98 | |
---|
99 | pre-configure { |
---|
100 | set libffi_version [exec sed -n {s/Version: //p} ${prefix}/lib/pkgconfig/libffi.pc] |
---|
101 | configure.env-append LIBFFI_CFLAGS="-I${prefix}/lib/libffi-${libffi_version}/include" \ |
---|
102 | LIBFFI_LIBS="-L${prefix}/lib -lffi" |
---|
103 | } |
---|
104 | |
---|
105 | post-configure { |
---|
106 | system "ed - ${worksrcpath}/config.h < ${filespath}/config.h.ed" |
---|
107 | } |
---|
108 | |
---|
109 | build.args V=1 |
---|
110 | |
---|
111 | test.run yes |
---|
112 | test.target check |
---|
113 | |
---|
114 | post-destroot { |
---|
115 | file delete ${destroot}${prefix}/lib/charset.alias |
---|
116 | |
---|
117 | set docdir ${prefix}/share/doc/${name} |
---|
118 | xinstall -d ${destroot}${docdir} |
---|
119 | xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING ChangeLog HACKING NEWS \ |
---|
120 | README ${destroot}${docdir} |
---|
121 | } |
---|
122 | |
---|
123 | platform darwin { |
---|
124 | configure.args-append --disable-dtrace |
---|
125 | } |
---|
126 | |
---|
127 | platform darwin 8 { |
---|
128 | depends_lib-append port:python27 |
---|
129 | configure.python ${prefix}/bin/python2.7 |
---|
130 | } |
---|
131 | |
---|
132 | livecheck.type gnome |
---|
133 | livecheck.name ${my_name} |
---|