Bug 257679

Summary: Build a PKG package for digiKam under MacOSX
Product: [Applications] digikam Reporter: Julien Narboux <Julien>
Component: Bundle-MacOSAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: caulier.gilles, jan, jens-bugs.kde.org, m.schlichting, pepik1978, rechner
Priority: NOR    
Version: 4.9.0   
Target Milestone: ---   
Platform: MacPorts   
OS: macOS   
Latest Commit: Version Fixed In: 4.11.0
Sentry Crash Report:

Description Julien Narboux 2010-11-23 10:02:13 UTC
Version:           unspecified (using KDE 4.5.3) 
OS:                OS X

It would be nice to have an easy to install package for DigiKam under MacOSX which would contain all the dependencies.

It could be built using MacPorts project. There is an undocumented option to build a package with it dependencies in MacPorts:
port mdmg digikam
port mpkg digikam

Problem: Mac Ports package seem to contain the hardcoded path for the installation, installing using such a package could break an existing mac port installation. A solution could be to build the whole mac ports using a special path for digikam which would not conflict with the standard macports path.


Reproducible: Didn't try
Comment 1 caulier.gilles 2010-11-23 10:07:33 UTC
Thanks Julien for the links to undocumented functions...

Gilles Caulier
Comment 2 Julien Narboux 2010-11-26 09:39:47 UTC
The problem with the mdmg method is that it includes all the reccursive dependencies of DigiKam including many dependencies which are only used to build  Digikam or its dependencies...

Julien
Comment 3 caulier.gilles 2010-11-26 09:49:20 UTC
What the size of DMG archive in this case ?

Gilles Caulier
Comment 4 Julien Narboux 2010-11-26 19:03:36 UTC
The dmg is about 900Mo...
Comment 5 Julien Narboux 2010-12-28 18:10:42 UTC
In fact, after reading the code it seems that the port mdmg command does not include the build dependencies, only the runtime dependencies. But the list of dependencies of digikam using macports is very large, in fact it is a larger set than digikam dependencies, here is the list:

libgphoto2
    dbus
      expat
    gettext
      libiconv
      ncurses
        ncursesw
    jpeg
    libexif
    libusb-compat
      libusb
    libtool
  liblqr
    glib2
      zlib
      perl5
        perl5.8
      python_select
  kdegraphics4
    qt4-mac
      openssl
      sqlite3
        readline
      tiff
      libpng
      libmng
        lcms
    phonon
    kdebase4-runtime
      kdelibs4
        bzip2
        soprano
          clucene
          strigi
            libxml2
          redland
            curl
              libidn
              curl-ca-bundle
            libxslt
            raptor
            rasqal
              mpfr
                gmp
            pkgconfig
           db46
          libiodbc
          virtuoso
        cyrus-sasl2
        pcre
        shared-mime-info
        giflib
          xorg-libsm
            xorg-libice
              xorg-xproto
          xorg-libX11
            xorg-libXdmcp
            xorg-libXau
            xorg-libxcb
              xorg-xcb-proto
                python26
                  gdbm
              xorg-libpthread-stubs
            xorg-kbproto
        jasper
        openexr
          ilmbase
        libart_lgpl
        enchant
          aspell
            texinfo
          hunspell
        aspell-dict-en
        attica
        liblzma
        avahi
          libdaemon
          libglade2
            fontconfig
              freetype
            gtk2
              atk
              pango
                Xft2
                  xrender
                    xorg-renderproto
                cairo
                  libpixman
              gdk-pixbuf2
              xorg-libXi
                xorg-libXext
                  xorg-xextproto
                xorg-inputproto
              xorg-libXrandr
                xorg-randrproto
              xorg-libXcursor
                xorg-libXfixes
                  xorg-fixesproto
              xorg-libXinerama
                xorg-xineramaproto
              xorg-libXdamage
                xorg-damageproto
              xorg-libXcomposite
                xorg-compositeproto
          dbus-python26
            dbus-glib
            py26-gobject
              libffi
          py26-gtk
            py26-cairo
              py26-numpy
                fftw-3
                py26-nose
                  py26-distribute
                gcc44
                atlas
                  gzip
          intltool
            p5-xml-parser
            p5-getopt-long
            p5-pathtools
            p5-scalar-list-utils
        qca
        dbusmenu-qt
          qjson
        docbook-xml
          docbook-xml-4.1.2
            xmlcatmgr
          docbook-xml-4.2
          docbook-xml-4.3
          docbook-xml-4.4
          docbook-xml-4.5
          docbook-xml-5.0
        docbook-xsl
        grantlee
        shared-desktop-ontologies
      qimageblitz
      oxygen-icons
      hicolor-icon-theme
      exiv2
      openslp
      bison
        m4
    poppler
      openjpeg
      poppler-data
    djvulibre
    chmlib
    libspectre
      ghostscript
        xorg-libXt
        libpaper
    sane-backends
    gphoto2
      popt
  kdeedu4
    kdebase4
      kdepimlibs4
        akonadi
          boost
          mysql5-server
            mysql5
        libical
        openldap
          icu
        gpgme
          gnupg
          pth
          libgpg-error
          libassuan
    ocaml
    openbabel
    cfitsio
    libqalculate
      cln
    gsl
    xplanet
      xorg-libXScrnSaver
        xorg-scrnsaverproto
    eigen
    gpsd
  kipi-plugins
    ImageMagick
      urw-fonts
    mesa
      xorg-glproto
      xorg-dri2proto
      xorg-libXmu
    opencv
      ffmpeg
        lame
        libvorbis
          libogg
        libtheora
        dirac
          cppunit
        schroedinger
          orc
        faac
        faad2
        speex
        XviD
        x264
        libvpx
        libsdl
      liboil
      libdc1394
    libgpod
      libplist
        swig-python
          swig
      taglib
      py26-mutagen
    gdk-pixbuf



