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

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

pango-devel: avoid needing to have gtk-doc installed (#36049)

  • 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 97589 2012-09-09 17:18:11Z 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.in.diff
46
47configure.ccache        no
48
49platform macosx {
50variant quartz {
51    # Although this variant does nothing, pango will automatically build
52    # itself differently depending on whether or not cairo is installed with
53    # the quartz variant. Therefore this variant is necessary to be able to
54    # distinguish whether an installed pango has quartz support or not.
55}
56}
57
58pre-configure {
59    set glib_minimum_version 2.33.12
60    set glib_installed_version [exec ${prefix}/bin/pkg-config glib-2.0 --modversion]
61    if {[vercmp ${glib_installed_version} ${glib_minimum_version}] < 0} {
62        ui_error "${name} ${version} requires glib2 ${glib_minimum_version} or later but you have glib2 ${glib_installed_version}."
63        return -code error "incompatible glib2 version"
64    }
65   
66    set cairo_minimum_version 1.7.6
67    set cairo_installed_version [exec ${prefix}/bin/pkg-config cairo --modversion]
68    if {[vercmp ${cairo_installed_version} ${cairo_minimum_version}] < 0} {
69        ui_error "${name} ${version} requires cairo ${cairo_minimum_version} or later but you have cairo ${cairo_installed_version}."
70        return -code error "incompatible cairo version"
71    }
72   
73    set cairo_quartz_pc ${prefix}/lib/pkgconfig/cairo-quartz.pc
74    if {[variant_exists quartz] && [variant_isset quartz]} {
75        if {![file exists ${cairo_quartz_pc}]} {
76            ui_error "To install pango with the quartz variant, cairo must be installed with the quartz variant."
77            return -code error "incompatible cairo installation"
78        }
79    } else {
80        if {[file exists ${cairo_quartz_pc}]} {
81            ui_error "To install pango without the quartz variant, cairo must be installed without the quartz variant."
82            return -code error "incompatible cairo installation"
83        }
84    }
85   
86    set cairo_xlib_pc ${prefix}/lib/pkgconfig/cairo-xlib.pc
87    if {[variant_isset x11]} {
88        if {![file exists ${cairo_xlib_pc}]} {
89            ui_error "To install pango with the x11 variant, cairo must be installed with the x11 variant."
90            return -code error "incompatible cairo installation"
91        }
92    } else {
93        if {[file exists ${cairo_xlib_pc}]} {
94            ui_error "To install pango without the x11 variant, cairo must be installed without the x11 variant."
95            return -code error "incompatible cairo installation"
96        }
97    }
98}
99
100configure.args          --enable-static \
101                        --enable-introspection \
102                        --disable-silent-rules \
103                        --without-x
104
105# gobject-introspection uses g-ir-scanner, which uses $CC from env
106build.args-append       CC="${configure.cc} ${configure.cc_archflags}"
107destroot.args-append    CC="${configure.cc} ${configure.cc_archflags}"
108
109variant builtin_modules description {Build the modules into Pango statically (most users do not need this variant)} {
110    configure.args-append   --with-included-modules
111}
112
113variant no_x11 conflicts x11 description {Legacy compatibility variant} {}
114variant x11 {
115    depends_lib-append      port:Xft2
116    configure.args-delete   --without-x
117    configure.args-append   --x-include=${prefix}/include \
118                            --x-lib=${prefix}/lib
119}
120
121if {[variant_isset no_x11]} {
122    default_variants -x11
123} else {
124    default_variants +x11
125}
126
127post-destroot {
128    xinstall -d ${destroot}${prefix}/etc/pango
129    if {![variant_isset builtin_modules]} {
130        xinstall -m 0644 ${worksrcpath}/modules/pangorc \
131            ${destroot}${prefix}/etc/pango
132        reinplace "s|\\.\\./modules/|${prefix}/etc/pango/|g" \
133            ${destroot}${prefix}/etc/pango/pangorc
134
135        system "env LANG=C DYLD_LIBRARY_PATH=${destroot}${prefix}/lib \
136            ${destroot}${prefix}/bin/pango-querymodules ${destroot}${prefix}/lib/pango/1.6.0/modules/*.so \
137            >${destroot}${prefix}/etc/pango/pango.modules"
138        reinplace s|${destroot}||g ${destroot}${prefix}/etc/pango/pango.modules
139    }
140
141    set docdir ${prefix}/share/doc/${my_name}
142    xinstall -d ${destroot}${docdir}
143    xinstall -m 0644 -W ${worksrcpath} AUTHORS ChangeLog COPYING MAINTAINERS NEWS README THANKS \
144        ${destroot}${docdir}
145}
146
147# The rules enabled by gobject-introspection require GNU make 3.81+, #35203
148platform darwin 8 {
149    depends_build-append    port:gmake
150    build.cmd               ${prefix}/bin/gmake
151}
152
153test.run                yes
154test.target             check
155
156livecheck.type          regex
157livecheck.url           http://ftp.gnome.org/pub/GNOME/sources/${my_name}/${branch}/?C=M&O=D
158livecheck.regex         ${my_name}-(\[0-9.\]+)\\.tar
Note: See TracBrowser for help on using the repository browser.