License question

Mark Brethen mark.brethen at gmail.com
Mon Jan 2 20:05:14 PST 2012


On Jan 2, 2012, at 6:07 PM, Jeremy Lavergne wrote:

> Subports make sense iff the portfiles greatly overlap.
> 
> Mark Brethen <mark.brethen at gmail.com> wrote:
> 
>> 
>> On Jan 2, 2012, at 5:08 PM, Lawrence Velázquez wrote:
>> 
>>> On Jan 2, 2012, at 5:24 p.m., Mark Brethen wrote:
>>> 
>>>> Looking at the pure Portfile, In don't quite follow:
>>>> 
>>>> if {${name} == ${subport}} {
>>>> 
>>>> }
>>>> 
>>>> Is everything in-between the curly brackets read only if user issues
>> 'port install pure'?
>>> 
>>> Yes. Another common idiom is
>>> 
>>>> if {${name} != ${subport}} {
>>>>   <lots of stuff>
>>>> }
>>> 
>>> where the port itself is treated as a stub port that just depends on
>> one of its subports, and the meat of the port only takes effect when a
>> subport is selected. There are a couple of decent examples linked at
>> the bottom of this MacPorts wiki page:
>> https://trac.macports.org/wiki/Python
>>> 
>>> vq
>> 
>> I have a couple of choices: 1) as mentioned above, split the reduce
>> port into 2 subports: reduce-csl (which builds the csl lisp base
>> reduce) and reduce-psl (which just fetches precompiled psl lisp
>> binaries) or  2) reduce builds csl by default and a subport,
>> reduce-psl, which fetches the psl binaries. CSL has many options of its
>> own, such as building wx instead of fox. And both have the option of
>> building 32-bit instead of 64-bit.
>> 
>> Which makes the most sense?
>> 
>> Mark
>> 
>> 
>> 
>> 
>> _______________________________________________
>> macports-dev mailing list
>> macports-dev at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
> 

Here is the current portfile with variants galore. I don't know if it's a good candidate for using subports, or not. RS had suggested it because of licensing differences between csl and psl.

# -*- 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
# $Id$

PortSystem              1.0

name                    reduce
svn.revision            1535
version                 3.8.0-r${svn.revision}
categories              math
platforms               darwin
maintainers             gmail.com:mark.brethen
use_parallel_build      no
universal_variant       no
homepage                http://reduce-algebra.sourceforge.net/
fetch.type              svn
svn.url                 https://reduce-algebra.svn.sourceforge.net/svnroot/reduce-algebra/trunk
svn.method              checkout
worksrcdir              trunk

description             REDUCE Computer Algebra System

long_description        REDUCE is a system for doing scalar, vector and matrix algebra \
                        by computer, which also supports arbitrary precision numerical \
                        approximation and interfaces to gnuplot to provide graphics. \
                        It can be used interactively for simple calculations but also \
                        provides a full programming language, with a syntax similar to \
                        other modern programming languages.

depends_build           port:pkgconfig

set topdir     ${prefix}/libexec/${name}

set sharedir   ${destroot}${prefix}/share/${name}
set libexecdir ${destroot}${prefix}/libexec/${name}
set fontdir    ${destroot}${prefix}/share/${name}/fonts
set docdir     ${destroot}${prefix}/share/doc/${name}
set bindir     ${destroot}${prefix}/bin
set mandir     ${destroot}${prefix}/share/man

