Dealing with X11 app-defaults in formula

(Ken Hornstein) #1

I have been working on a formula for an X11 application (xfig). Creating this formula is relatively straightforward, but I have run into one wrinkle with the appplication defaults file.

Because xfig uses Autoconf, I can install the application defaults file in any location; by default it ends up in #{prefix}/share/X11/app-defaults, which seems reasonable. But the Xt libraries can’t find this file; by default they only look in the OS-supplied files, which are things like /opt/X11/share/X11/app-defaults. But we can’t write to this location without being root.

Xfig is one of those applications that doesn’t work right if it cannot find the application defaults file, and I can’t find other examples of X11 applications that have dealt with this; I’ve seen other formulas that INSTALL an application defaults file, but as far as I can tell they aren’t actually being read by the application. My question is: what is the preferred solution? If it’s as simple as providing a Caveats section that provides a recommended setting for XUSERFILESEARCHPATH, that’s simple enough. If there’s another recommendation or a sample formula I could use, that would be welcome.

(Mike McQuaid) #2

Generally it’s worth in that case using a wrapper script to set that environment variable. Avoid caveats when we can fix it for users.

(Ken Hornstein) #3

Okay, that seems relatively easy. I don’t know if people smarter than I want to come up with a more generic solution, though.

(Salvato Palmieri) #4

This is OK, but it does not solve the problem of fixing the Xfig installation after brewing it. Any suggestions?

(Ken Hornstein) #5

Um, how does a wrapper script NOT solve the problem? I never got around to submitting my formula (and I see there is one for xfig but it doesn’t solve those problems either), but I think a wrapper script would work fine.