Menu

Building LProf on Mac OS X

Help
Udo
2006-03-30
2013-05-01
  • Udo

    Udo - 2006-03-30

    Hi,

    I am working on building LProf on my Powerbook (OS X 10.4, PPC).
    After finally having all prerequisites together, tweaking the darwin/SConscript file, patching some .ui-files (QT 3.3.6 shows the same include-error as 3.3.5) I have the following problem. The build process finishes (with some (minor) warnings) and the targets are built.
    When I execute lprof I get a nice program window but I cannot do anything with it. The only thing which works are the OS maximize, minimize and close buttons. I cannot even get focus on the window by clicking on it, nor is it shown in the dock.
    Maybe an QT-issue? Any ideas?

    Greetinx,
    Udo

     
    • Hal Engel

      Hal Engel - 2006-03-30

      Wow,  I don't know.  Perhaps a QT issue.  I will do some research.  I know nothing about QT on the Mac so it may take a while to get to the bottom of this but I definitely want to know what is happening and what needs to be done to fix it.  I have been looking for a Mac person to work with on this and up till now have not had any luck.  So I will do everything I can to assist you.  In fact I would like to have these issues resolved before 1.11.4 is released.  So this is a very high priority item for me.

      It is normal to get a few warning messages (warnings about type casts and unused variables) during the build and unless you are seeing something unusual this is not an issue.

      As a side note CVS has fixes for the 3.3.5 include error issue.  These are just empty header files with the names it is looking for.  Dumb fix for a dumb problem.  You might try the same fix with 1.11.3.1 since there is a slight possibility that your fix to the ui files might have had some side affects. 

      You might try the CVS version as it has some significant improvements (more going in every day) and fixes.  Among the improvements are a number of mostly complete translations (German, Russian, French and Norwegian) with more on the way. Current CVS is in good shape (builds and runs without problems on Linux and maybe later today on Windows).  We are a few weeks away from the next release so we are trying to keep CVS head in a condition where it builds and runs correctly. I don't know if (or even think) it will affect the problem you are seeing.  But it would probably be better to be testing with the latest code.

      Since you patched up the Sconscript could you post a copy here?  I would like to update this in CVS.

       
    • Hal Engel

      Hal Engel - 2006-03-30

      I found something that may help.  I posted on a QT forum and asked about getting this to work on a Mac and I got the following reply:

      I remember that you have to add some "resource fork" to your application. I had the same problem when I used FLTK on a mac. From http://wiki.cocan.org/getting_starte...ml_on_mac_os_x

      Now, to make the program work properly, one must perform one of two additional steps: adding a resource fork to the executable, or building a Mac OS X .app structure.

      To add a resource fork, one needs to use the program Rez, included in the OS X Developer tools. This can be done with the following command:

      /Developer/Tools/Rez -t APPL -o hello ~/dev/mac.r \ -i /Library/Frameworks/Tcl.framework/Headers \ -i /Library/Frameworks/Tk.framework/Headers
      Where mac.r is a Rez source file. It is part of the FLTK distribution. This will add the required resource fork to the hello application. The program can be run either by typing hello at the command line or by double-clicking the app's icon (note that if it is launched by double-clicking, hello will send its output to the OS X console rather than the terminal).

      I don't know wether there is such a resource file for Qt but making an .app-bundle might help.

      ------------------------------------

      I don't know if this helps or not.  Does this look to you like it might work?  If so is there something that needs to be added to the lprof sources to make this easier for Mac users?  Or perhaps this is a documentation issue (ie. telling Mac user that you need to do an extra step to make it work correctly)?  

      Please let me know.

       
      • Craig Ringer

        Craig Ringer - 2006-03-31

        It's much better to use a .app directory rather than add a resource fork. Creating a .app bundle is not hard - I used to do it by hand for the initial Mac OS X porting efforts.

        Andreas Vox from Scribus has written a set of scripts that will be very useful for supporting Mac OS X. You might want to get in touch with him about them. I haven't used them myself, as I was only involved in the early days of the Mac port.

         
    • Udo

      Udo - 2006-03-31

      I now checked out lprof from cvs and suppose I have the latest version. After adjusting build/darwin/SConscript I rebuilt the application with the following result:
      - no more qt-errors due to includes in *.ui.
      - still the no focus / no function problem afer starting the app

      Then I tried to create an .app-bundle according to the instructions on wiki.cocan.org:
      mkdir lprof.app
      mkdir lprof.app/Contents
      mkdir lprof.app/Contents/MacOS
      mv lprof lprof.app/Contents/MacOS

      Next, create a file lprof.app/Contents/Info.plist with the following contents:

      <?xml version="1.0" encoding="UTF-8"?>
      <plist version="1.0">
      <dict>
        <key>CFBundleExecutable</key>
        <string>lprof</string>
      </dict>
      </plist>
      LProf can now be run from the command line by typing open lprof.app, or by double-clicking on the app's icon.
      Et voilà: The application now reacts on clicking and seems to work basically.
      I already found some non-working functions. Is there a suite of test cases to run?
      LProf came up in german and I am afraid to say it is hard to get the meaning of some headings, buttons etc. How can I switch lprof back to english?
      I am willing to have look on the german translation. How can I help you there?
      How can I post my darwin/SConscript?

      Lots of questions, but I think we are on the way t a working Mac OS X version of lprof.

      Greetinx,
      Udo

       
    • Hal Engel

      Hal Engel - 2006-03-31

      Great new thanks.

      On Linux lprof can be run in English like this:

      LANG="en" lprof

      On Windows like this:

      set LANG=en
      lprof

      On my English machine I run it in German like this:

      LANG="de" lprof

      So I would think that on the Mac it would probably be something close to the Linux version.  And if the application can't find the translation that goes with the ISO language code set in LANG then it will default to English.

      It looks to me like it should be possible to add the lprof.app/Contents/Info.plist file to CVS and then update the SConscript to do the other stuff (mkdir lprof.app, mkdir lprof.app/Contents and so on).  This kind of thing is easy to do in SCons.  For example code look at the install section at the bottom of the lprof SContruct file.  Looks to me like this should take two lines on SCons code to do.

      You can post things in the patches forum.

      It does not surpise me that there are some problems with lprof on a Mac.  There were also issues with the Windows port that we are just getting sorted out.  If you can give me more details about what you are seeing I think we can get these things working.  I suspect that this will be easier to fix than things on Windows since a Mac is more Unix like than Windows.

      We don't yet have a test suite.  It is on our list of things to do but that list is still a long one.  The first thing you should do is to run through the tutorials in the help system.  There is a main one that will walk you through creating a scanner profile and there is another section about creating monitor profiles.  If you can get through these and create usable profiles then most everything is working.  But I suspect that you will run into stuff that is not working that will prevent you from completing the tutorial.

      Do you have an IT8.7/2 target?  If not I can send you images and additional reference files to test more stuff after the basics are working.

      The person working on the German translation does not know much about color management and so both her and myself knew that it was possible that the translation might not be so good in some places.  I am sure that she would like some feedback and I have sent her an email asking her to contact you.

       

Log in to post a comment.