source: trunk/dports/graphics/asymptote/Portfile

Last change on this file was 148673, checked in by mojca@…, 15 months ago

asymptote: upgrade to 2.38

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
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# $Id: Portfile 148673 2016-05-14 12:01:46Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           github 1.0
6PortGroup           texlive 1.0
7
8github.setup        vectorgraphics asymptote 2.38
9categories          graphics
10maintainers         mojca openmaintainer
11description         A vector graphics language
12long_description    Asymptote is a powerful descriptive \
13                    vector graphics language that provides a natural \
14                    coordinate-based framework for technical drawing. \
15                    Labels and equations are typeset with LaTeX, for \
16                    high-quality PostScript output.
17homepage            http://asymptote.sourceforge.net
18license             LGPL-3+
19platforms           darwin
20
21checksums           rmd160  9e49b18656ad94f50a7677fd96b11e2c8adb4ae7 \
22                    sha256  a2be6a13f726f81e7904ddf8376e9c8383367c5677b8472a52b05376e78908a7
23
24post-extract {
25    reinplace "s|\\\[${version}git\\\]|\\\[${version}\\\]|" ${worksrcpath}/configure.ac
26}
27
28use_autoconf        yes
29autoconf.cmd        ./autogen.sh
30
31configure.args      --with-latex=${texlive_texmfports}/tex/latex \
32                    --with-context=${texlive_texmfports}/tex/context/third \
33                    --mandir=${prefix}/share/man \
34                    --disable-offscreen
35
36build.target        all
37
38# texlive-latex-recommended and texinfo are only used for building the docs
39# other relevant packages are:
40# - texlive-common
41# - texlive-bin
42# - texlive-basic
43# - texlive-latex
44# but they are already a dependency of latex-recommended
45#
46# one day we could split that into a separate +docs variant
47# or fetch the PDF from somewhere
48depends_build       port:autoconf \
49                    port:gawk \
50                    port:ghostscript \
51                    port:texinfo \
52                    port:texlive-latex-recommended \
53                    port:texlive-fonts-recommended
54
55depends_lib         port:readline \
56                    port:fftw-3 \
57                    port:gsl \
58                    port:libsigsegv \
59                    port:ncurses \
60                    path:lib/libgc.dylib:boehmgc
61
62# Runtime dependencies really depend on user preferences.
63# Asy can draw graphics without any TeX or without LaTeX,
64# so one might just as well remove all deps (or add more)
65#
66# The hierarchy of dependencies goes as:
67# - texlive-latex-recommended [common, bin, basic, latex]
68# - texlive-latex             [common, bin, basic]
69# - texlive-basic             [common, bin]
70#
71# But then asy also supports luatex, context, etc.
72depends_run         port:ghostscript \
73                    port:texlive-basic
74
75depends_skip_archcheck-append \
76                    port:ghostscript \
77                    port:texinfo \
78                    port:texlive-basic \
79                    port:texlive-bin \
80                    port:texlive-latex-recommended
81
82post-destroot {
83    set python.branch ""
84    if {[variant_isset python27]} {
85        set python.branch   2.7
86    } elseif {[variant_isset python34]} {
87        set python.branch   3.4
88    } elseif {[variant_isset python35]} {
89        set python.branch   3.5
90    }
91    if {${python.branch} != ""} { 
92        set python.bin      ${prefix}/bin/python${python.branch}
93        eval reinplace {"s|#!/usr/bin/env python|#!${python.bin}|"} \
94            [glob -directory ${destroot}${prefix}/share/${name}/GUI *.py]
95    } else {
96        delete ${destroot}${prefix}/bin/xasy
97    }
98}
99
100post-activate {
101    # run `mktexlsr` to make sure the asymptote files are found:
102    system "mktexlsr"
103}
104post-deactivate {
105    system "mktexlsr"
106}
107
108# asymptote's GUI needs either pyXY-pil or pyXY-Pillow
109# https://trac.macports.org/ticket/44284
110variant python27 conflicts python34 python35 description {Enable xasy GUI using Python 2.7} {
111    set python.version  27
112    set python.branch   "[string range ${python.version} 0 end-1].[string index ${python.version} end]"
113
114    depends_lib-append  port:py${python.version}-tkinter \
115                        path:${frameworks_dir}/Python.framework/Versions/${python.branch}/lib/python${python.branch}/site-packages/PIL:py${python.version}-Pillow
116}
117variant python34 conflicts python27 python35 description {Enable xasy GUI using Python 3.4} {
118    set python.version  34
119    set python.branch   "[string range ${python.version} 0 end-1].[string index ${python.version} end]"
120
121    depends_lib-append  port:py${python.version}-tkinter \
122                        path:${frameworks_dir}/Python.framework/Versions/${python.branch}/lib/python${python.branch}/site-packages/PIL:py${python.version}-Pillow
123}
124variant python35 conflicts python27 python34 description {Enable xasy GUI using Python 3.5} {
125    set python.version  35
126    set python.branch   "[string range ${python.version} 0 end-1].[string index ${python.version} end]"
127
128    depends_lib-append  port:py${python.version}-tkinter \
129                        path:${frameworks_dir}/Python.framework/Versions/${python.branch}/lib/python${python.branch}/site-packages/PIL:py${python.version}-Pillow
130}
131
132if {![variant_isset python27] && ![variant_isset python34]} {
133    default_variants +python35
134}
135
136livecheck.regex     {archive/([0-9.]+).tar.gz}
Note: See TracBrowser for help on using the repository browser.