47 | | configure.args --with-libiconv-prefix='${prefix}' \ |
48 | | --disable-stats \ |
49 | | --enable-gui=no |
50 | | |
51 | | variant gui { |
52 | | depends_lib-append lib:libqt-mt.3:qt3 \ |
53 | | lib:libX11.6:XFree86 |
54 | | configure.env-append QTDIR='${prefix}' |
55 | | configure.args-delete --enable-gui=no |
56 | | configure.args-append --enable-gui \ |
57 | | --with-qt-dir='${prefix}' \ |
58 | | --with-qt-includes='${prefix}/include/qt3' \ |
59 | | --with-qt-libraries='${prefix}/lib' \ |
60 | | --with-extra-includes='/usr/X11R6/include' \ |
61 | | --with-extra-libs='/usr/X11R6/lib' |
| 40 | platform darwin 6 { |
| 41 | depends_lib-append lib:libdl:dlcompat |
64 | | post-destroot { |
65 | | file mkdir ${destroot}${share_path} |
66 | | system "install -m 644 ${portpath}/${filesdir}/*.template \ |
67 | | ${destroot}${share_path}" |
68 | | reinplace "s|DarwinPortsDirectory|${prefix}|g" \ |
69 | | "${destroot}${share_path}/postgresql.driver.template" |
| 44 | variant darwin { |
| 45 | patchfiles-append patch-configure patch-SQLManageDataSources.c |
| 46 | global _cc _ccr _psq1 _psq2 _nn _odbc _ex1 _ex2 |
| 47 | set _cc "/usr/bin/gcc -bundle -flat_namespace -undefined suppress -o" |
| 48 | set _ccr libodbccr.1.0.0 |
| 49 | set _psq1 libodbcpsql.1.0.0 |
| 50 | set _psq2 libodbcpsql.2.0.0 |
| 51 | set _nn libnn.1.0.0 |
| 52 | set _odbc libodbc.1.0.0 |
| 53 | } |
74 | | # Install Documentation |
75 | | file mkdir ${doc_dest} |
76 | | system "cd ${worksrcpath}/doc && \ |
77 | | tar -cf - * | tar -xf - -C ${doc_dest}" |
78 | | system "find ${doc_dest} -name 'Makefile*' | xargs rm" |
79 | | system "chown -R `id -u`:`id -g` ${doc_dest}" |
80 | | |
81 | | # Create Mach-O bundles |
82 | | # |
83 | | # Cursor Lib - The cursor lib needs a manual stage build to create it as a OSX bundle |
84 | | # it needs to be like that so the DM can load it at run time. |
85 | | system "cd ${worksrcpath}/cur && \ |
86 | | /usr/bin/cc -bundle -flat_namespace -undefined suppress -o libodbccr.1.0.0.so *.lo && \ |
87 | | rm ${destroot}${prefix}/lib/libodbccr.1.0.0.so && \ |
88 | | install -m 755 libodbccr.1.0.0.so ${destroot}${prefix}/lib" |
89 | | # |
90 | | # ODBC Lib |
91 | | system "cd ${worksrcpath}/DriverManager && \ |
92 | | /usr/bin/cc -bundle -flat_namespace -undefined suppress -o libodbc.1.0.0.so \ |
93 | | .libs/libodbc.1.0.0.dylib && \ |
94 | | install -m 755 libodbc.1.0.0.so ${destroot}${prefix}/lib && \ |
95 | | cd ${destroot}${prefix}/lib && \ |
96 | | ln -s libodbc.1.0.0.so libodbc.1.so && \ |
97 | | ln -s libodbc.1.0.0.so libodbc.so" |
98 | | # |
99 | | # Postgre7.1 Lib |
100 | | system "cd ${worksrcpath}/Drivers/Postgre7.1 && \ |
101 | | /usr/bin/cc -bundle -flat_namespace -undefined suppress -o libodbcpsql.2.0.0.so *.lo && \ |
102 | | rm ${destroot}${prefix}/lib/libodbcpsql.2.0.0.so && \ |
103 | | install -m 755 libodbcpsql.2.0.0.so ${destroot}${prefix}/lib" |
104 | | # |
105 | | # PostgreSQL Lib |
106 | | system "cd ${worksrcpath}/Drivers/PostgreSQL && \ |
107 | | /usr/bin/cc -bundle -flat_namespace -undefined suppress -o libodbcpsql.1.0.0.so *.lo && \ |
108 | | rm ${destroot}${prefix}/lib/libodbcpsql.1.0.0.so && \ |
109 | | install -m 755 libodbcpsql.1.0.0.so ${destroot}${prefix}/lib" |
110 | | # |
111 | | # NNTP Lib |
112 | | system "cd ${worksrcpath}/Drivers/nn && \ |
113 | | /usr/bin/cc -bundle -flat_namespace -undefined suppress -o libnn.1.0.0.so *.lo && \ |
114 | | rm ${destroot}${prefix}/lib/libnn.1.0.0.so && \ |
115 | | install -m 755 libnn.1.0.0.so ${destroot}${prefix}/lib" |
| 60 | variant gui { |
| 61 | depends_lib-append lib:libqt-mt.3:qt3 lib:libX11.6:XFree86 |
| 62 | configure.env-append QTDIR=${prefix} |
| 63 | configure.args-delete --enable-gui=no |
| 64 | configure.args-append --enable-gui \ |
| 65 | --with-qt-dir=${prefix} \ |
| 66 | --with-qt-includes=${prefix}/include/qt3 \ |
| 67 | --with-qt-libraries=${prefix}/lib \ |
| 68 | --with-qt-bin=${prefix}/bin |
| 69 | --with-extra-includes=/usr/X11R6/include \ |
| 70 | --with-extra-libs=/usr/X11R6/lib |
118 | | post-install { |
119 | | system "${prefix}/bin/odbcinst -i -d -f \ |
120 | | ${share_path}/postgresql.driver.template" |
121 | | system "${prefix}/bin/odbcinst -i -s -f \ |
122 | | ${share_path}/postgresql.data.template" |
| 73 | post-destroot { |
| 74 | # darwin Mach-O bundles |
| 75 | if { [variant_isset darwin] } { |
| 76 | system "cd ${worksrcpath}/DriverManager && \ |
| 77 | ${_cc} ${_odbc}.so .libs/libodbc.1.0.0.dylib && \ |
| 78 | ln -fs ${_odbc}.so ${destroot}${prefix}/lib/libodbc.1.so && \ |
| 79 | ln -fs ${_odbc}.so ${destroot}${prefix}/lib/libodbc.so" |
| 80 | system "cd ${worksrcpath}/cur && ${_cc} ${_ccr}.so *.o" |
| 81 | system "cd ${worksrcpath}/Drivers/PostgreSQL && ${_cc} ${_psq1}.so *.o" |
| 82 | system "cd ${worksrcpath}/Drivers/Postgre7.1 && ${_cc} ${_psq2}.so *.o" |
| 83 | system "cd ${worksrcpath}/Drivers/nn && ${_cc} ${_nn}.so *.o" |
| 84 | foreach lib [list ${_ccr} ${_psq1} ${_psq2} ${_nn}] { |
| 85 | system "mv ${destroot}${prefix}/lib/$lib.so ${destroot}${prefix}/lib/$lib.dylib" |
| 86 | } |
| 87 | foreach new [list cur/${_ccr} DriverManager/${_odbc} Drivers/PostgreSQL/${_psq1} Drivers/Postgre7.1/${_psq2} Drivers/nn/${_nn}] { |
| 88 | xinstall -m 0755 ${worksrcpath}/$new.so ${destroot}${prefix}/lib |
| 89 | } |
| 90 | } |
| 91 | # DOCS |
| 92 | xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name} |
| 93 | foreach doc [glob ${worksrcpath}/\[A-Z\]*\[A-Z\]\[A-Z\]\[A-Z\] ${worksrcpath}/doc/*.\[a-z\]\[a-z\]\[a-z\]*] { |
| 94 | if {[string match "*.html" $doc]} { |
| 95 | reinplace "s|${homepage}doc/||g" $doc |
| 96 | } |
| 97 | xinstall -m 0644 $doc ${destroot}${prefix}/share/doc/${name} |
| 98 | } |
| 99 | foreach dir [list AdministratorManual lst ProgrammerManual ProgrammerManual/Tutorial UserManual] { |
| 100 | xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/$dir |
| 101 | foreach file [glob ${worksrcpath}/doc/$dir/*.\[a-z\]\[a-z\]\[a-z\]*] { |
| 102 | if {[string match "*.html" $file]} { |
| 103 | reinplace "s|${homepage}doc/||g" $file |
| 104 | } |
| 105 | xinstall -m 0644 $file ${destroot}${prefix}/share/doc/${name}/$dir |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | # TEMPLATES |
| 110 | xinstall -d -m 0755 ${destroot}${prefix}/share/${name} |
| 111 | foreach template [glob ${portpath}/${filesdir}/*.template] { |
| 112 | xinstall -m 0644 $template ${destroot}${prefix}/share/${name} |
| 113 | } |
| 114 | foreach driver [glob ${destroot}${prefix}/share/${name}/*.driver.*] { |
| 115 | reinplace "s|_DP_PREFIX|${prefix}|g" $driver |
| 116 | } |
| 117 | |
| 118 | # CONFIG |
| 119 | foreach ini [glob ${destroot}${prefix}/etc/*.ini] { |
| 120 | system "mv $ini $ini.dist" |
| 121 | } |
| 122 | destroot.keepdirs ${destroot}${prefix}/etc/ODBCDataSources |