source: trunk/dports/gnome/gnucash/Portfile

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

gnucash: use perl 5.24 (#52392)

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