[77874] trunk/dports/graphics

Ryan Schmidt ryandesign at macports.org
Fri Apr 15 17:47:59 PDT 2011


On Apr 15, 2011, at 08:07, phw at macports.org wrote:

> Revision: 77874
>          http://trac.macports.org/changeset/77874
> Author:   phw at macports.org
> Date:     2011-04-15 06:07:58 -0700 (Fri, 15 Apr 2011)
> Log Message:
> -----------
> new port: objectmarker
> 
> Added Paths:
> -----------
>    trunk/dports/graphics/objectmarker/
>    trunk/dports/graphics/objectmarker/Portfile
> 
> Added: trunk/dports/graphics/objectmarker/Portfile
> ===================================================================
> --- trunk/dports/graphics/objectmarker/Portfile	                        (rev 0)
> +++ trunk/dports/graphics/objectmarker/Portfile	2011-04-15 13:07:58 UTC (rev 77874)
> @@ -0,0 +1,40 @@

You've forgotten the $Id$ line and the svn:keywords and svn:eol-style properties.

https://trac.macports.org/wiki/CommittersTipsAndTricks#SetsvnpropertiesautomaticallyonnewPortfiles


It would also be nice if you would add the standard modeline, and modify the port's whitespace to conform to that modeline (spaces not tabs).

http://guide.macports.org/#development.practices.portstyle


> +PortSystem 1.0
> +
> +name		    objectmarker
> +version		    dev

"dev" is not a valid version number. I've pointed this out to you several times before, and you have yet to fix those other ports as well (Fonzy, GetPoints, HideSysFiles, macportsscripts, MyLoss, org-mode-devel, py27-psyco, ShiftIt). Please fix them now.


> +revision	    1

Any given port version should begin at revision 0, not 1.


> +categories	    games
> +platforms	    darwin
> +maintainers	    phw openmaintainer
> + 
> +description	    Tool for opencv to learn to recognize objects
> +long_description    ${description}
> +
> +homepage	    http://www.cs.utah.edu/~turcsans/DUC_files/HaarTraining/
> +master_sites	http://www.cs.utah.edu/~turcsans/DUC_files/HaarTraining/
> +
> +distfiles		ObjectMarker.cpp	

If the distfile name doesn't contain the version number, you need to set dist_subdir to include the version number.

https://trac.macports.org/wiki/PortfileRecipes#unversioned-distfiles


> +depends_lib	    port:opencv 
> +use_configure	no
> +extract.only 
> +reinplace		"s|#include <io.h>|#include <sys/uio.h>|g" ${distpath}/ObjectMarker.cpp

You can't put a reinplace in the main part of the portfile! What if the user doesn't have that file yet?

$ port info objectmarker
Error: reinplace: couldn't read file "/Users/rschmidt/.macports/opt/local/var/macports/distfiles/objectmarker/ObjectMarker.cpp": permission denied
Can't map the URL 'file://.' to a port description file ("reinplace sed(1) failed").
Please verify that the directory and portfile syntax are correct.

You also can't reinplace in the distfile! This will cause checksum errors. You need to first copy the file to the worksrcpath, as you do in the post-extract block below, then do your reinplacing on that copy of the file, in a post-patch block.


> +#checksums           md5     39973561dc2ef6d06bd2f4ab9b5aaea5 \
> +#                    sha1    ba58d18320d50f01f9e7e861100a298403e7cd7c \
> +#                    rmd160  32946c7a8950ed505150f716c77576438ebe7494
> +checksums           md5     f1f032209858427156259e7a54b5fe1d \
> +                    sha1    ce07b8f7b58836192e478bc7f91b967878ff326b \
> +                    rmd160  8e026342d5b7a21627171ee589c660d49752f057
> +
> +					
> +post-extract {
> +		   xinstall -d ${worksrcpath}
> +	       file copy ${distpath}/ObjectMarker.cpp ${worksrcpath}/
> +	    }
> +build.cmd {
> +	g++ ObjectMarker.cpp `pkg-config --cflags opencv` -o objectmarker `pkg-config --libs opencv`
> +}

You need a build dependency on port:pkgconfig.

You also need to be using ${configure.cxx} instead of "g++":

https://trac.macports.org/wiki/UsingTheRightCompiler

You also need to take care of supporting build_arch and universal_archs, and to add the universal variant.





More information about the macports-dev mailing list