project-navigation
Personal tools

Author Topic: svn trunk rev 16674 (7 May 2008) -- UFOAI.app errors out when opening  (Read 3852 times)

Offline ponkan

  • Rookie
  • ***
  • Posts: 20
    • View Profile
First of all, I would like to thank all the developers for the amazing job they've done on the game so far. I stumbled upon it looking for some information on X-COM:TFTD, and it's been a blast playing it these few weeks.

So I tried to compile the svn version since I had heard such good things about the 2.3 branch. The UFOAI.app file prepared by make bundle errors out when opening, though the binary itself executes fine when I go down to the root directory and fire up ./ufo +set vid_fullscreen 1. This is the specific error I get when trying to open the bundle through the command line:
Code: [Select]
andreas-computer:~/src/ufoai/trunk/src/ports/macosx/installer andrea$ open UFOAI.app/
2008-05-08 03:37:58.717 open[15847] LSOpenFromURLSpec() returned -10827 for application (null) urls file://localhost/Users/andrea/src/ufoai/trunk/src/ports/macosx/installer/UFOAI.app/.

This is under a Macbook Pro 2.4GHz running Mac OS 10.4, if it's relevant. The way I got the application bundle was through the standard ./configure CPPFLAGS="-I/sw/include/" LDFLAGS="-L/sw/lib", make, make lang, make maps, sh archives.sh (in base), make bundle TARGET_CPU=i386.

The first time I ran make bundle I got this output, I noticed several permission denied errors, so I reran the command under sudo, which produced clean output that time, but in either case the bundle gave me the same error. Here's the output of the first make bundle:
Code: [Select]
../../../../base/0base.pk3 -> UFOAI.app/base/0base.pk3
../../../../base/0snd.pk3 -> UFOAI.app/base/0snd.pk3
../../../../base/0pics.pk3 -> UFOAI.app/base/0pics.pk3
../../../../base/0music.pk3 -> UFOAI.app/base/0music.pk3
../../../../base/0models.pk3 -> UFOAI.app/base/0models.pk3
../../../../base/0media.pk3 -> UFOAI.app/base/0media.pk3
../../../../base/0materials.pk3 -> UFOAI.app/base/0materials.pk3
../../../../base/0maps.pk3 -> UFOAI.app/base/0maps.pk3
../../../../base/0ufos.pk3 -> UFOAI.app/base/0ufos.pk3
Installing /opt/local/lib/libcrypto.0.9.8.dylib...install_name_tool: can't open input file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib for writing (Permission denied)
install_name_tool: can't lseek to offset: 4096 in file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib for writing (Bad file descriptor)
install_name_tool: can't write new headers in file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't lseek to offset: 1413120 in file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib for writing (Bad file descriptor)
install_name_tool: can't write new headers in file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't close written on input file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't open input file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib for writing (Permission denied)
install_name_tool: can't lseek to offset: 4096 in file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib for writing (Bad file descriptor)
install_name_tool: can't write new headers in file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't lseek to offset: 1413120 in file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib for writing (Bad file descriptor)
install_name_tool: can't write new headers in file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't close written on input file: UFOAI.app/Contents/Libraries/libcrypto.0.9.8.dylib (Bad file descriptor)
done
Installing /sw/lib/libpng.3.dylib...done
Installing @executable_path/../Frameworks/SDL_ttf.framework/Versions/A/SDL_ttf...done
Installing /opt/local/lib/libssl.0.9.8.dylib...install_name_tool: can't open input file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib for writing (Permission denied)
install_name_tool: can't lseek to offset: 4096 in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib for writing (Bad file descriptor)
install_name_tool: can't write new headers in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't lseek to offset: 294912 in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib for writing (Bad file descriptor)
install_name_tool: can't write new headers in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't close written on input file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't open input file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib for writing (Permission denied)
install_name_tool: can't lseek to offset: 4096 in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib for writing (Bad file descriptor)
install_name_tool: can't write new headers in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't lseek to offset: 294912 in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib for writing (Bad file descriptor)
install_name_tool: can't write new headers in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't close written on input file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't open input file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib for writing (Permission denied)
install_name_tool: can't lseek to offset: 4096 in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib for writing (Bad file descriptor)
install_name_tool: can't write new headers in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't lseek to offset: 294912 in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib for writing (Bad file descriptor)
install_name_tool: can't write new headers in file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib (Bad file descriptor)
install_name_tool: can't close written on input file: UFOAI.app/Contents/Libraries/libssl.0.9.8.dylib (Bad file descriptor)
done
Installing /sw/lib/libjpeg.62.dylib...done
Installing /sw/lib/libintl.3.dylib...done
Installing @executable_path/../Frameworks/SDL_mixer.framework/Versions/A/SDL_mixer...done
Installing /opt/local/lib/libz.1.dylib...done
Installing /usr/lib/libcurl.4.dylib...done
Installing /sw/lib/libiconv.2.dylib...done
Installing @executable_path/../Frameworks/SDL.framework/Versions/A/SDL...done
Finalizing ufo...done
Finalizing ufoded...done
Finalizing ufo2map...done
andreas-computer:~/src/ufoai/trunk/src/ports/macosx/installer andrea$

Could the case be that I have bad libraries? They're from MacPorts, it's the only thing touching the /opt tree. What I don't understand is why it's getting any files from there when I explicitly told configure to search under /sw?

Any insight on how to resolve this problem would be much appreciated.

EDIT: I've successfully done it on 2.2.1, though that was before I installed MacPorts. Should I just remove all MacPorts packages altogether? I had been hoping to make a universal dmg for 2.2.1, but that didn't work either, don't know why. The working 2.2.1 version I have is just i386, from before I installed MacPorts.
« Last Edit: May 08, 2008, 01:10:16 pm by ponkan »

Offline tchristney

  • Rookie
  • ***
  • Posts: 75
    • View Profile
I have submitted a patch that fixes the build problems. The basic issue is that 2.3 brings in libcrypto and libssl which are installed as read only (as a rudimentary security measure). So when the libs are copied to the bundle, install_name_tool can't update the information within. The patch changes the permissions temporarily to enable install_name_tool to work properly.

As a side note, if you are using MacPorts, then you don't need the CPPFLAGS="-I/sw/include" and LDFLAGS="-L/sw/lib" added to configure. If you apply my latest patch then just using ./configure should set everything up to produce universal binaries. Also, I have a universal binary build of 2.2.1, but I'm waiting on the return of Mattn to get it uploaded to sf.net.

You're problem with opening the application is your use of the open command. You should type
Code: [Select]
open -a ./UFOAI.app or more simply
Code: [Select]
./UFOAI.app/Contents/MacOS/ufo
or even more simply by just double-clicking on the bundle (I know, a bit of a pain when you are working in the terminal.)

Offline ponkan

  • Rookie
  • ***
  • Posts: 20
    • View Profile
Ok, just did a clean re-compile of the source, with the patch applied. Double-clicking the bundle....

<cue Dr. Frankenstein>
IT'S ALIVE!
</cue>

Thanks for the patch.