destroot {
# 'make install' is outdated, so manually install required files
    set builddir   [exec ${worksrcpath}/scripts/findhost.sh [exec ${worksrcpath}/config.guess]]

    set cslbuilddir ${worksrcpath}/cslbuild/${builddir}
    set pslbuilddir ${worksrcpath}/pslbuild/${builddir}

    xinstall -d ${libexecdir}/pslbuild/psl ${libexecdir}/pslbuild/red ${libexecdir}/cslbuild/csl \
        ${sharedir}/packages ${bindir} ${docdir}/manual ${fontdir} ${mandir}/man1

    if {[variant_isset csl]} {
        eval copy ${cslbuilddir}/csl/reduce.img ${libexecdir}/cslbuild/csl
        eval copy ${cslbuilddir}/csl/reduce ${libexecdir}/cslbuild/csl

        eval copy [glob ${cslbuilddir}/csl/reduce.fonts/*] ${fontdir}

        eval copy ${worksrcpath}/debianbuild/redcsl.1 ${mandir}/man1

        xinstall ${filespath}/runcsl.in ${bindir}/redcsl
        reinplace "s|@LIBEXECDIR@|${prefix}/libexec/${name}|g" ${bindir}/redcsl

        ln -s ${prefix}/share/${name}/fonts ${libexecdir}/cslbuild/csl/reduce.fonts
    }

    if {[variant_isset psl]} {
        eval copy ${pslbuilddir}/psl/* ${libexecdir}/pslbuild/psl
        eval copy ${pslbuilddir}/red/* ${libexecdir}/pslbuild/red

        eval copy ${worksrcpath}/debianbuild/redpsl.1 ${mandir}/man1

        xinstall ${filespath}/runpsl.in ${bindir}/redpsl
        reinplace "s|@LIBEXECDIR@|${prefix}/libexec/${name}|g" ${bindir}/redpsl
    }

    eval copy [glob ${worksrcpath}/packages/*] ${sharedir}/packages
    eval copy [glob ${worksrcpath}/doc/manual/*.tex] ${docdir}/manual
    eval copy [glob ${worksrcpath}/doc/manual/*.sh] ${docdir}/manual
    eval copy [glob ${worksrcpath}/doc/manual/*.cfg] ${docdir}/manual
    eval copy ${worksrcpath}/doc/manual/README ${docdir}/manual
}

default_variants +csl +html

variant csl conflicts psl description {Build Fox and CSL Lisp sources} {
    license                 LGPL-2+ BSD

    depends_lib-append      port:ncurses \
                            port:Xft2 \
                            port:xorg-libX11 \
                            port:xorg-libXext \
                            port:tiff \
                            port:libpng \
                            port:jpeg \
                            port:xorg-libXcursor \
                            port:xorg-libXrandr \
                            port:freetype \
                            port:mesa

    configure.args-append   --with-csl --with-x --with-xft --with-opengl --enable-threadsafe
}

variant psl conflicts csl description {Fetch PSL Lisp binaries} {
    license                 BSD

    configure.args-append   --with-psl

    # create a second image after all modules have been built, with the final value of 
    # loaddirectories!*. Otherwise loading a module will always search the build directories
    # in worksrcpath (which don't exist).
    post-build {
        set builddir    [exec ${worksrcpath}/scripts/findhost.sh [exec ${worksrcpath}/config.guess]]
        set pslbuilddir ${worksrcpath}/pslbuild/${builddir}

        system "cd ${pslbuilddir}; exec ${worksrcpath}/psl/saveimage.sh \
            ${pslbuilddir} ${pslbuilddir}/red ${topdir}/pslbuild"
    }
}

variant html description {Produce an HTML version of the help material} {
    depends_build-append bin:makeindex:texlive-basic
    depends_build-append bin:mk4ht:texlive-htmlxml

    post-build {
        system -W ${worksrcpath}/doc/manual "./mkhtml.sh"
    }

    post-destroot {
        eval copy [glob ${worksrcpath}/doc/manual/*.html] ${docdir}/manual
        eval copy [glob ${worksrcpath}/doc/manual/*.css] ${docdir}/manual
        if {[variant_isset csl]} {
          ln -s manual-pdf.html ${docdir}/manual/index.html
          ln -s ${prefix}/share/doc/${name}/manual ${libexecdir}/cslbuild/csl/reduce.doc
        }
    }
}

variant pdf description {Build paper copy of reference manual} {
    depends_build-append bin:makeindex:texlive-basic
    depends_build-append bin:pdflatex:texlive-basic

    post-build {
        system -W ${worksrcpath}/doc/manual "./mkpdf.sh"
    }

    post-destroot {
        xinstall -m 0644 ${worksrcpath}/doc/manual/manual-pdf.pdf ${docdir}/manual
    }
}

variant demos conflicts psl description {Install demonstration and test programs} {
    post-destroot {
        xinstall -d ${destroot}${prefix}/share/examples/${name}
        eval copy [glob ${cslbuilddir}/csl/*demo*] ${destroot}${prefix}/share/examples/${name}
    }
}

livecheck.type      none


Mark






More information about the macports-dev mailing list