Loading ...
Sorry, an error occurred while loading the content.

1169Eliminating StuffIt from the OS X build process (was Re: Panther gVim)

Expand Messages
  • Daniel Sandler
    Oct 24, 2003
    • 0 Attachment
      > Just a quick note: opening .hqx files can have nasty side effects...

      That's for sure.

      Is there any particular reason that BinHex is being used to encapsulate
      these Mac resources, rather than something a little easier to manipulate
      from make or jam? (That is, something that can be used with blocking
      shell tools?) I have a couple of ideas on how this might be done:


      Suggestion 1: Use the OS X pseudo-file spec to manipulate resources

      Background: Apple's implementation of POSIX file ops for resource-fork
      filesystems seems to provide some pseudo-file paths allowing direct
      access to the different forks of a file as separate file descriptors.
      (There appear to be some relevant #defines in sys/paths.h .)

      Usage: To get started, split gui_mac.rsrc into data and resource
      forks:

      cat gui_mac.rsrc/..namedfork/rsrc > os_mac.rsr.rsrcfork
      cat gui_mac.rsrc/..namedfork/data > os_mac.rsr.datafork

      At this point, you have two files containing only data forks.
      Therefore, they ought to be safe to add to CVS:

      cvs add os_mac.rsr.{rsrc,data}fork

      At build time, reverse the procedure:

      # fictitious Makefile excerpt
      gui_mac.rsrc:
      touch gui_mac.rsrc # need to have the file present first
      cat os_mac.rsr.rsrcfork > gui_mac.rsrc/..namedfork/rsrc
      cat os_mac.rsr.datafork > gui_mac.rsrc/..namedfork/data

      Downside: I believe the ..namedfork spec was introduced in OS X 10.2,
      so you might be limiting the platforms on which vim can be built.

      Another downside: anything I find in a header file delimited by #ifdef
      __APPLE_API_PRIVATE sort of gives me the creeps. It doesn't seem to
      be a well-documented API, and so could go away at any time.
      Information on this API is scarce and sometimes inconsistent; the most
      authoritative note I've seen (read: "comes from an @... email
      address") is here: http://nntp.x.perl.org/group/perl.macosx/4260 .


      Suggestion 2: use DeRez/Rez, part of the OS X developer tools

      This is what I used to store resources in CVS for my OS X projects
      before I learned about the ..namedfork trick.

      Usage: once you have a gui_mac.rsrc you like, use DeRez to create a
      gui_mac_static.r (since gui_mac.r already exists to include dynamic
      stuff like VIM_VERSION_*) and check the new .r file into CVS. Use
      $REZ from the Makefile to reconstitute gui_mac.rsrc when needed.


      I hope this is helpful; I apologize for not submitting proper patches,
      but I'm not set up to build OS X vim at the moment...

      -dan, re-engaging his lurking device
    • Show all 23 messages in this topic