Ticket #21471: Portfile.3

File Portfile.3, 4.3 KB (added by nerdling (Jeremy Lavergne), 15 years ago)

scribus-devel, cleaned whitespace

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id$
3
4PortSystem          1.0
5
6name                scribus-devel
7version             1.3.5.1
8categories          print
9maintainers         nomaintainer
10description         Qt4-based WYSIWYG desktop publishing application
11long_description    Scribus is an open source desktop publishing program. \
12                    It provides a true WYSIWYG editing, excellent PDF export \
13                    facilities, and a wide range of other input and output \
14                    options.
15
16platforms           darwin
17homepage            http://www.scribus.net/
18master_sites        sourceforge:scribus
19use_bzip2           yes
20
21checksums           md5     4cadca0c780491ad61dc2d815776f10b \
22                    sha1    d138e47e2177974d18c2f7c87a1db9e462bf6287 \
23                    rmd160  8b8a73909b3c482de2a77cd344e91a8aedbf2611
24
25depends_build       path:bin/pkg-config:pkgconfig \
26                    path:bin/cmake:cmake
27                                   
28depends_lib         port:qt4-mac \
29                    port:cairo \
30                    port:freetype \
31                    port:tiff \
32                    port:lcms \
33                    port:jpeg \
34                    port:libpng \
35                    port:fontconfig \
36                    port:libxml2 \
37                    port:boost \
38                    path:bin/gs:ghostscript \
39                    port:podofo
40                                   
41use_configure       no
42
43variant bundle description "Builds application bundle" {}
44variant universal description "Builds universal app" {}
45
46variant aspell {
47    depends_lib-append    port:aspell
48}
49
50configure {
51    set CMAKE_OPTIONS " "
52    append CMAKE_OPTIONS "-DCMAKE_CXX_COMPILER=${configure.cxx} "
53    append CMAKE_OPTIONS "-DCMAKE_C_COMPILER=${configure.cc} "
54    append CMAKE_OPTIONS "-DZLIB_LIBRARY_RELEASE=${prefix}/lib/libz.dylib "
55    append CMAKE_OPTIONS "-DZLIB_INCLUDE_DIR=${prefix}/include "
56    append CMAKE_OPTIONS "-DQT_ZLIB_LIBRARY=${prefix}/lib/libz.dylib "
57    append CMAKE_OPTIONS "-DWANT_CAIRO=1 "
58   
59    if {[variant_isset bundle]} {
60        append CMAKE_OPTIONS "-DAPPLEBUNDLE=TRUE "
61        append CMAKE_OPTIONS "-DBUILD_OSX_BUNDLE=1 "
62        append CMAKE_OPTIONS "-DCMAKE_INSTALL_PREFIX=${applications_dir} "
63    } else {
64        append CMAKE_OPTIONS "-DAPPLEBUNDLE=FALSE "
65        append CMAKE_OPTIONS "-DBUILD_OSX_BUNDLE=0 "
66        append CMAKE_OPTIONS "-DCMAKE_INSTALL_PREFIX=${prefix} "
67    }
68
69    if {[variant_isset universal]} {
70        set archs    "-DCMAKE_OSX_ARCHITECTURES=\""
71        foreach arch ${configure.universal_archs} {
72            append archs " " ${arch} ";"
73        }
74        append CMAKE_OPTIONS ${archs} "\" "
75       
76        append CMAKE_OPTIONS "-DCMAKE_CXX_FLAGS=\"" \
77            [portconfigure::configure_get_universal_archflags] "\" "
78   
79        append CMAKE_OPTIONS "-DCMAKE_C_FLAGS=\"" \
80            [portconfigure::configure_get_universal_archflags] "\" "
81   
82        append CMAKE_OPTIONS "-DCMAKE_EXE_LINKER_FLAGS=\"" \
83            [portconfigure::configure_get_universal_archflags] "\" "
84   
85        append CMAKE_OPTIONS "-DCMAKE_MODULE_LINKER_FLAGS=\"" \
86            [portconfigure::configure_get_universal_archflags] "\" "
87   
88        append CMAKE_OPTIONS "-DCMAKE_SHARED_LINKER_FLAGS=\"" \
89            [portconfigure::configure_get_universal_archflags] "\" "
90    }
91   
92    append CMAKE_OPTIONS "-DQT_QMAKE_EXECUTABLE=${prefix}/bin/qmake-mac "
93   
94    puts ${CMAKE_OPTIONS}
95   
96    system "cd ${worksrcpath} && cmake ${CMAKE_OPTIONS} ."
97}
98
99# Patch : why is libpodofo is wrongly referenced?
100
101post-build {
102    system "PODOFO=`otool -L ${worksrcpath}/scribus/scribus | grep libpodo | \
103            awk '{printf \$1}'`; \
104        install_name_tool -change \$PODOFO ${prefix}/lib/\$PODOFO \
105            ${worksrcpath}/scribus/scribus ; \
106        install_name_tool -change \$PODOFO ${prefix}/lib/\$PODOFO \
107            ${worksrcpath}/scribus/plugins/aiimplugin/libimportai.so ; \
108        install_name_tool -change \$PODOFO ${prefix}/lib/\$PODOFO \
109            ${worksrcpath}/scribus/plugins/psimport/libimportps.so"
110}
111
112use_parallel_build  yes
113
114livecheck.type      regex
115livecheck.url       ${homepage}
116livecheck.regex     Scribus v(\[0-9.\]+)