On Feb 25, 2013, at 17:10, [email protected] wrote:

> Revision: 103436
>          https://trac.macports.org/changeset/103436
> Author:   [email protected]
> Date:     2013-02-25 15:10:27 -0800 (Mon, 25 Feb 2013)
> Log Message:
> -----------
> new port: libCUDF, a library to read, write and verify the Common 
> Upgradeability Description Format
> 
> Added Paths:
> -----------
>    trunk/dports/devel/libCUDF/
>    trunk/dports/devel/libCUDF/Portfile
> 
> Added: trunk/dports/devel/libCUDF/Portfile
> ===================================================================
> --- trunk/dports/devel/libCUDF/Portfile                               (rev 0)
> +++ trunk/dports/devel/libCUDF/Portfile       2013-02-25 23:10:27 UTC (rev 
> 103436)
> @@ -0,0 +1,78 @@
> +# -*- 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                libCUDF
> +version             0.6.3
> +categories          devel ml
> +platforms           darwin
> +maintainers         gwmail.gwu.edu:egall openmaintainer
> +license             LGPL-3+
> +homepage            http://www.mancoosi.org/cudf/
> +
> +description         ${name} is a library to manipulate so called CUDF 
> documents.
> +
> +long_description    ${description} A CUDF \
> +                    (Common Upgradeability Description Format) document 
> describes an \
> +                    \"upgrade scenario\", as faced by package managers in 
> popular \
> +                    package-based FOSS (Free and Open Source Software) 
> distributions.
> +
> +master_sites        https://gforge.inria.fr/frs/download.php/31910/
> +
> +checksums           rmd160  be614de4b8a0de525619251fd61d241160fde1e9 \
> +                    sha256  
> 6e9f1bafe859df85c854679e2904a8172945d2bf2d676c8ae3ecb72fe6de0665
> +
> +worksrcdir          cudf-${version}
> +
> +use_configure       no
> +
> +# parallel building fails
> +use_parallel_build  no
> +
> +build.env-append    CC=${configure.cc}\
> +                    CFLAGS=\"${configure.cflags} [get_canonical_archflags 
> cc]\" \
> +                    LDFLAGS=\"${configure.ldflags} [get_canonical_archflags 
> ld]\" \
> +
> +post-patch {
> +    reinplace "s#/usr/#${prefix}/#g" ${worksrcpath}/Makefile.config
> +}
> +
> +subport ocaml-cudf {
> +    PortGroup           ocaml 1.0
> +
> +    depends_lib-append  port:camlp5 \
> +                        port:ocaml-findlib \
> +                        port:ocaml-extlib
> +    
> +    build.target-append opt
> +    
> +    variant tests description {Build the test suite} {
> +        depends_build-append    port:ocaml-ounit
> +        test.target             test
> +        test.run                yes
> +    }
> +    
> +    livecheck.type      none
> +}
> +
> +subport libCUDF {
> +    depends_lib-append  port:ocaml-cudf \
> +                        path:lib/pkgconfig/glib-2.0.pc:glib2
> +    build.pre_args      -C c-lib
> +    build.args          all opt
> +
> +    post-destroot {
> +        file delete -force ${destroot}${prefix}/lib/ocaml
> +    }
> +
> +    variant tests description {Build the test suite} {
> +        test.pre_args   -C c-lib
> +        test.args       test
> +        test.run        yes
> +    }
> +}

Please remove the "tests" variants; they just make it harder for the user to 
run the tests.

Perhaps it's not clear that MacPorts does not run tests automatically. You have 
to request them by running the test phase, as in:

sudo port test libCUDF

But when you hide the test directives inside a +tests variant, this gets 
unnecessarily complicated to:

sudo port test libCUDF +tests


For the ocaml-cudf port, I see you need port:ocaml-ounit as a dependency. In an 
ideal world, you'd just add that to depends_test, but this is not an ideal 
world and depends_test has not been implemented yet. (If anyone wants to 
implement that in base, that would be great.) I suggest you still dispense with 
the variant and instead check for the dependency in a pre-test block. See for 
example the graphite2 port which, rather than hiding the tests in a variant 
just to add a dependency (on a suitably-new version of Python), checks for it 
in pre-test instead. You could use registry_active, or checking for the 
existence of a file you know would be provided by that port.



_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to