So we need to simplify this.
One solution could be to change by hand some port files to remove dependencies which are not needed for digiKam.

Another solution could be to try working in the opposite direction, from digiKam.
otool -L digikam gives a list dynlib. But I guess this is not enough to actually run digiKam.
What about trying to link statically all libraries ? but we need some bin files such as kio, ...

Julien
Comment 6 Vlado Plaga 2011-01-23 15:40:31 UTC
I'm running digiKam on both Linux and Mac OS, and installed digiKam 1.7.0 on Mac just a few days ago.

The idea of modifying some Portfiles so that they have less dependencies sounds good and logical to me! In fact that's what I did, because a dependency ("atlas" and maybe also "akonadi" or "boost") did not compile. This is my "diff" for the kdelibs4 Portfile (just two lines changed, but much of avahi's large dependency tree removed):

36c36
<                     port:avahi port:qca \
---
>                     port:qca \
59c59
<                         -DWITH_Avahi=ON \
---
>                         -DWITH_Avahi=OFF \

A problem with Macports is that it tries to be a consistent packaging system, like the one provided by Debian. So of course a Port has to depend on everything that it would automatically use, when detecting it in the "configure" phase. I once wanted to remove an "optional" kipi-plugins dependency (gtk1) from the kipi-plugins Portfile, but Ryan Schmidt, one of Macports project managers, clearly stated that this was not in line with the Macports policy:

"It's not ok for ports to opportunistically use software that happens to be installed."
http://trac.macports.org/ticket/25076

When creating a binary version of digiKam that installs in a directory like "/opt/digikam" (instead of "/opt/local") this concern would not matter, though, so ideally one would only have each Port depend only on what is really required to build (or to provide the desired functionality). This should greatly increase compile time, but it would also be a lot of work to maintain such a set of modified Portfiles.

I'm not going to put much effort into this, as my old PPC system is too slow for compilation tests. Anyway Macports' support for Mac OS 10.5 will probably end soon after 10.7 is out this year, and I'm not going to buy an Intel Mac (or any Intel computer - but no political discussion here).
Comment 7 caulier.gilles 2012-05-10 11:35:54 UTC
Julien, 

I found that Darktable use macport to release a DMG image for MACOSX. Darktable use also Cmake. There is a release script in this folder :

