Ticket #44526: Portfile

File Portfile, 3.2 KB (added by RJVB (René Bertin), 10 years ago)
Line 
1# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 103303 2013-02-21 06:52:40Z jmr@macports.org $
3
4PortSystem          1.0
5
6name                xxdiff
7version             4.0
8categories          devel
9license             GPL-2+
10platforms           darwin
11maintainers         nomaintainer
12description         xxdiff is a graphical merging tool
13long_description    xxdiff is a graphical browser for viewing the \
14                    differences between two or three files, or between two \
15                    directories, and can be used to produce a merged version.
16
17homepage            http://furius.ca/xxdiff/
18
19fetch.type          hg
20hg.url              https://bitbucket.org/blais/xxdiff
21hg.tag              b193168bad98
22
23depends_lib         port:bison \
24                    port:flex
25
26patchfiles-append   add-accelerators.patch
27
28subport ${name}-qt5 {}
29
30if {${subport} ne "${name}-qt5"} {
31    PortGroup                   qt4 1.0
32    patchfiles-append   patch-xxdiffpro.diff
33    conflicts           "${name}-qt5"
34} else {
35    PortGroup                   qt5 1.0
36    patchfiles-append   qt5/patch-xxdiffpro.diff \
37                        qt5/patch-cmdline.diff \
38                        qt5/patch-use-qt5.diff \
39                        qt5/patch-restore-style.diff
40    conflicts           ${name}
41    post-configure {
42        # remove the stubs created in the pre-configure phase
43        file delete ${configure.dir}/resParser_lex.cpp ${configure.dir}/resParser_lex.h
44        file delete ${configure.dir}/resParser_yacc.cpp ${configure.dir}/resParser_yacc.h
45    }
46}
47
48post-patch {
49    reinplace "s|@@QT_INCLUDES_DIR@@|${qt_includes_dir}|g" ${worksrcpath}/src/xxdiff.pro
50}
51
52patchfiles-append   patch-Makefiles.diff
53configure.dir       ${workpath}/build
54configure.cmd       make
55configure.pre_args  -f ${worksrcpath}/src/Makefile.bootstrap QMAKE=${qt_qmake_cmd} MAKEDIR=${worksrcpath}/src
56build.dir           ${configure.dir}
57#use_parallel_build  no
58
59pre-configure {
60    file mkdir ${configure.dir}
61    if {${subport} eq "${name}-qt5"} {
62        # this seems to be necessary to ensure both parsers will be generated before their headerfiles are required
63        system "touch ${configure.dir}/resParser_lex.cpp ${configure.dir}/resParser_lex.h"
64        system "touch ${configure.dir}/resParser_yacc.cpp ${configure.dir}/resParser_yacc.h"
65    }
66}
67
68destroot {
69    # Destroot xxdiff.
70    xinstall -d ${destroot}${qt_apps_dir}
71    copy "${build.dir}/bin/xxdiff.app"   ${destroot}${qt_apps_dir}/
72    xinstall ${worksrcpath}/src/xxdiff.1 ${destroot}${prefix}/share/man/man1
73    xinstall ${filespath}/xxdiff.sh ${destroot}${prefix}/bin/xxdiff
74    reinplace "s|@@QT_APPS_DIR@@|${qt_apps_dir}|g" ${destroot}${prefix}/bin/xxdiff
75}
76
77variant doc description {Install documentation} {}
78if { [variant_isset doc] } {
79    # Destroot xxdiff documentation.
80    post-destroot {
81        xinstall -d ${destroot}${prefix}/share/doc
82        copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
83        delete ${destroot}${prefix}/share/doc/${name}/Makefile
84        delete ${destroot}${prefix}/share/doc/${name}/xxdiff-scripts.txt
85        delete ${destroot}${prefix}/share/doc/${name}/xxdiff-scripts.html
86    }
87}
88