| 1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | PortSystem 1.0 |
|---|
| 5 | |
|---|
| 6 | name reduce |
|---|
| 7 | version 20180920 |
|---|
| 8 | |
|---|
| 9 | set version_dashes [regsub {^(\d{4})(\d{2})(\d{2})$} ${version} {\1-\2-\3}] |
|---|
| 10 | set svnrev 4765 |
|---|
| 11 | |
|---|
| 12 | categories math |
|---|
| 13 | license BINARY BSD-2 LGPL-2.1 |
|---|
| 14 | platforms darwin |
|---|
| 15 | maintainers gmail.com:mark.brethen openmaintainer |
|---|
| 16 | |
|---|
| 17 | description REDUCE Computer Algebra System |
|---|
| 18 | |
|---|
| 19 | long_description REDUCE is a graphical Computer Algebra System. It\ |
|---|
| 20 | allows for solving differential equations, integration,\ |
|---|
| 21 | matrix manipulation and 3D plotting. It also contains a\ |
|---|
| 22 | large number of additional packages. |
|---|
| 23 | |
|---|
| 24 | homepage https://reduce-algebra.sourceforge.io/ |
|---|
| 25 | master_sites sourceforge:project/reduce-algebra/snapshot_${version_dashes} |
|---|
| 26 | distname Reduce-svn${svnrev}-src |
|---|
| 27 | |
|---|
| 28 | checksums rmd160 d547b19362af6e4ca31e52f718bdcdbf0cd0e063 \ |
|---|
| 29 | sha256 58873b4337e3bb31bb561cbea53866dc60bcfa7ea5faed4297597bfb85483a2e \ |
|---|
| 30 | size 261850189 |
|---|
| 31 | |
|---|
| 32 | pre-fetch { |
|---|
| 33 | if {${os.major} < 13} { |
|---|
| 34 | ui_error "${name} is only supported on OS X 10.9 Mavericks or later." |
|---|
| 35 | return -code error "unsupported platform version" |
|---|
| 36 | } |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | universal_variant no |
|---|
| 40 | |
|---|
| 41 | if {${name} eq ${subport}} { |
|---|
| 42 | patchfiles-append patch-packages-plot-gnuintfc.red.diff \ |
|---|
| 43 | patch-csl-cslbase-create_bundle.sh.diff \ |
|---|
| 44 | patch-csl-cslbase-create_old_bundle.sh.diff |
|---|
| 45 | |
|---|
| 46 | post-patch { |
|---|
| 47 | reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/packages/plot/gnuintfc.red |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | use_parallel_build no |
|---|
| 51 | |
|---|
| 52 | depends_lib-append port:libedit \ |
|---|
| 53 | port:libtool \ |
|---|
| 54 | port:xorg-libXcursor \ |
|---|
| 55 | port:Xft2 \ |
|---|
| 56 | port:xorg-libXrandr \ |
|---|
| 57 | port:fontconfig \ |
|---|
| 58 | port:freetype \ |
|---|
| 59 | port:ncurses |
|---|
| 60 | |
|---|
| 61 | depends_build-append \ |
|---|
| 62 | port:automake \ |
|---|
| 63 | port:autoconf \ |
|---|
| 64 | port:netpbm |
|---|
| 65 | |
|---|
| 66 | configure.args-append --with-csl |
|---|
| 67 | configure.ldflags-append "-lintl" |
|---|
| 68 | |
|---|
| 69 | # Technically portconfigure::configure_main is not part of the official exposed |
|---|
| 70 | # MacPorts API, so theoretically it could change in the future and the port |
|---|
| 71 | # would break... but it should work for now. |
|---|
| 72 | post-configure { |
|---|
| 73 | configure.args-replace --with-csl --with-psl |
|---|
| 74 | portconfigure::configure_main |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | # Documentation is also re-generated in the tree so that regardless of |
|---|
| 78 | # history it should end up clean and organized. |
|---|
| 79 | post-build { |
|---|
| 80 | if {[variant_isset doc]} { |
|---|
| 81 | system -W ${worksrcpath}/doc/misc ${build.cmd} |
|---|
| 82 | system -W ${worksrcpath}/doc/manual ${build.cmd} |
|---|
| 83 | } |
|---|
| 84 | } |
|---|
| 85 | |
|---|
| 86 | depends_run port:gnuplot |
|---|
| 87 | |
|---|
| 88 | destroot { |
|---|
| 89 | set builddir [exec ${worksrcpath}/scripts/findhost.sh [exec ${worksrcpath}/config.guess]] |
|---|
| 90 | |
|---|
| 91 | set cslbuilddir ${worksrcpath}/cslbuild/${builddir} |
|---|
| 92 | set pslbuilddir ${worksrcpath}/pslbuild/${builddir} |
|---|
| 93 | |
|---|
| 94 | set genericdir ${worksrcpath}/generic |
|---|
| 95 | |
|---|
| 96 | set sharedir ${prefix}/share/${subport} |
|---|
| 97 | set libexecdir ${prefix}/libexec/${subport} |
|---|
| 98 | set bindir ${prefix}/bin |
|---|
| 99 | set mandir ${prefix}/share/man/man1 |
|---|
| 100 | |
|---|
| 101 | # Create target directories |
|---|
| 102 | xinstall -d \ |
|---|
| 103 | ${destroot}${sharedir} \ |
|---|
| 104 | ${destroot}${libexecdir}/csl \ |
|---|
| 105 | ${destroot}${libexecdir}/psl/psl \ |
|---|
| 106 | ${destroot}${libexecdir}/psl/red \ |
|---|
| 107 | ${destroot}${applications_dir}/${subport} |
|---|
| 108 | # Manual files |
|---|
| 109 | copy \ |
|---|
| 110 | ${filespath}/redcsl.1 \ |
|---|
| 111 | ${filespath}/redpsl.1 \ |
|---|
| 112 | ${genericdir}/newfront/redfront.1 \ |
|---|
| 113 | ${destroot}${mandir} |
|---|
| 114 | ln -s ${prefix}/share/man/man1/redfront.1 ${destroot}${mandir}/rfcsl.1 |
|---|
| 115 | ln -s ${prefix}/share/man/man1/redfront.1 ${destroot}${mandir}/rfpsl.1 |
|---|
| 116 | # CSL files |
|---|
| 117 | foreach d {reduce bootstrapreduce csl} { |
|---|
| 118 | copy ${cslbuilddir}/csl/${d}.app ${destroot}${libexecdir}/csl |
|---|
| 119 | ln -s ${prefix}/libexec/${subport}/csl/${d}.app \ |
|---|
| 120 | ${destroot}${applications_dir}/${subport}/${d}.app |
|---|
| 121 | } |
|---|
| 122 | copy ${filespath}/runcsl.sh ${destroot}${bindir}/redcsl |
|---|
| 123 | copy ${filespath}/runbootstrapreduce.sh ${destroot}${bindir}/bootstrapreduce |
|---|
| 124 | copy ${filespath}/runcsllisp.sh ${destroot}${bindir}/csl |
|---|
| 125 | foreach f {redcsl bootstrapreduce csl} { |
|---|
| 126 | file attributes ${destroot}${bindir}/${f} -permissions +x |
|---|
| 127 | } |
|---|
| 128 | copy ${cslbuilddir}/redfront/rfcsl ${destroot}${bindir} |
|---|
| 129 | # PSL files |
|---|
| 130 | copy {*}[glob ${pslbuilddir}/psl/*] ${destroot}${libexecdir}/psl/psl |
|---|
| 131 | copy {*}[glob ${pslbuilddir}/red/*] ${destroot}${libexecdir}/psl/red |
|---|
| 132 | copy ${filespath}/runpsl.sh ${destroot}${bindir}/redpsl |
|---|
| 133 | file attributes ${destroot}${bindir}/redpsl -permissions +x |
|---|
| 134 | # Note (ha ha) that rfpsl is built in the cslbuild part of the tree. |
|---|
| 135 | copy ${cslbuilddir}/redfront/rfpsl ${destroot}${bindir} |
|---|
| 136 | } |
|---|
| 137 | |
|---|
| 138 | # Install licenses and (if +doc) documentation |
|---|
| 139 | post-destroot { |
|---|
| 140 | set docsrcdir ${worksrcpath}/doc/manual |
|---|
| 141 | set docmiscdir ${worksrcpath}/doc/misc |
|---|
| 142 | |
|---|
| 143 | set docbasename manual |
|---|
| 144 | set extradocimagebasenames {bild cmsy10 gnuplotex turtleeg} |
|---|
| 145 | |
|---|
| 146 | set docdir ${prefix}/share/doc/${subport} |
|---|
| 147 | xinstall -d ${destroot}${docdir}/html ${destroot}${docdir}/pdf |
|---|
| 148 | xinstall -m 0644 -W ${worksrcpath}/csl/reduce.doc \ |
|---|
| 149 | BINARY-LICENSE.txt \ |
|---|
| 150 | BSD-LICENSE.txt \ |
|---|
| 151 | LGPL-2.1.txt \ |
|---|
| 152 | ${destroot}${docdir} |
|---|
| 153 | |
|---|
| 154 | # Install documentation if requested |
|---|
| 155 | if {[variant_isset doc]} { |
|---|
| 156 | copy \ |
|---|
| 157 | {*}[glob ${docmiscdir}/*.pdf] \ |
|---|
| 158 | ${docsrcdir}/${docbasename}.pdf \ |
|---|
| 159 | ${destroot}${docdir}/pdf |
|---|
| 160 | copy \ |
|---|
| 161 | ${docsrcdir}/redlogo.png \ |
|---|
| 162 | {*}[glob ${docsrcdir}/${docbasename}*.html] \ |
|---|
| 163 | {*}[glob ${docsrcdir}/${docbasename}*.png] \ |
|---|
| 164 | ${docsrcdir}/${docbasename}.css \ |
|---|
| 165 | ${docsrcdir}/index.html \ |
|---|
| 166 | ${destroot}${docdir}/html |
|---|
| 167 | foreach n ${extradocimagebasenames} { |
|---|
| 168 | copy {*}[glob ${docsrcdir}/${n}*.png] ${destroot}${docdir}/html |
|---|
| 169 | } |
|---|
| 170 | } |
|---|
| 171 | } |
|---|
| 172 | |
|---|
| 173 | variant doc description {Install HTML and PDF documentation} { |
|---|
| 174 | depends_build-append \ |
|---|
| 175 | port:dvipng \ |
|---|
| 176 | port:texlive-fonts-extra \ |
|---|
| 177 | port:texlive-formats-extra \ |
|---|
| 178 | port:texlive-latex-extra \ |
|---|
| 179 | port:texlive-plain-generic \ |
|---|
| 180 | port:texlive-bin-extra \ |
|---|
| 181 | port:texlive-fonts-recommended |
|---|
| 182 | } |
|---|
| 183 | |
|---|
| 184 | livecheck.version ${version_dashes} |
|---|
| 185 | livecheck.url https://sourceforge.net/projects/reduce-algebra/files/ |
|---|
| 186 | livecheck.regex {snapshot_(\d{4}-\d{2}-\d{2})} |
|---|
| 187 | } else { |
|---|
| 188 | livecheck.type none |
|---|
| 189 | } |
|---|
| 190 | |
|---|
| 191 | subport breduce { |
|---|
| 192 | license BSD-2 |
|---|
| 193 | description A REDUCE batch processing utility. |
|---|
| 194 | long_description ${description} |
|---|
| 195 | |
|---|
| 196 | patchfiles-append patch-generic-breduce-breduce.1.diff |
|---|
| 197 | |
|---|
| 198 | post-patch { |
|---|
| 199 | reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/generic/breduce/breduce.1 |
|---|
| 200 | } |
|---|
| 201 | |
|---|
| 202 | configure {} |
|---|
| 203 | |
|---|
| 204 | build {} |
|---|
| 205 | |
|---|
| 206 | depends_run path:bin/latex:texlive \ |
|---|
| 207 | port:reduce |
|---|
| 208 | |
|---|
| 209 | destroot { |
|---|
| 210 | set libexecdir ${prefix}/libexec/${subport} |
|---|
| 211 | set mandir ${prefix}/share/man/man1 |
|---|
| 212 | xinstall -d ${destroot}/${libexecdir} |
|---|
| 213 | copy ${worksrcpath}/generic/breduce/breduce ${destroot}/${libexecdir} |
|---|
| 214 | copy ${worksrcpath}/packages/breduce/breduce.red ${destroot}/${libexecdir} |
|---|
| 215 | ln -s ${prefix}/libexec/breduce/breduce ${destroot}${prefix}/bin/breduce |
|---|
| 216 | copy ${worksrcpath}/generic/breduce/breduce.1 ${destroot}/${mandir} |
|---|
| 217 | } |
|---|
| 218 | |
|---|
| 219 | post-destroot { |
|---|
| 220 | set docdir ${prefix}/share/doc/${subport} |
|---|
| 221 | xinstall -d ${destroot}${docdir} |
|---|
| 222 | xinstall -m 0644 -W ${worksrcpath}/generic/breduce \ |
|---|
| 223 | breduce.bbl \ |
|---|
| 224 | breduce.pdf \ |
|---|
| 225 | breduce.tex \ |
|---|
| 226 | ${destroot}${docdir} |
|---|
| 227 | } |
|---|
| 228 | } |
|---|