Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #12898 (new enhancement)

Opened 14 months ago

Last modified 8 months ago

TinyOS 2.x operating system port

Reported by: platon@… Owned by: macports-tickets@…
Priority: Normal Milestone: Port Submissions
Component: ports Version: 1.5.2
Keywords: tinyos, operating system, wireless sensor network Cc: notalpe@…, ryandesign@…, jmr@…
Port:

Description

This port aims at adding the tinyos operating system (2.x) to the repository. TinyOS is an operating system for resource-bounded devices such as wireless sensor networks. I am submitting a port for NesC as well for wireless sensor networks in another ticket. For this reason (and for future ports), I wonder whether a "wsn" port category would be good.

This port installs tinyos for AVR-compatible boards by default, i.e. the command-line utilities to use the system and the appropriate dependencies. Users for other hardware (Telos, etc.) will need to install separately the required components. I am ok to add such support as variants, if some requests come up.

The only variant in the port `develenv' installs the tinyos development environment as well. This environment requires several resources, so it _violates the MacPorts tree_ (that is why I chose a variant for the moment). The violation is "clean" however, as all required resources and example codes are put in a "tinyos-dev" directory created under ${prefix}. The "port uninstall" command does not remove this directory. If the MacPorts team could suggest a much better way to install the environment, I am glad to do it.

Attachments

patch-avr-rules.diff (0.9 KB) - added by platon@… 12 months ago.
patch-sim-extra.diff (1.0 KB) - added by platon@… 12 months ago.
tinyos.sh.tpl (235 bytes) - added by platon@… 12 months ago.
Script template to let the user set up its environment (the port install instantiates the template as necessary).
Portfile (2.2 KB) - added by platon@… 9 months ago.
Update of the portfile to remove a now useless patch (patch-sim-extra.diff).

Change History

Changed 14 months ago by platon@…

The port has been tested on a fresh machine, and fresh install of MacPorts (1.5.2), under Mac OS X 10.4.

Changed 13 months ago by ryandesign@…

  • cc platon@…, ryandesign@… added

Thanks for contributing! Some comments:

  • The comment "Tested on a fresh MacPorts 1.5.2 installation on Mac OS X 10.4" does not belong in the portfile.
  • Simply listing "wsn" in the categories keyword is enough to create the category (virtually, anyway).
  • The develenv variant does not appear to bring in any additional port dependencies, so wouldn't it be better to always install the development environment?
  • The development environment should be installed within ${destroot}${prefix} so that it is registered as belonging to the port and uninstalled when using port uninstall. I see your variant description says this is intentional "to keep user contents". What user content might there be, and have you confirmed that MacPorts would really remove it? I thought MacPorts would only remove files registered to the port, and not any files the user manually added.
  • Renaming the fetched CVS source directory in post-fetch is weird; usually you should set the worksrcdir variable, like "worksrcdir tinyos-2.x" or, looking at your later lines, probably "worksrcdir tinyos-2.x/tools".
  • Using system to copy files and change ownership is discouraged; can you rework this to use xinstall instead?
  • It's a little weird to be creating files out of thin air from within the portfile. Usually you would have a template file in the port's files directory and patch it using reinplace. See the wine port for a simple example.
  • The patchfile patch-sim-extra.diff hard-codes the prefix /opt/local, but MacPorts could be installed in any prefix. You must use the ${prefix} variable, probably in a reinplace statement, to fix this.

Can you please attach revised files?

Changed 12 months ago by platon@…

Changed 12 months ago by platon@…

Changed 12 months ago by platon@…

Script template to let the user set up its environment (the port install instantiates the template as necessary).

Changed 12 months ago by platon@…

This update of the portfile submission addresses all items from Ryan's comments. I have however maintained the post-fetch renaming of the worksrcdir, from tinyos-2.x to tinyos-2.0.2, so that to reflect the exact version of the system. The development environment is now installed by default under ${prefix}/tinyos-2.0.2 (with the generated environment configuration script) and registered for proper uninstall. The system was tested under MacPorts 1.5.2. It does not work with 1.6 because of the mtree violation (necessary, in my sense).

Changed 9 months ago by jmr@…

If you really need to install files in a non-standard location, you can set "destroot.violate_mtree yes".

Changed 9 months ago by platon@…

Update of the portfile to remove a now useless patch (patch-sim-extra.diff).

Changed 8 months ago by jmr@…

  • cc jmr@… added; platon@… removed

You're still referencing patch-sim-extra.diff in pre-patch and post-patch.

Note: See TracTickets for help on using tickets.