free42 (was: Re: [46154] trunk/dports/emulators)

Ryan Schmidt ryandesign at macports.org
Sun Feb 1 13:34:01 PST 2009


On Jan 30, 2009, at 11:25, krischik at macports.org wrote:

> Revision: 46154
>           http://trac.macports.org/changeset/46154
> Author:   krischik at macports.org
> Date:     2009-01-30 09:25:19 -0800 (Fri, 30 Jan 2009)
> Log Message:
> -----------
> Ticket #18207: Free HP-42s Simulator.

[snip]

> +depends_lib			port:gtk2					\
> +					path:${prefix}/bin/zsh:zsh

This line must read "path:bin/zsh:zsh" to work as intended because  
variables are not expanded in depspecs.

[snip]

> +	xinstall -m 755															\
> +		-W ${filespath}														\
> +		Free42-Decimal.command.in											\
> +		${destroot}${applications_dir}/Free42-Decimal.command
> +	reinplace																\
> +		s|@PREFIX@|${prefix}|g												\
> +		${destroot}${applications_dir}/Free42-Decimal.command
> +	system "SetFile -a E ${destroot}${applications_dir}/Free42- 
> Decimal.command"
> +	xinstall -m 755															\
> +		-W ${filespath}														\
> +		Free42-Binary.command.in											\
> +		${destroot}${applications_dir}/Free42-Binary.command
> +	reinplace																\
> +		s|@PREFIX@|${prefix}|g												\
> +		${destroot}${applications_dir}/Free42-Binary.command
> +	system "SetFile -a E ${destroot}${applications_dir}/Free42- 
> Binary.command"

When I try to install the port I get:

sh: line 1: SetFile: command not found
Error: Target org.macports.destroot returned: shell command "SetFile - 
a E /mp/var/macports/build/ 
_Users_rschmidt_macports_dports_emulators_free42/work/destroot/ 
Applications/mp/Free42-Decimal.command" returned error 127
Command output: sh: line 1: SetFile: command not found

SetFile is not in any of the usual paths but in /Developer/Tools so  
you'll have to call it by that absolute path if you want to use it.

But why do you want to use it? It looks like you're making files  
invisible. Is that because they look unsightly in the Applications  
directory? If so, then why are the files there and not placed in a  
less-visible MacPorts directory, e.g. ${prefix}/libexec/${name}?

It looks like these .command files are wrapper scripts around the  
real program. Wrapper scripts are fine; I do it in the wine port too.  
But I suggest you change it in this way:

1) Install the wrapper script as ${prefix}/bin/free42. Install the  
real binary in ${prefix}/libexec/${name}/free42. That way anyone who  
just types "free42" in the Terminal access your wrapper too.
2) If you want to make the program available in ${applications_dir},  
make a minimal application bundle. See for example the post-destroot  
section of the port lbreakout2.
3) Rewrite the wrapper in sh so that a dependency on the zsh port is  
not necessary.

> +############################################################ {{{1  
> ###########
> +# vim: set nowrap tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab :
> +# vim: set textwidth=0 filetype=tcl foldmethod=marker nospell :

We already have the modeline in the first line of the portfile. If  
these lines are adding things that we don't have in the modeline,  
what are they and would they be useful to consider adding to our  
recommended modeline?


> Added: trunk/dports/emulators/free42/files/Free42-Binary.command.in
> ===================================================================
> --- trunk/dports/emulators/free42/files/Free42- 
> Binary.command.in	                        (rev 0)
> +++ trunk/dports/emulators/free42/files/Free42-Binary.command.in	 
> 2009-01-30 17:25:19 UTC (rev 46154)
> @@ -0,0 +1,21 @@
> +#!@PREFIX@/bin/zsh
> +##############################################################  
> {{{1 ##########
> +#   $Author: krischik at users.sourceforge.net $
> +#   $Revision: 26 $
> +#   $Date: 2009-01-26 19:02:17 +0100 (Mo, 26 Jan 2009) $
> +#   $HeadURL: https://macport-staging.googlecode.com/svn/trunk/ 
> ports/emulators/free42/files/Free42-Binary.command.in $
> +############################################################## }}} 
> 1 ##########

This header is a bit heavy. Other files in MacPorts just use the $Id$  
keyword.




More information about the macports-dev mailing list