I am trying to package this into a OSX app using the GTK-OSX framework. I have the most recent SVN version working fine from the command line. The issue im hitting on is that the data paths are hard coded on compile:
When I try to package this into a "bundle" everything works fine except it dies when trying to access a theme at the hardcoded DATADIR. Digging around GTK-OSK bundler it looks like it should automatically update them if we use the freedesktop "data dir" specification. Greping through the source I see that someone tried to set this up awhile ago:
client/help/C/pioneers.xml: <title>Settings file <application>$XDG_CONFIG_HOME/pioneers</application></title>
But looks like its deprecated and got thrown in docs? Long story short. Is there any easy way to setup the $XDG configuration again? If not do you know another way to assign DATADIR to the relative dir pioneers is running from?
Please view https://sourceforge.net/apps/phpbb/gtk-osx/viewtopic.php?f=4&t=62&p=313#p313 for more in depth explanation.
Thanks for your help.
I was able to build a partial windows version and use the $XDG variables to locate the themes properly. Now I need to figure out how to fix:
6/10/11 9:32:18 AM .com.jq.pioneers (Pioneers-bin:53333): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file '///Users/jquick/Desktop/Pioneers.app/Contents/Resources/etc/gdk-pixbuf-2.0/2.10.0/gdk-pixbuf.loaders': No such file or directory
Fixed that issue, now im just working on the pixmap locations.
6/10/11 9:52:08 AM .com.jq.pioneers ** (Pioneers-bin:64605): WARNING **: Pixmap not found: ./pixmaps/pioneers/brick.png
overriding pioneers_datadir=$datadir in the config seemed to fix the issue. All working now.
As to your first question (which is appearantly already answered):
- The paths in configure.ac are the program's installation directory. If you want to change them, you should change configure.ac as you did. These will only be used at build time, and must be absolute paths.
- At run time, the directories are located using XDG_* (with appropriate fallback) for user data and the values from configure.ac. Most (all?) data can be both in a user dir or the global installation dir.
So when building a package, you should change configure.ac to point to the installation directory. It is not possible to build the package without knowing the installation directory, I think. (That is, a package which can be "installed" by unpacking it in any place.)
Ok so it looks like it was still using local pixmaps when running.
This is what I used to get themes to work:
But I cannot find an XDG that will alter the pixmap path at runtime. I've tried:
export XDG_DATA_DIR="$bundle_data" but no go. It keeps trying to access it out of my install path:
6/10/11 1:05:04 PM .com.jq.pioneers ** (Pioneers-bin:89362): WARNING **: Pixmap not found: /Users/jquick/gtk/inst/share/pixmaps/pioneers/dice.png
I'm reading up on XDG because im still foggy on how they get set and work.
Actually, XDG is quite simpel:
- A program should use the value of XDG_* variables if they are defined, or certains defaults if not.
- This is only about user-specific data, not about "installed" data.
- We use XDG_CONFIG_HOME and XDG_DATA_HOME, I think. We don't need the others.
- I think we don't provide a way to change the install directory after build. You may check the source to be sure, and you can patch it to support an environment variable, if you'd like. I think it's passed as DATADIR or something (check Makefile.am); grep the sources for that.
Yeah it does use DATADIR. What is the best way to patch this into a EVN? Is there a main C file that is triggered on start that I can just insert an assignment into?
Not sure if its the best way to do this.. but it turns out DATADIR is only used in about 4 files. So i just replaced it with g_get_user_data() so it points to XDG_DATA_HOME also. Worked like a charm.
Thanks for all your help! If anyone has a mac and wants to try it out feel free.
Should work fine on any intel mac >10.4.
Tried to run on 10.5.8 on Intel Macbook. Are you developing on 10.6 by any chance?
Date/Time: 2011-06-12 09:29:04.485 -0400
OS Version: Mac OS X 10.5.8 (9L30)
Report Version: 6
Anonymous UUID: EB1CFCDF-E116-4567-A6B6-EABD7F5C8627
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread: 0
Dyld Error Message:
unknown required load command 0x80000022
Ah yes, looking deeper into my gtk-osx i am setting it to 10.6. It looks like it requires intel >= 10.6.
Sorry for the confusion.
The app works for me (at least the server, client, and AI; didn't try network play). The only weirdness I see is that the Quit menu options (in the main menubar, not the gtk menubar) have no effect, but that's probably a GTK-OSX issue. Thanks!
Yeah im still working on that, GTK-OSX has a library to help integrate the app with the OSX menu bar. But other then that it should be fully functional.
Actually, one more thing. When selecting a game from the settings, each map is duplicated (the second one has a "1" at the end). Could something be adding the map directory twice?
hmm yeah I bet its looking both local and the ENV I setup. I'll see if i can fix that.
NEW VERSION OUT: https://github.com/downloads/jquick/pioneers_app/Pioneers.app.zip
-menu is now up on the osx bar
-all keybinding for all programs now use their native osx <command> keys
-quit menu at osx bar and doc now work
-fixed dupe maps showing up in server list
-unbound XDG_CONFIG_HOME/XDG_DATA_HOME so you can use custom maps/config if you wish
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.