Update build instruction, new Gimp.app Leopard/Intel

Discussion in 'GIMP for Mac' started by lisanet, Sep 15, 2008.

  1. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    I've finally updated the instructions for building Gimp. As some parts of the current HOWTO http://darwingimp.sourceforge.net/buildgimp.html rely on that, I think it may be useful for packagers if some of these instructions are included in the HOWTO too.

    "http://gimp.lisanet.de/Website/Step_by_Step_zu_Gimp/Einträge/2008/9/5_Das_Gimp-App-Bundle_wird_erzeugt.html"
    (sorry, the umlaut char isn't working in this forum... and the site is german only :( )

    To make the whole packing process easier, I've ceated an application template and a shell script, which will do all the work after you've done a 'sudo port install gimp'

    What are the main changes and advantages?
    • All configuration files and cached data is placed under '~/Library/Application Support/Gimp'. The current builds on wilber-loves-apple still use some dot-files for font caching.
    • Python support included and _working_ :)
    • XCF QuickLook plugin included
    • some GTK-Clearlook themes included
    • The preview in the print dialog uses the system default for viewing pdf files. No hardcoded files to Prievew.app
    For more details just have a look at the shell script 'makegimpapp'.

    How to use it?
    • Download the application template and the shell script http://gimp.lisanet.de/Website/Download.html
    • Copy the template to '~/src/macports‘ and unzip it.
    • Copy the shell script to '~/src/macports‘ and to a
    • sudo ./makegimpapp

    That should do it.

    Simone

    BTW, I've build a Gimp.app for Leopard/Intel. It has some more modifications:
    • all of the above mentioned changes
    • support for graphic tablets
    • JPEG2000 support
    • patch to UFRaw to keep UFRaw's main window open
    And here's the download
    http://gimp.lisanet.de/Website/Download.html
  2. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    those changes seem nice and I would love to integrate them but...

    1) I don't speak German, and Christoph, our previous maintainer who did is no more part of this project. Of course I can read the scripts but it's always better to have explainations.
    2) our own scripts/build methods have had quite a few changes since we originally took your method, so I would prefer getting some sort of patch or description of the required changes, it would be much easier ( also easier than translating everythng from german :) )
    3)
    Hmm, I fixed that one some time ago already, is it still broken? On my computer the WLA build does have python support.
    4)
    When we were using the ClearLooks theme, we had lots of stability problems. A debugging session revealed that the ClearkLooks theme corrupted the memory somehow. Since then, work has been done to replace ClearLooks - and GIMP has not crashed one since then, while before it could crash every ten minutes. I am very reluctant to introduce ClearLooks back, unless you know the cause of the crashes and fixed it.
    5)
    How did you do it? Not sure if you've seen it, I've been trying in another thread with other people
  3. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    Ok, so I'll try to describe the changes in the build process I've made.

    Building Gimp:

    You are using various port install commands on different packages. I've patched some Portfiles (gimp, gimp2, openjpeg) so I can do a single "sudo port install gimp". This is just a matter of taste. Most important differences are:
    dropped: xsane, ghostscript
    added: gimp-jp2, gtk2-clearlooks, greycstoration
    and modified some configure-options in gimp2 (removed: --without-dbus, added: --disable-dependency-tracking, --disable-glibtest, --disable-gtktest, --disable-alsatest, --without-alsa)
    I've patched ufraw source code too (more Aperture compatible files extensions, the main window remains open after you save an image. I will desribe the patches in some other posting...)

    You can can download the patched Portfiles here: http://gimp.lisanet.de/gimp-Portfile http://gimp.lisanet.de/gimp2-Portfile http://gimp.lisanet.de/openjpeg-Portfile


    Packaging:

    I've made a new template for the application bundle. Main differences are:
    - version in Info.plist is updated by the scipt 'makegimpapp'
    - version in Contents/Resources/script is updated by 'makegimpappscript' script, Leopard only (I don't have Tiger to test with)
    - version file 'vXXX' is updated by the script, so 'script' can ensure that the symlink points to the correct Gimp.app version
    - Contents/Resources/sript is prepared for a separate launcher app for ufraw (needs to be done, still beta)
    - Contents/Resources/openDoc: same changes as in 'script', Leopard only
    - new icon
    - no getdisplay.sh in C/R/bin (because Leopard only)
    - added some themes to C/R/share/themes
    - added QuickLook-plugin to Contents/Library/QuickLook

    I've written a script 'makegimpapp'. These are the differences to gimpguts.sh

    - some checking if the symlink exists
    - detecting Gimp version

    Code:
    echo copying binaries ...
    BINS="dbus-daemon dbus-launch gimp-2.4 gimp-remote-2.4 python2.5 ufraw"
    
    So I don't use gimp-console, gimp-tool and gs
    'gimp-console is just the same as calling 'gimp -i'. 'gimp-tool' isn't needed because Gimp.app is not ready for compiling plugins. gs isn't need because you can use OS X's on CUPS

    Code:
    echo copying etc direcories and files ...
    ETC="dbus-1 fonts gimp gtk-2.0 pango"
    
    this is exactly the same as gimpguts.sh

    Code:
    # libdirs and .so and .dylib
    echo copying libraries ...
    LIBDIRS="engines gimp gnome-vfs-2.0 gtk-2.0 libglade orbit-2.0 pango python2.5"
    
    changes in cleaning up lib/*:
    delete *.la and *.a in any subdirs too
    removed lib/gnome-vfs-2.0/include, lib/gtk-2.0/include, lib/python2.5/test

    changes are:
    dropped: pygtk (there's no usefull lib in it)
    added: engines, gnome-vfs, libglade, orbit (AFAIK they are needed, but I'm not quite sure)
    added: *.so files in lib

    Code:
    echo copying share subdirectories ...
    SHAREDIRS="gimp gimp-lqr-plugin gutenprint icons locale poppler pygobject pygtk"
    
    changes:
    ghostscript is dropped (The print plugin works without it. I'm using OS X's own CUPS)
    removed some sudirs: icons/gnome, icons/hicolor, gutenprint/doc, gutenprint/samples

    Code:
    echo cleaning up locales ...
    find locale \( \! -name "gtk*" -and \! -name "gimp*" -and \! -name "ufraw" \) -delete
    
    delete anything but gtk*, gimp*, ufraw* (oops, there's a typo in my script....)

    Finally I do some configuring for files in etc
    - dbus-1/system.conf: use a user writeable directory in the /tmp hierarchy
    - fonts/fonts.conf: use ~/Library/App...Support/Gimp/fonts as additional font dir
    and set font caching dir to a sudir in ~/Library/App...Support/Gimp (your build still uses dot files/folders)
    This is mainly because I think that on OS X every app should use the OS x specific fiels and direcories and not use the Unix-like dot files and dot directories. On OS X it should be possible to delete an app by dropping it into Trash. If the app needs some additional files or other stuff, this should go into '~/Library/Application Support/APPNAME' or '/Library/Application Support/APPNAME'

    Code:
    # Availbale themes (Place the name of the theme in quotes):
    # Leopard
    # Tiger
    # ProApp
    # Glossy P
    gtk-theme-name = "Leopard"
    # this is Mac OS X default font
    gtk-font-name = "Lucida Grande 10"
    # this is for Gimp's print preview
    gtk-print-preview-command="open %f"
    
    changes:
    - this creates a default gtkrc in etc/gtk-2.0/gtkrc (used by ufraw) and in etc/gimp/2.0 (used by gimp)
    - Lucida Grande 10 in combination with a correct dpi setting in /usr/X11/bin/startx will result in the same font sizes as OS X
    - no hardcoded path to Preview.app. This uses the users preferred pdf viewer app.


    Code:
    # configuration default for Mac OS X leopard, by skl
    (num-processors 2)
    (interpolation-type lanczos)
    (default-image
         (comment "Created with GIMP on a Mac"))
    (color-management
        (mode display)
        (rgb-profile "/System/Library/ColorSync/Profiles/sRGB Profile.icc")
        (cmyk-profile "/System/Library/ColorSync/Profiles/Generic CMYK Profile.icc")
        (display-profile-from-gdk yes)
        (display-rendering-intent perceptual)
        (simulation-rendering-intent perceptual)
        (display-module "CdisplayLcms"))
    (help-browser web-browser)
    (web-browser "open %s")
    
    and these are some gimp defaults in etc/gimp/2.0/gimprc

    - Simone
  4. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    ghostscript is something we definitely cannot remove, at one point it was broken and lots of users reported this functionnality is vital to their workflow. (namely, dealing with PS and EPS files)

    Jpeg2000 support sounds like an interesting change, I'll definitly look at integrating it. About clearlooks, I told you in my previous message why we removed it. The 'greycstoration' plug-in looks interesting, though if we start shipping all useful plug-ins our builds will become huge. I'm considering building a plug-in repository for mac

    "--disable-glibtest, --disable-gtktest, --disable-alsatest, --without-alsa" are unnecessary changes, maybe they speed up the build a little but otherwise the quality of the build shouldn't be affected if we don't add them i believe. About "--without-dbus", why? Why a dbug dependency? On Linux, dbus is used to process "file opened" messages. But on mac, these are processed by Apple events. Furthermore, we got quite frequent bug reports from mac users who couldn't run GIMP because of dbus problems. So I don't see why we should add a dbus dep, unless you know a compelling reason that i don't?

    Great again! Have these patches been submitted to the ufraw authors? Sure, we can patch everything we build, but once again i'd prefer if the patch was applied upstream

    Good change. This is one I'll merge (or duplicate if it turns out to be easier)



    Yes, but Ghostscript is not only used during printing, it is also used to import EPS files

    Good.

    GIMP has been working fine without them so far, so I wouldn't think they are necessary? I'm not sure why you'd drop pygtk, if you do you break python plug-ins support

    Okay, some more good cleanup. My answer about GS is the same as previously

    Okay, some more good cleanup.

    My answer about dbus is the same as previously.
    The other change is minor but interesting.

    The font is already partially fixed (can be better fix when the XQuartz folks can improve the DPI detection as you mentionned in the other thread)
    The 'open' command seems a good change too.

    More good changes.

    So... I'll have lots of changes to do ;) I'll try to find some time later today, or later this week. Thanks for the better explaination
  5. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Oh, also :

    you said
    How did you achieve this? As you might have seen, I was trying (blindly) in another thread, but didn't suceed.
  6. Cocoa

    Cocoa New Member

    Joined:
    Sep 14, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I'm testing lisanet's build, and I'm not getting any tablet functionality.
  7. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    hhm, this is a good reason to keep ghostscript. I never imported ps files so far....

    I never had problems using clearlooks. I still use the "ProApp" theme which I've put in my Gimp.app.

    And yes, a plugin repository sounds great. I included greycstoration because IMO it's one of the most interessting plugins. And as I mentioned, it's just a matter of taste...

    Hhmm, this was just included because I was used to dbus on Linux and in some earlier build I had some problems without it. Something like dropping files on the dock icon, open a second image by right-clicking / selecting open or double-clicking on a second image. I don't remember exactly what caused the problem. But since I've included dbus, everything just works. Maybe these old issues where somehow related to anyting else. I'll build a new version without dbus and test it...

    you're right, I should have submitted them already... sorry. I'll do my best (I really like hacking on source code... but to write some documentation about it... puuh... I've just some more patches for handbrake and ffmpeg here lying around and waiting to be submitted to upstream authors...)

    If everything runs well...
    lib/pygtk only contains some demo code, so I dropped it.

    Of course, if xquartz will detect this, there's no need to change the font size. But till then, IMO it's better to set the correct dpi in /usr/X11/bin/startx because this will fix anything else X has to scale. Any other application which uses X will benefit too and the overall look becomes more consistent. Increasing the font size in gtkrc will only fix Gimp's gui, nothing else.

    about tablet support:
    I just compiled gimp using xinput extensions, as you've mentioned in some other posting. I have tested it already... (sorry)
  8. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    Opps,...
    ???
    ... I haven't tested it...
  9. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    ;)
    In the other thread, two people tested it... it didn't work for them. I can't do much work on that since I don't have a tablet

    Ok weird. As long as we don't know, I prefer staying on the safe side. Lots of users reported increased stability after switching away from ClearLooks

    I never had any problem with that, though if you get them again it would be interesting to find out why. dbus also works of course, but on some computers it seems to mysteriously fail, and I was never able to figure out why (not able te reproduce it)

    Ah, ok you were only talking about 'lib/pygtk', I thought you were talking of the entire pygtk dep :)

    Indeed though that requires admin rights, that's why I'd prefer they fixed it in XQuartz. But of course we can leave this info floating around so advanced users can fix it at their wish.
  10. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Status report :

    I can't find the former on my computer... but i just removed the entire 'icons' subdir, there was nothing interesting there anyway, OS X uses its ows icons

    I don't have this directory

    Done

    This was never included in our builds

    done, but could you please clarify what's this comment about a typo? was it fixed? it looks okay to me but i haven't use find often

    Done

    we're the "official" build so I'd rather keep the defaults when it doesn't help integration.

    Done


    So, quite a bit done :) The rest should follow soonish
  11. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Okay, automatic version handling should be in too :)
  12. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    I think this is ok for application icons but there are other icons in icons/Clearlook and there's a file 'index.theme' too. Maybe ths is somehow related to why clearlooks just runs on my system. (just another test to do ....)

    ... MacPorts just installs it on my system ???

    it should be "ufraw*"
    Code:
    find locale \( \! -name "gtk*" -and \! -name "gimp*" -and \! -name "ufraw*" \) -delete
    ... IMO this is "integration" ;)

    One more thing.
    Code:
    cp -R Library "$GIMPAPP"
    
    for working pyhton support, we'll have to copy Contents/Library/Phython to the app bundle.
  13. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    I'm not sure what you're talking about here, we already have working python support, and I can't find any 'Contents/Library/Phython' directory on my computer

    On mine too, but our gimpguts script cleaned it after :)


    thanks, fixed


    No, when we had Clearlooks in the icon dir was included (i'm pretty sure... anyway a lib that causes a segfault because there is a missing icon would be pretty lousy)
  14. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    I've download your latest Gimp 2.4.7 Leopard/Intel from this site and there's no python support in it.
    MacPorts had recently changed something to python. Now main parts are installed in the application bundle in Contents/Library. Just take a lokk at yout Leopard/Intel build and my version...

    clearlooks:

    as I mentioned earlier, clearlooks is running here on my system, so it may be possible that this old crash has been fixed in some way. Therefore IMO clearlooks should be included again.

    If we drop any package that will crash one day and won't include it after it is (possibly and hopefully) fixed, then someday we will have a really small Gimp bundle... If we want to build a rock-solid Gimp.app IMO we should not use MacPorts at all. We then should do it the, let's say, the "debian" way: avoid newest versions of software and try to find the most stable version and build a infrastructure of our own. But since we rely on MacPorts we will be more on the bleeding edge ...

    So I suggest, that some other developers should test my "clearlooks-Gimp" by using the included ProApp theme. If these tests run well, clearlooks should be included. If they fail, it should be dropped and we should try to find the bug, and (best) fix it and submit it to upstream / MacPorts.

    What do you think?
  15. Cocoa

    Cocoa New Member

    Joined:
    Sep 14, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Well, Clearlooks runs fine on my Intel 10.5.5. All I care about is tablet work, though.
  16. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Ah CRAP. On my computer it's still at the same place :/ I'll test again when I have my new intel/Leopard computer, currently I couldn't do the changes as there's no way I can test them

    About ClearLooks : I could test it again on my computer, I was getting crashes. But I personnaly am much more interested into bringing a native version, so I try to spend my free time working on the native GTK one, not the X11 one ;) This is a possibility, I'll see in my free time (if i have free time, i'm booked over the head). But then again, ClearLooks is no vital component. It does look a bit nicer than the current theme we're bundling, but out current theme is nice enough and quite usable so I wouldn't consider this high-priority. I'm not saying I won't check that, but to sum it all shortly "I prefer stability over eye-candy. Maybe the bug was fixed but I have no time to verify atm" ;)
  17. Cocoa

    Cocoa New Member

    Joined:
    Sep 14, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    There's always the fact that ClearLooks might have issues in PowerPC, or Tiger. It's good to have a PowerPC computer for purposes of making compatibility. However, is there no way we can create a universal binary?
  18. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    We could create a universal binary, but it would be more difficult than the current separate builds so we never bothered

    It's very possible that ClearkLooks has some endianness issue that makes it only crash on PPC computers indeed, or that it triggers a bug in Tiger's X11

Share This Page