Le mercredi 16 mai, Robert Bradshaw a écrit: > I don't like spkg.txt because it's just a (under-specified) convention > of what to put there when you make manual changes. Better would be to > have some specification file (json?) like > > { upstream = "http://original.project/releaseX.tar", > upstream_sha1 = "...", > excise = [ "windows.exe", "binary.blob" ], # remove from the above > when creating our tarball (below) > sources = "project.X.tar", > sources_sha1 = "...", > patches = [ "fixOne.patch", "fix2.patch" ], # to be applied to > sources, once unpacked > } > > Then an spkg could be automatically generated by changing the upstream > url (most common case), and otherwise one could tweak/meddle with src > and automatically create a new patch once you get it working. > > This may be a pain to do with shell scripts (how do you parse a json > file?) but perhaps a lot could be cleaned up if we assumed *some* > python as a prerequisite.
May I suggest that instead of writing JSON then trying to parse it... just write a shell script (see below for the type of shell script I have in mind)? Instead of the "upstream*=" things, just have two lines of script to download and check the hash. Instead of and "excise=", just have the needed 'rm -rf' lines. I don't see what the "sources*=" are about if you already downloaded and checked the tarball. What use if there for a "patches=..." list if you have the patches in a patches/ directory already? That could be done by a Makefile file with mandatory rules (which could then be called by a script) with things like : .PHONY: unpack patch configure build install patch-stamp: @echo 'Applying patches' <patch commands> @touch patch-stamp patch: unpack patch-stamp unpack-stamp: @echo 'Unpacking sources' <unpack commands> @touch unpack-stamp configure-stamp: @echo 'Configuring sources' <configure commands> @touch configure-stamp configure: configure-stamp build: unpack configure build-stamp You get the idea, Snark on #sagemath -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org