Ticket #63912: Portfile

File Portfile, 4.1 KB (added by tomio-arisaka (Tomio Arisaka), 2 years ago)

Aquaterm-1.0.1 Portfile

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=portfile:et:sw=4:ts=4:sts=4
2
3PortSystem      1.0
4
5name            aquaterm
6version         1.0.1
7revision        1
8categories      aqua math science
9maintainers     nomaintainer
10description     AquaTerm is a viewer that displays vector graphics on Mac OS X
11long_description \
12    AquaTerm is a viewer app that displays vector \
13    graphics.  Other apps connect to AquaTerm using a \
14    simple remote object messaging protocol.  By adding \
15    "adapters" to legacy code very little coding is \
16    needed to bring it to OS X.
17platforms       darwin
18homepage        http://aquaterm.sourceforge.net/
19master_sites    sourceforge
20distname        ${name}_src.${version}
21checksums \
22    rmd160  24410589dd8c3071b6e0d5e652b7d92933d86b5f \
23    sha256  5178b32ac26d5411ee29eb192329341eedc69703326588cfb777f62b45acae4f \
24    size    305818
25
26patch {
27    # Change default location of AquaTerm.app to avoid requiring the
28    # use of AQUATERM_PATH.
29    reinplace "s|AquaTerm.app|MacPorts/AquaTerm.app|g" \
30        ${workpath}/aquaterm/AQTClientManager.m
31}
32
33configure {
34    reinplace "s|/Users/per/Documents/Source/aquaterm/||" \
35        ${workpath}/${name}/AquaTerm.pbproj/project.pbxproj
36    reinplace "s|/tmp/AquaTerm.dst||" \
37        ${workpath}/${name}/AquaTerm.pbproj/project.pbxproj
38    reinplace "s|/usr/local/lib|${prefix}/lib|" \
39        ${workpath}/${name}/AquaTerm.pbproj/project.pbxproj
40    file mkdir ${workpath}/${name}/build/include
41    system "cd ${workpath}/${name} &&
42            ln -s ../.. build/include/aquaterm"
43
44    reinplace "s|/usr/local|${prefix}|g" \
45        ${workpath}/adapters/pgplot/ChangeLog \
46        ${workpath}/adapters/pgplot/g77_gcc_AQT.conf \
47        ${workpath}/adapters/pgplot/xlf_gcc_AQT.conf
48    reinplace "s|\$(HOME)|${prefix}|g" \
49        ${workpath}/adapters/c/Makefile \
50        ${workpath}/adapters/fortran/Makefile
51    reinplace "s|/*<PREFIX>|${prefix}|g" \
52        ${workpath}/adapters/pgplot/g77_cc_AQT.conf \
53        ${workpath}/adapters/pgplot/g77_gcc_AQT.conf \
54        ${workpath}/adapters/pgplot/xlf_gcc_AQT.conf
55    reinplace "s|/sw|${prefix}|g" \
56        ${workpath}/adapters/pgplot/ReadMe
57}
58
59set xcodebuilddir   build
60
61platform darwin 7 {
62    post-extract {
63        cd ${workpath}/${name}
64        file link -symbolic AquaTermFwk-Info.plist AquaTerm.framework-Info.plist
65    }
66}
67
68platform darwin 8 {
69    global  xcodebuilddir
70    set xcodebuilddir   build/Deployment
71}
72
73build.type      pbx
74build.dir       ${workpath}/${name}
75build.target    -buildstyle Deployment -target AquaTerm
76post-build {
77    system "install_name_tool -id ${prefix}/lib/libaquaterm.1.dylib \
78                ${workpath}/${name}/${xcodebuilddir}/AquaTerm.framework/Versions/A/AquaTerm"
79    system "install_name_tool -change /Library/Frameworks/AquaTerm.framework/Versions/A/AquaTerm ${prefix}/lib/libaquaterm.1.dylib \
80                ${workpath}/${name}/${xcodebuilddir}/AquaTerm.app/Contents/MacOS/AquaTerm"
81}
82
83destroot {
84    xinstall -d -m 0755 ${destroot}${applications_dir}
85    xinstall -d -m 0755 ${destroot}${prefix}/Library/Frameworks
86    xinstall -d -m 0755 ${destroot}${prefix}/include/${name}
87    xinstall -d -m 0755 ${destroot}${prefix}/share/${name}
88
89    xinstall -m 0644 -W ${workpath}/${name} AQTAdapter.h aquaterm.h \
90        ${destroot}${prefix}/include/${name}
91
92    system "cd ${workpath}/${name}/${xcodebuilddir} &&
93            ln AquaTerm.framework/Versions/A/AquaTerm libaquaterm.${version}.dylib &&
94            ln -s libaquaterm.${version}.dylib ${destroot}${prefix}/lib/libaquaterm.dylib &&
95            ln -s libaquaterm.${version}.dylib ${destroot}${prefix}/lib/libaquaterm.1.dylib"
96
97    xinstall -m 0755 ${workpath}/${name}/${xcodebuilddir}/libaquaterm.${version}.dylib \
98        ${destroot}${prefix}/lib
99    copy ${workpath}/${name}/${xcodebuilddir}/AquaTerm.app \
100        ${destroot}${applications_dir}
101    copy ${workpath}/${name}/${xcodebuilddir}/AquaTerm.framework \
102        ${destroot}${prefix}/Library/Frameworks
103
104    foreach f {c fortran gnuplot pgplot plplot} {
105        copy ${workpath}/adapters/$f ${destroot}${prefix}/share/${name}
106    }
107}