source: trunk/dports/gnome/gnucash-devel/Portfile

Last change on this file was 153756, checked in by dports@…, 10 months ago

gnucash-devel: use perl 5.24 (#52392)
[merge r153755 from gnucash port]

File size: 6.6 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 153756 2016-10-10 03:21:40Z ryandesign@macports.org $
3
4PortSystem        1.0
5PortGroup         perl5 1.0
6
7name              gnucash-devel
8conflicts         gnucash
9set my_name       gnucash
10version           2.6.14
11revision          2
12perl5.branches    5.24
13categories        gnome x11
14license           GPL-2+
15maintainers       dports openmaintainer
16platforms         darwin
17
18set branch        [join [lrange [split ${version} .] 0 1] .]
19
20description       a personal and small-business financial-accounting software
21
22long_description  GnuCash is a personal and small-business \
23                  financial-accounting software. -- gnucash-devel \
24                  installs a version from the development (unstable) \
25                  branch.  It cannot be installed along the regular \
26                  (stable) version.  If you want to try it, it is \
27                  recommended that you `port deactivate gnucash', then \
28                  `port install gnucash-devel', so that you can go \
29                  back to a working copy in case anything goes wrong.
30homepage          http://www.gnucash.org/
31master_sites      sourceforge:${my_name} \
32                  http://www.gnucash.org/pub/gnucash/sources/unstable/${branch}.x/
33
34dist_subdir       ${my_name}
35distname          ${my_name}-${version}
36use_bzip2         yes
37
38checksums           rmd160  3e7eb1da511efe7b1a91224d1ca2a53b3fd42052 \
39                    sha256  3b144f2ca5025df5eb1977b11e6f93208f3e90d840285ae952fa9b3da8158e75
40
41# We'll install gnucash's libraries in a separate subdir of
42# ${prefix}/lib, because gnucash sets DYLD_LIBRARY_PATH at runtime in
43# order to dynamically load these directories, and including all
44# MacPorts libraries in DYLD_LIBRARY_PATH can cause problems.
45# guile18 modules are also installed in a separate subdirectory.
46# See https://trac.macports.org/ticket/52494.
47set gnclibdir     ${prefix}/lib/gnucash
48
49patchfiles        patch-configure.ac.diff \
50                  patch-src_bin_environment.in.diff \
51                  patch-src_core-utils_gnc-path.c.diff
52
53post-patch {
54    reinplace "s|@@GUILEPATH@@|${prefix}/lib/guile18|" ${worksrcpath}/src/bin/environment.in
55    reinplace "s|@@LIBDIR@@|${gnclibdir}|" ${worksrcpath}/src/bin/environment.in
56    reinplace "s|@@LIBDIR@@|${gnclibdir}|" ${worksrcpath}/src/core-utils/gnc-path.c
57   
58    # gnc-fq-dump needs to be patched to use MacPorts perl.
59    # (autoconf takes care of the other perl scripts.)
60    reinplace "s|^#!/usr/bin/perl|#!${perl5.bin}|" ${worksrcpath}/src/quotes/gnc-fq-dump
61
62    # patch source files to include guile18 header instead of guile.
63    # (Note that gnucash's autoconf scripts prefer guile18 over guile
64    # if both are installed.)
65    fs-traverse f ${worksrcpath} {
66        if [regexp {\.[ch]$} ${f}] {
67            reinplace -locale C "s|<libguile\\.h>|<libguile18.h>|g" ${f}
68            reinplace -locale C "s|<libguile/|<libguile18/|g" ${f}
69        }
70    }
71}
72
73depends_build     port:pkgconfig \
74                  port:intltool \
75                  port:autoconf \
76                  port:automake \
77                  port:libtool
78
79depends_lib       port:guile18 \
80                  port:libgnomeui \
81                  path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk \
82                  port:goffice08 \
83                  port:p${perl5.major}-datemanip \
84                  port:p${perl5.major}-finance-quote
85
86# yelp currently requires X11 to build so disable dependency if building
87# with +quartz
88#
89# TODO: add +x11 +quartz variants to distinguish one build from the other
90# since they have different binary dependencies.  Otherwise, rev-upgrade
91# errors may occur
92
93if {![variant_isset quartz]} {
94    depends_run port:yelp
95}
96
97platform darwin {
98    if {${configure.cxx_stdlib} eq "libstdc++"} {
99       depends_lib-delete path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk
100       depends_lib-append path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk-2.0
101    }
102}
103
104# aqbanking is not universal
105universal_variant no
106
107# reconfigure using upstream autogen.sh for intltool 0.51 compatibility
108
109post-patch {
110    xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
111    system "cd ${worksrcpath} && ./autogen.sh"
112    if {[variant_isset python27]} {
113        # Fix python exec_prefix
114        reinplace "s|\\(PYTHON_EXEC_PREFIX=\\).*$|\\1${frameworks_dir}/Python.framework/Versions/2.7/|" \
115            ${worksrcpath}/configure
116        reinplace "s|\\(PYTHON_PREFIX=\\).*$|\\1${frameworks_dir}/Python.framework/Versions/2.7/|" \
117            ${worksrcpath}/configure
118    }
119}
120
121configure.args    --disable-dependency-tracking \
122                  --disable-aqbanking \
123                  --disable-ofx \
124                  --disable-dbi \
125                  --with-html-engine=webkit
126
127configure.args-append   --libdir=${gnclibdir}
128
129configure.perl    ${perl5.bin}
130configure.env \
131    GUILE=${prefix}/bin/guile18 \
132    GUILE_CONFIG=${prefix}/bin/guile18-config \
133    GUILE_TOOLS=${prefix}/bin/guile18-tools
134
135variant hbci description {AqBanking/HBCI support} {
136    depends_lib-append  path:lib/libaqbanking.dylib:aqbanking5-gtk
137    configure.args-delete   --disable-aqbanking
138    configure.args-append   --enable-aqbanking
139}
140
141variant ofx description {OFX support} {
142    depends_lib-append  port:libofx
143    configure.args-delete   --disable-ofx
144    configure.args-append   --enable-ofx
145}
146
147variant dbi description {Adds dbi backend support} {
148    depends_lib-append  port:libdbi \
149                        port:libdbi-drivers
150    configure.args-delete --disable-dbi
151    configure.args-append --enable-dbi
152    configure.args-append --with-dbi-dbd-dir=${prefix}/lib/dbd
153    notes-append "gnucash DBI backend support requires the libdbi-drivers port to be built with support for the desired databases. sqlite3 is available by default; for MySQL or PostgreSQL support, ensure that the corresponding variant is selected for libdbi-drivers."
154}
155
156default_variants +ofx +hbci
157
158variant python27 description {Install Python bindings for Python 2.7} { 
159    depends_lib-append  port:python27
160    set python_bindir ${frameworks_dir}/Python.framework/Versions/2.7/bin/ 
161    configure.args-append --enable-python \
162                          PYTHON_EXTRA_LDFLAGS=\"\`${python_bindir}/python2.7-config --ldflags\`\" \
163                          PYTHON_CPPFLAGS=\"\`${python_bindir}/python2.7-config --cflags\`\"
164    configure.python    ${python_bindir}/python2.7
165}
166
167post-activate {
168    system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/hicolor"
169    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
170}
171
172livecheck.regex "/${my_name} .*/(\[0-9\]+\\.\[0-9\]*\[0-9\]\\.\[0-9\]+)/"
Note: See TracBrowser for help on using the repository browser.