[47762] trunk/dports/emulators/nonpareil

Ryan Schmidt ryandesign at macports.org
Sat Mar 7 00:38:24 PST 2009


On Mar 7, 2009, at 01:56, Martin Krischik wrote:

> Jeremy Huddleston schrieb:
>
>> Could we possibly make nonpareil a bit more light weight by adding  
>> the
>> files/ stuff to a tarball on the mirrors... there's no need to  
>> clutter
>> everyone's disk with these 9M

Agreed. Note it's really only 4MB for most people. (You're counting  
the redundant files that Subversion stores in working copies; most  
people use rsync for their dports tree and not Subversion.) But  
that's still excessive for one port. The entire dports tree is 51.6MB  
with the PortIndex occupying 3.2MB. We have ~5600 ports so the  
average size of a port is around 8KB, so nonpareil is 500 times  
larger than the average.


> Shure - have you got a link for me on how to do it? Yes, I did search
> the guide and I did search the wiki but nothing useful turned up. Of
> course I might just have used the wrong search keywords.
>
> Suggestion: If there is no documentation yet then write a Wiki and  
> send
> be the link only.
>
> And is there a place in the svn hierarchy where I can keep the  
> files. It
> is helpful to keep the change history of command files and plists.

I don't think there's any specific documentation on this topic. If  
you need documentation, please consider writing some, after you've  
learned the steps. It's hard for me to know what steps would be  
helpful to you.


I recommend you copy the icons into your user directory in the  
repository, which you would first have to create.


export REPO=http://svn.macosforge.org/repository/macports

svn mkdir $REPO/users/krischik

svn mkdir $REPO/users/krischik/nonpareil

svn cp $REPO/trunk/dports/emulators/nonpareil/files \
$REPO/users/krischik/nonpareil/appbundles

svn rm $REPO/users/kirschik/nonpareil/appbundles/patch-src-util.diff


Now you can export that directory and compress it in the same format  
as your port's existing distfile, which is .tar.gz. Note you should  
"svn export" and not "svn checkout" because checking out will create  
a working copy with lots of redundant information in the .svn  
directories which is not appropriate in a distribution tarball.


svn export $REPO/users/kirschik/nonpareil/appbundles \
nonpareil-appbundles

tar czf nonpareil-appbundles-rREV.tar.gz nonpareil-appbundles


where REV is the revision number that was exported, or some other  
unique identifier that is not necessarily tied to the version number  
of nonpareil.

Now you can import that distfile into the repository. The distfiles  
directory would be a good place for it. You'll first have to make the  
directory for nonpareil.


svn mkdir $REPO/distfiles/nonpareil

svn import nonpareil-appbundles-rREV.tar.gz $REPO/distfiles/nonpareil


Now you can go back to your dports working copy and edit the  
nonpareil portfile to download nonpareil-appbundles-rREV.tar.gz  
additionally, like this:


Index: Portfile
===================================================================
--- Portfile	(revision 47813)
+++ Portfile	(working copy)
@@ -22,13 +22,17 @@
  					algorithms from the calculator.

  homepage			http://nonpareil.brouhaha.com/
-master_sites		http://nonpareil.brouhaha.com/download
+master_sites		http://nonpareil.brouhaha.com/download:prog \
+					macports:nonpareil:appbundles

  set prog			nonpareil-${version}.tar.gz
+set appbundles		nonpareil-appbundles-rREV.tar.gz

-distfiles			${prog}
+distfiles			${prog}:prog \
+					${appbundles}:appbundles

-checksums			${prog} sha1 83bc2f57e6ece9ce19e3449cce075ef246a9f4c2
+checksums			${prog} sha1 83bc2f57e6ece9ce19e3449cce075ef246a9f4c2 \
+					${appbundles} sha1 0123456789abcdef0123456789abcdef01234567

  depends_lib			port:bison								\
  					port:flex								\


It seems like you also can enormously simplify your "platform macosx"  
section to just this:


platform macosx {
	post-destroot {
		xinstall -d ${destroot}${applications_dir}/Nonpareil
		foreach calc {HP-21 HP-25 HP-32E HP-33C HP-34C HP-34 HP-37E HP-38C  
HP-38E HP-41CV HP-41CX HP-45 HP-55 HP-80} {
			copy ${worksrcpath}/nonpareil-appbundles/${calc}.app ${destroot}$ 
{applications_dir}/Nonpareil
			reinplace s|@PREFIX@|${prefix}|g \
				${destroot}${applications_dir}/Nonpareil/${calc}.app/Contents/ 
MacOS/${calc}.command
		}
	}
}


And of course you'll want to then "svn rm" all the icons in the files  
directory before you commit.






More information about the macports-dev mailing list