source: trunk/dports/x11/pango-devel/Portfile @ 97557

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

pango-devel: add patch; default to glib2-devel for now

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.9 KB
Line 
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 97557 2012-09-09 06:53:32Z ryandesign@macports.org $
3
4PortSystem              1.0
5
6name                    pango-devel
7conflicts               pango
8set my_name             pango
9version                 1.31.1
10set branch              [join [lrange [split ${version} .] 0 1] .]
11categories              x11
12maintainers             ryandesign openmaintainer
13license                 LGPL-2
14homepage                http://www.pango.org/
15master_sites            gnome:sources/${my_name}/${branch}
16platforms               darwin
17distname                ${my_name}-${version}
18dist_subdir             ${my_name}
19use_xz                  yes
20use_parallel_build      yes
21
22description \
23    Framework for the layout and rendering of i18n text
24
25long_description \
26    The goal of the Pango project is to provide an \
27    open-source framework for the layout and rendering \
28    of internationalized text.
29
30checksums               rmd160  92cfa31e0fa572d35dd300e879a0ed872db47731 \
31                        sha256  b87ecdde5bf6f9a407162155edbba452923e79f86bcf8a09d6ca1916222c9f81
32
33depends_build \
34    port:pkgconfig
35
36depends_lib \
37    path:lib/pkgconfig/glib-2.0.pc:glib2-devel \
38    path:lib/pkgconfig/cairo.pc:cairo \
39    port:gobject-introspection \
40    port:harfbuzz \
41    port:libpng
42
43patchfiles              patch-ltmain.sh.diff
44
45patchfiles-append       patch-pango-Makefile.am.diff
46use_autoreconf          yes
47
48configure.ccache        no
49
50platform macosx {
51variant quartz {
52    # Although this variant does nothing, pango will automatically build
53    # itself differently depending on whether or not cairo is installed with
54    # the quartz variant. Therefore this variant is necessary to be able to
55    # distinguish whether an installed pango has quartz support or not.
56}
57}
58
59pre-configure {
60    set glib_minimum_version 2.33.12
61    set glib_installed_version [exec ${prefix}/bin/pkg-config glib-2.0 --modversion]
62    if {[vercmp ${glib_installed_version} ${glib_minimum_version}] < 0} {
63        ui_error "${name} ${version} requires glib2 ${glib_minimum_version} or later but you have glib2 ${glib_installed_version}."
64        return -code error "incompatible glib2 version"
65    }
66   
67    set cairo_minimum_version 1.7.6
68    set cairo_installed_version [exec ${prefix}/bin/pkg-config cairo --modversion]
69    if {[vercmp ${cairo_installed_version} ${cairo_minimum_version}] < 0} {
70        ui_error "${name} ${version} requires cairo ${cairo_minimum_version} or later but you have cairo ${cairo_installed_version}."
71        return -code error "incompatible cairo version"
72    }
73   
74    set cairo_quartz_pc ${prefix}/lib/pkgconfig/cairo-quartz.pc
75    if {[variant_exists quartz] && [variant_isset quartz]} {
76        if {![file exists ${cairo_quartz_pc}]} {
77            ui_error "To install pango with the quartz variant, cairo must be installed with the quartz variant."
78            return -code error "incompatible cairo installation"
79        }
80    } else {
81        if {[file exists ${cairo_quartz_pc}]} {
82            ui_error "To install pango without the quartz variant, cairo must be installed without the quartz variant."
83            return -code error "incompatible cairo installation"
84        }
85    }
86   
87    set cairo_xlib_pc ${prefix}/lib/pkgconfig/cairo-xlib.pc
88    if {[variant_isset x11]} {
89        if {![file exists ${cairo_xlib_pc}]} {
90            ui_error "To install pango with the x11 variant, cairo must be installed with the x11 variant."
91            return -code error "incompatible cairo installation"
92        }
93    } else {
94        if {[file exists ${cairo_xlib_pc}]} {
95            ui_error "To install pango without the x11 variant, cairo must be installed without the x11 variant."
96            return -code error "incompatible cairo installation"
97        }
98    }
99}
100
101configure.args          --enable-static \
102                        --enable-introspection \
103                        --disable-silent-rules \
104                        --without-x
105
106# gobject-introspection uses g-ir-scanner, which uses $CC from env
107build.args-append       CC="${configure.cc} ${configure.cc_archflags}"
108destroot.args-append    CC="${configure.cc} ${configure.cc_archflags}"
109
110variant builtin_modules description {Build the modules into Pango statically (most users do not need this variant)} {
111    configure.args-append   --with-included-modules
112}
113
114variant no_x11 conflicts x11 description {Legacy compatibility variant} {}
115variant x11 {
116    depends_lib-append      port:Xft2
117    configure.args-delete   --without-x
118    configure.args-append   --x-include=${prefix}/include \
119                            --x-lib=${prefix}/lib
120}
121
122if {[variant_isset no_x11]} {
123    default_variants -x11
124} else {
125    default_variants +x11
126}
127
128post-destroot {
129    xinstall -d ${destroot}${prefix}/etc/pango
130    if {![variant_isset builtin_modules]} {
131        xinstall -m 0644 ${worksrcpath}/modules/pangorc \
132            ${destroot}${prefix}/etc/pango
133        reinplace "s|\\.\\./modules/|${prefix}/etc/pango/|g" \
134            ${destroot}${prefix}/etc/pango/pangorc
135
136        system "env LANG=C DYLD_LIBRARY_PATH=${destroot}${prefix}/lib \
137            ${destroot}${prefix}/bin/pango-querymodules ${destroot}${prefix}/lib/pango/1.6.0/modules/*.so \
138            >${destroot}${prefix}/etc/pango/pango.modules"
139        reinplace s|${destroot}||g ${destroot}${prefix}/etc/pango/pango.modules
140    }
141
142    set docdir ${prefix}/share/doc/${my_name}
143    xinstall -d ${destroot}${docdir}
144    xinstall -m 0644 -W ${worksrcpath} AUTHORS ChangeLog COPYING MAINTAINERS NEWS README THANKS \
145        ${destroot}${docdir}
146}
147
148# The rules enabled by gobject-introspection require GNU make 3.81+, #35203
149platform darwin 8 {
150    depends_build-append    port:gmake
151    build.cmd               ${prefix}/bin/gmake
152}
153
154test.run                yes
155test.target             check
156
157livecheck.type          regex
158livecheck.url           http://ftp.gnome.org/pub/GNOME/sources/${my_name}/${branch}/?C=M&O=D
159livecheck.regex         ${my_name}-(\[0-9.\]+)\\.tar
Note: See TracBrowser for help on using the repository browser.