http://darktable.git.sourceforge.net/git/gitweb.cgi?p=darktable/darktable;a=tree;f=packaging/macosx;hb=HEAD

The most important script is make-app-bundle, written in BASH. Look like it can be adapted to digiKam. Only the list of shared libs used by digiKam must be updated in this script.

Note that darktable work like me : i never use macports to install digiKam package as well, but i install all depencies through macports, and i checkout code from KDE repository, and compile/install against macport dir...

Gilles Caulier
Comment 8 Pepik1978 2015-05-01 12:54:15 UTC
 Guys, any progress on that one? I guess it's the most - indeed the most beneficial area. There are many photographers which could benefit from it. They're not DEVs nor QEs by nature, but they could be - or they can spread the word & bring these people eventually to the project. 

 As was already mentioned above - DarkTable are delivering DMG archive. 
I'm not DEV, but I can help with testing (on Mavericks & Yosemite). I just don't want to mess up my system with cumbersome mac ports. I tried in past and I won't repeat it ever again.
Comment 9 caulier.gilles 2015-05-07 08:09:07 UTC
Git commit ed59ff1231f03af46727560d0b876b77b58f21a5 by Gilles Caulier.
Committed on 07/05/2015 at 08:07.
Pushed by cgilles into branch 'master'.

add scripts to build OSX DMG packages of digiKam.
these scripts use MAcports internally.
files have been provided by Shanti through digiKam users mailling list

A  +81   -0    project/macosx/digikam-package/README
A  +95   -0    project/macosx/digikam-package/build-digikam.sh
A  +205  -0    project/macosx/digikam-package/digikam-portfile/Portfile
A  +181  -0    project/macosx/digikam-package/digikam-portfile/Portfile-orig.480
A  +51   -0    project/macosx/digikam-package/digikam-portfile/digikam-mysql-2015-04-14.diff
A  +72   -0    project/macosx/digikam-package/digikam-portfile/digikam-mysql-490.diff
A  +258  -0    project/macosx/digikam-package/make-package.sh
A  +961  -0    project/macosx/digikam-package/package/digikam.pkgproj
A  +10   -0    project/macosx/digikam-package/package/postinstall
A  +17   -0    project/macosx/digikam-package/package/preinstall
A  +137  -0    project/macosx/digikam-package/rll.py

http://commits.kde.org/scratch/mwiesweg/digikam-sc/ed59ff1231f03af46727560d0b876b77b58f21a5
Comment 10 caulier.gilles 2015-05-09 05:56:39 UTC
Git commit b17bd95c1b737f2d685948bcdaa2041cf3bc8dd0 by Gilles Caulier.
Committed on 09/05/2015 at 05:55.
Pushed by cgilles into branch 'master'.

missing Qt framework libraries to package

M  +17   -1    project/macosx/digikam-package/package/digikam.pkgproj

http://commits.kde.org/scratch/mwiesweg/digikam-sc/b17bd95c1b737f2d685948bcdaa2041cf3bc8dd0
Comment 11 caulier.gilles 2015-05-09 06:23:42 UTC
PKG file of digiKam 4.9.0 is available on GDrive for testing :

https://drive.google.com/file/d/0B7yq-xFihT0_dWFvcUFFMUd0VzA/view?usp=sharing

Gilles Caulier
Comment 12 caulier.gilles 2015-05-09 07:24:29 UTC
Screenshot :

https://www.flickr.com/photos/digikam/17446001035/
Comment 13 caulier.gilles 2015-05-28 10:25:15 UTC
First official  PKG installer is here :

http://download.kde.org/stable/digikam/digikam-4.10.0.pkg.mirrorlist
Comment 14 Markus 2015-06-10 21:08:43 UTC
Awesome! Very happy to see this, will try it ASAP :)
Comment 15 Jens 2015-07-13 18:35:45 UTC
Thank you!

However, I get "LSOpenURLsWithRole() failed with error -10810 for the file /opt/digikam/Applications/KDE4/digikam.app." upon opening. Also tried removing /opt/digikam and reinstalling, no change.