Ticket #28205: Portfile

File Portfile, 2.7 KB (added by evanj@…, 13 years ago)

portfile

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 74826 2011-01-03 10:28:48Z nox@macports.org $
3
4PortSystem      1.0
5
6name            scite
7version         2.23
8categories      editors
9platforms       darwin
10maintainers     nomaintainer
11description     SciTE is a SCIntilla based Text Editor.
12
13long_description \
14    Originally built to demonstrate Scintilla, it has grown to be a generally \
15    useful editor with facilities for building and running programs. It is best \
16    used for jobs with simple configurations.
17
18homepage        http://scintilla.sourceforge.net/SciTE.html
19master_sites    sourceforge:scintilla
20distname        ${name}[strsed ${version} {g/\.//}]
21extract.suffix  .tgz
22
23depends_build   port:pkgconfig
24depends_lib     port:gtk2
25
26checksums       md5     8802f8a7f72bad2af44c3c277d57c415 \
27                sha1    8ffaee5a9eb5a0d7aec3a24ffce84bfbdb78cbe0
28
29worksrcdir      ${name}/gtk
30
31patchfiles      scite-makefile.diff
32
33use_configure   no
34
35build.args      prefix=${prefix} GTK2=yes
36
37use_parallel_build  yes
38
39pre-build {
40    if {[variant_isset universal]} {
41        set lipo_args {}
42        set sysrootflags ""
43        if {${configure.sdkroot} != ""} {
44            set sysrootflags "-isysroot ${configure.sdkroot} "
45        }
46
47        foreach arch ${configure.universal_archs} {
48            system "make -C ${workpath}/scintilla/gtk \
49                GTK2=yes UNIVERSAL_CFLAGS=\"${sysrootflags}-arch ${arch}\""
50
51            file mkdir ${workpath}/scintilla/bin/${arch}
52            move ${workpath}/scintilla/bin/scintilla.a ${workpath}/scintilla/bin/${arch}/scintilla.a
53
54            system "make -C ${workpath}/scintilla/gtk \
55                clean"
56
57            lappend lipo_args -arch ${arch} ${workpath}/scintilla/bin/${arch}/scintilla.a
58        }
59
60        system "lipo -create [join ${lipo_args}] -output ${workpath}/scintilla/bin/scintilla.a"
61    } else {
62        system "make -C ${workpath}/scintilla/gtk \
63            GTK2=yes"
64    }
65}
66
67destroot.destdir    prefix=${destroot}${prefix}
68
69post-destroot {
70    xinstall -m 444 ${worksrcpath}/../doc/scite.1 ${destroot}${prefix}/share/man/man1
71    set docdir ${prefix}/share/doc/${name}-${version}
72    xinstall -d ${destroot}${docdir}
73    xinstall -m 644 -W ${workpath}/scite License.txt README ${destroot}${docdir}
74}
75
76variant universal {
77    post-patch {
78        reinplace -E "/^CXXBASEFLAGS/s|\$| \$(UNIVERSAL_CFLAGS)|" \
79            ${workpath}/scintilla/gtk/makefile
80        reinplace -E "/^CXXBASEFLAGS/s|\$| ${configure.universal_cflags}|" \
81            ${worksrcpath}/makefile
82    }
83
84    build.args-append   "UNIVERSAL_LDFLAGS=\"${configure.universal_ldflags}\""
85}
86
87livecheck.distname  SciTE