source: trunk/dports/textproc/openjade/Portfile @ 115642

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

openjade: fix build on Tiger by blacklisting old GCC

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 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 115642 2014-01-07 19:12:38Z ryandesign@macports.org $
3
4PortSystem 1.0
5
6name            openjade
7version         1.3.2
8revision        7
9categories      textproc
10license         MIT
11maintainers     fourpalms.org:lockhart openmaintainer
12description     James Clark's implementation of DSSSL
13homepage        http://openjade.sourceforge.net/
14platforms       darwin freebsd
15
16long_description OpenJade is an implementation of ISO/IEC 10179:1996 \
17                 standard DSSSL language.
18
19master_sites    sourceforge:project/openjade/openjade/${version}
20
21checksums       md5 7df692e3186109cc00db6825b777201e
22
23patchfiles      clang.patch \
24                patch-GroveApp.h \
25                patch-GroveBuilder.cxx \
26                patch-Node.h \
27                openjade-getoptperl.patch \
28                delete_la_files.patch
29
30depends_lib     port:opensp
31depends_run     port:xmlcatmgr
32
33# xmlcatmgr as installed by MacPorts defaults to using
34# ${prefix}/etc/sgml/catalog (for XML) and ${prefix}/etc/sgml/catalog (for
35# SGML). For historic reasons, openjade expects the catalog to be in
36# share/sgml/catalog. To avoid breaking existing setup, we simply add
37# a reference to the root catalog (/etc/sgml/catalog) to openjade's
38# catalog (/share/sgml/catalog)
39set catalog.sgml      ${prefix}/etc/sgml/catalog
40set catalog.openjade  ${prefix}/share/sgml/catalog
41 
42configure.args  --enable-http --enable-html --enable-mif \
43                --disable-dependency-tracking \
44                --enable-default-catalog=${catalog.openjade} \
45                --datadir=${prefix}/share/sgml/openjade \
46                --mandir=${prefix}/share/man
47
48configure.env-append        LIBS="-L${prefix}/lib"
49configure.cxxflags-append   "-isystem ${prefix}/include -fno-rtti"
50configure.ldflags-delete    "-L${prefix}/lib"
51
52# Fix build failure on Tiger due to use of -isystem
53compiler.blacklist    gcc-4.0 gcc-3.3
54
55# TODO: Simplify once MacPorts 2.3 is released
56set cxx_stdlibflags {}
57if {[info exists configure.cxx_stdlib] && ${configure.cxx_stdlib} ne {} && [string match *clang* ${configure.cxx}]} {
58    set cxx_stdlibflags "-stdlib=${configure.cxx_stdlib}"
59}
60
61post-configure  {
62    reinplace "s|^#pragma implementation||g" ${worksrcpath}/grove/Node.cxx
63    reinplace "s|^#pragma implementation||g" ${worksrcpath}/msggen.pl
64    reinplace "s|^#pragma implementation||g" ${worksrcpath}/spgrove/GroveApp.cxx
65    reinplace "s|^#pragma implementation||g" ${worksrcpath}/style/MessageModule.cxx
66    reinplace "s|^#pragma interface||g" ${worksrcpath}/generic/EventGenerator.h
67    reinplace "s|^#pragma interface||g" ${worksrcpath}/generic/ParserEventGeneratorKit.h
68    reinplace "s|^#pragma interface||g" ${worksrcpath}/generic/SGMLApplication.h
69    reinplace "s|^#pragma interface||g" ${worksrcpath}/grove/Node.h
70    reinplace "s|^#pragma interface||g" ${worksrcpath}/msggen.pl
71    reinplace "s|^#pragma interface||g" ${worksrcpath}/spgrove/GroveApp.h
72    reinplace "s|^CXX=.*$|CXX='${configure.cxx} [get_canonical_archflags] ${cxx_stdlibflags}'|g" ${worksrcpath}/libtool
73    reinplace "s|^CC=.*$|CC='${configure.cc} [get_canonical_archflags]'|g" ${worksrcpath}/libtool
74}
75
76destroot.target install install-man
77
78post-destroot   {
79    system "install -d -m 755 ${destroot}${prefix}/share/sgml/openjade"
80    system "install -m 644 ${worksrcpath}/dsssl/* ${destroot}${prefix}/share/sgml/openjade"
81}
82
83post-activate {
84    # Make the directory if it doesn't exist
85    if {![file exists ${prefix}/etc/sgml]} {
86        xinstall -m 755 -d ${prefix}/etc/sgml
87    }
88
89    # Create the root catalog file if it doesn't exist
90    if {![file exists ${catalog.sgml}]} {
91        system "xmlcatmgr -s -c ${catalog.sgml} create"
92    }
93
94    # Create the openjade catalog file if it doesn't exist
95    if {![file exists ${catalog.openjade}]} {
96        system "xmlcatmgr -s -c ${catalog.openjade} create"
97    }
98
99    # Add the root catalog to openjade's catalog
100    if {[catch {exec xmlcatmgr -s -c ${catalog.openjade} lookup ${catalog.sgml}}]} {
101        system "xmlcatmgr -s -c ${catalog.openjade} add CATALOG ${catalog.sgml}"
102    }
103
104    # And add openjade's catalog to the root catalog
105    if {[catch {exec xmlcatmgr -s -c ${catalog.sgml} lookup ${prefix}/share/sgml/openjade/catalog}]} {
106        system "xmlcatmgr -s -c ${catalog.sgml} add CATALOG ${prefix}/share/sgml/openjade/catalog"
107    }
108}
109
110# This will remove the catalog entry for this port.
111post-deactivate {
112    # Remove the CATALOG entry from the catalog
113    system "xmlcatmgr -s -c ${catalog.sgml} remove CATALOG ${prefix}/share/sgml/openjade/catalog"
114}
Note: See TracBrowser for help on using the repository browser.