I studied this problem with Suominen help and I got these conclusions:

1) sqlite2 should stay bundled since it is used just to backport old digikam 
database (< 0.8.0) to new database based on sqlite3.

2) I can't unbundled lprof because all of the three available versions can't be 
installed on my system (AMD64).

3) I also can't unbundled clapack, because the portage package that I suppose 
to provide clapack, lapack-atlas, depends on blas-atlas that I can't install on 
my system due to compilations errors.

4) libjpeg doesn't seem to be bundled since the original configuration script 
checks for it. But, the source code on libs/jpegutils seems to use headers from 
libjpeg-6b. At portage, we have libjpeg-7, so Souminen alerted me that it could 
have some incompatibility. If it was confirmed, we shall write an e-mail to 
digikam devs asking them to update it.

5) The only library that I successfully unbundled was libpgf that was recently 
added to portage. Nevertheless, the current portage ebuild installs a wrong 
libpgf.pc, because it states that the include directory is /usr/include but it 
really is /usr/include/libpgf (can anyone fix it or should I open a bug?). 

Original line: includedir=${prefix}/include
Modification that should be maid:  includedir=${prefix}/include/libpgf

ONLY WITH THIS MODIFICATION, my patch and ebuild that I attached works. This 
patch unbundled libpgf.
Obs.: The patch can be easily modified to overcome this error on libpgf.pc, but 
I think it is more adequate correct it first.

I emerged digikam-1.0.0 with this ebuild and everything that I tested works 
perfectly. I also verify that PGF support is working and I checked that it is 
really dynamically linked to the library libpgf (when I remove it, digikam 
doesn't start saying that libpgf wasn't found). 

Since it was the first time that I have done something like it, I'm asking for 
help to avoid any mistakes, that's why I won't send this patch to bug 295459 by 
now.

Regards,
-- 
Ronan Arraes Jardim Chagas
Control and Automation Engineer
Gentoo Foundation Member

Em Segunda-feira 21 Dezembro 2009, às 11:46:51, Samuli Suominen escreveu:
> media-gfx/digikam is rotting outdated in tree with copies of *dozen*
> internal libraries, like *five* copies of sqlite, including sqlite-2.
> 
> Anyone intrested in maintaining it & unbundling the libraries?
> 
> 
> --
> Bundling internal copies of libraries,
> 
> https://bugs.gentoo.org/show_bug.cgi?id=206934
> https://bugs.gentoo.org/show_bug.cgi?id=258463
> 
> But above doesn't cover them all, it's coming also with copy of e.g.
> media-libs/jpeg-6b and several others.
> 
> Version 1.0.0 final been released,
> 
> https://bugs.gentoo.org/show_bug.cgi?id=295459
> --
> 
> 
> Thanks, Samuli
> 
> 
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: media-gfx/digikam/digikam-1.0.0.ebuild, 2009/12/22 Ronis_BR $

EAPI="2"

KDE_LINGUAS="ar be bg ca cs da de el es et eu fa fi fr ga gl he hi is it ja km
ko lt lv lb nds ne nl nn pa pl pt pt_BR ro ru se sk sl sv th tr uk vi zh_CN 
zh_TW"
KMNAME="extragear/graphics"
inherit kde4-base

MY_P="${PN}-${PV/_/-}"

DESCRIPTION="A digital photo management application for KDE."
HOMEPAGE="http://www.digikam.org/";
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"

LICENSE="GPL-2"
KEYWORDS="~amd64"
SLOT="4"
IUSE="addressbook debug geolocation gphoto2 lensfun semantic-desktop 
+thumbnails"

RDEPEND="
        >=kde-base/kdelibs-${KDE_MINIMAL}[semantic-desktop?]
        >=kde-base/libkdcraw-${KDE_MINIMAL}
        >=kde-base/libkexiv2-${KDE_MINIMAL}
        >=kde-base/libkipi-${KDE_MINIMAL}
        >=kde-base/solid-${KDE_MINIMAL}
        media-libs/jasper
        media-libs/jpeg
        media-libs/lcms
        media-libs/liblqr
        media-libs/libpng
        media-libs/tiff
        media-libs/libpgf
        x11-libs/qt-gui[qt3support]
        x11-libs/qt-sql[sqlite]
        addressbook? ( >=kde-base/kdepimlibs-${KDE_MINIMAL} )
        geolocation? ( >=kde-base/marble-${KDE_MINIMAL} )
        gphoto2? ( >=media-libs/libgphoto2-2.4.1-r1 )
        lensfun? ( media-libs/lensfun )
"
DEPEND="${RDEPEND}
        sys-devel/gettext
"

S="${WORKDIR}/${MY_P}"

src_prepare() {
        # Patch to unbundled libpgf.
        epatch "${FILESDIR}/libpgf-unbundled-r0.patch"

        kde4-base_src_prepare
}

src_configure() {
        local backend

        use semantic-desktop && backend="Nepomuk" || backend="None"
        # LQR = only allows to choose between bundled/external
        mycmakeargs="${mycmakeargs}
                -DWITH_LQR=ON
                -DENABLE_THEMEDESIGNER=OFF
                -DGWENVIEW_SEMANTICINFO_BACKEND=${backend}
                $(cmake-utils_use_enable gphoto2 GPHOTO2)
                $(cmake-utils_use_with gphoto2)
                $(cmake-utils_use_enable thumbnails THUMBS_DB)
                $(cmake-utils_use_with addressbook KdepimLibs)
                $(cmake-utils_use_with geolocation MarbleWidget)
                $(cmake-utils_use_with lensfun LensFun)
                $(cmake-utils_use_with semantic-desktop Soprano)"

        kde4-base_src_configure
}
diff -ruN old/cmake/modules/FindPGF.cmake new/cmake/modules/FindPGF.cmake
--- old/cmake/modules/FindPGF.cmake	1969-12-31 21:00:00.000000000 -0300
+++ new/cmake/modules/FindPGF.cmake	2009-12-24 02:15:23.754769439 -0200
@@ -0,0 +1,15 @@
+# - Try to find libpgf
+# Once done this will define
+#
+#  PGF_FOUND - system has libgf
+#  PGF_INCLUDE_DIRS - the libpgf include directory
+#  PGF_LIBRARIES - Link these to use libpgf
+
+# PKG-CONFIG is required.
+INCLUDE(FindPkgConfig REQUIRED)
+
+IF(PKG_CONFIG_FOUND)
+	INCLUDE(FindPkgConfig)
+
+	PKG_CHECK_MODULES(PGF libpgf)
+ENDIF(PKG_CONFIG_FOUND)
diff -ruN old/CMakeLists.txt new/CMakeLists.txt
--- old/CMakeLists.txt	2009-12-21 07:30:05.000000000 -0200
+++ new/CMakeLists.txt	2009-12-24 02:15:23.755769330 -0200
@@ -34,6 +34,9 @@
     "${DIGIKAM_VERSION_SHORT}${DIGIKAM_SUFFIX_VERSION}"
    )
 
+# Path to find FindPGF.cmake script.
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
+
 # ==================================================================================================
 # Debug area codes
 # These codes will be set for every project specific path automatically, so
@@ -63,6 +66,11 @@
 FIND_PACKAGE(JPEG)
 FIND_PACKAGE(PNG)
 FIND_PACKAGE(TIFF)
+
+# Included to unbundle libpgf that is on portage tree.
+# This function call the script cmake/modules/FindPGF.cmake
+FIND_PACKAGE(PGF)
+
 FIND_PACKAGE(Jasper)
 FIND_PACKAGE(Kdcraw)
 FIND_PACKAGE(Kexiv2)
@@ -181,6 +189,16 @@
     MESSAGE(STATUS "")
 ENDIF(PNG_FOUND)
 
+IF(PGF_FOUND)
+    MESSAGE(STATUS " libpgf library found................ YES")
+ELSE(PGF_FOUND)
+    MESSAGE(STATUS " libpgf library found................ NO")
+    MESSAGE(STATUS "")
+    MESSAGE(SEND_ERROR " digiKam needs libpgf since it was unbundled. You need to install the development package.")
+    MESSAGE(STATUS " Libpgf website is at http://www.libpgf.org";)
+    MESSAGE(STATUS "")
+ENDIF(PGF_FOUND)
+
 IF(JASPER_FOUND)
     MESSAGE(STATUS " libjasper library found............. YES")
 ELSE(JASPER_FOUND)
@@ -316,13 +334,13 @@
 ENDIF(GLIB2_FOUND)
 
 
-IF(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
+IF(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND PGF_FOUND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
     MESSAGE(STATUS " digiKam will be compiled............ YES")
     SET(DIGIKAM_CAN_BE_COMPILED true)
-ELSE(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
+ELSE(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND PGF_FOUND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
     MESSAGE(FATAL_ERROR " digiKam will be compiled............ NO  (Look README file for more details about dependencies)")
     SET(DIGIKAM_CAN_BE_COMPILED false)
-ENDIF(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
+ENDIF(LCMS_FOUND AND JPEG_FOUND AND PNG_FOUND AND TIFF_FOUND AND PGF_FOUND AND JASPER_FOUND AND KDCRAW_FOR_DIGIKAM AND KEXIV2_FOUND AND KIPI_FOUND)
 
 MESSAGE(STATUS "----------------------------------------------------------------------------------")
 MESSAGE(STATUS "")
@@ -906,14 +924,7 @@
         ${CMAKE_CURRENT_SOURCE_DIR}/libs/threadimageio/pgfutils.cpp
        )
 
-    SET(libpgf_SRCS
-        ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/Decoder.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/Encoder.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/PGFimage.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/Stream.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/Subband.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/libpgf/WaveletTransform.cpp
-       )
+    INCLUDE_DIRECTORIES(${PGF_INCLUDE_DIRS})
 
     SET(libsqlite2_SRCS
         ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rdparty/sqlite2/attach.c
diff -ruN old/digikam/CMakeLists.txt new/digikam/CMakeLists.txt
--- old/digikam/CMakeLists.txt	2009-12-21 07:21:14.000000000 -0200
+++ new/digikam/CMakeLists.txt	2009-12-24 02:15:23.756770201 -0200
@@ -38,7 +38,6 @@
                      # specific libs and utilities
                      ${CMAKE_CURRENT_SOURCE_DIR}/../libs/3rdparty/lprof
                      ${CMAKE_CURRENT_SOURCE_DIR}/../libs/3rdparty/sqlite2
-                     ${CMAKE_CURRENT_SOURCE_DIR}/../libs/3rdparty/libpgf
                      ${CMAKE_CURRENT_SOURCE_DIR}/../libs/3rdparty/clapack
                      ${CMAKE_CURRENT_SOURCE_DIR}/../libs/3rdparty/cimg
                      ${CMAKE_CURRENT_SOURCE_DIR}/../libs/themeengine
@@ -73,7 +72,8 @@
                      ${JPEG_INCLUDE_DIR}
                      ${PNG_PNG_INCLUDE_DIR}
                      ${TIFF_INCLUDE_DIR}
-                   )
+                     ${PGF_INCLUDE_DIRS}
+		   )
 
 
 # Shared libdigikamcore ################################################################
@@ -81,9 +81,6 @@
 # Disable Clapack C code warnings.
 SET_SOURCE_FILES_PROPERTIES(${libclapack_SRCS} PROPERTIES COMPILE_FLAGS "-w")
 
-# Disable libpgf warnings.
-SET_SOURCE_FILES_PROPERTIES(${libpgf_SRCS} PROPERTIES COMPILE_FLAGS "-w")
-
 SET(digikamcore_LIB_SRCS
                         # basic libs
                         ${libdimg_SRCS}
@@ -100,7 +97,6 @@
                         ${libgreycstoration_SRCS}
                         ${libthreadimageio_SRCS}
                         ${libthemeengine_SRCS}
-                        ${libpgf_SRCS}
                         ${pgfutils_SRCS}
                         ${libdigikamhelpers_SRCS}
 
@@ -146,6 +142,7 @@
                       ${JPEG_LIBRARIES}
                       ${TIFF_LIBRARIES}
                       ${PNG_LIBRARIES}
+		      ${PGF_LIBRARIES}
                       ${LCMS_LIBRARIES}
                       ${JASPER_LIBRARIES}
 
@@ -182,14 +179,10 @@
     SET_SOURCE_FILES_PROPERTIES(${libsqlite2_SRCS} PROPERTIES COMPILE_FLAGS "-w")
 ENDIF(WIN32)
 
-## Disable libpgf warnings.
-#SET_SOURCE_FILES_PROPERTIES(${libpgf_SRCS} PROPERTIES COMPILE_FLAGS "-w")
-
 SET(digikamdatabase_LIB_SRCS ${libdatabase_SRCS}
                              ${libhaar_SRCS}
                              ${libdatabasemodels_SRCS}
                              ${libsqlite2_SRCS}
-                             ${libpgf_SRCS}
                              ${pgfutils_SRCS}
    )
 
@@ -204,6 +197,7 @@
                       ${QT_QTCORE_LIBRARY}
                       ${QT_QTGUI_LIBRARY}
                       ${QT_QTSQL_LIBRARY}
+		      ${PGF_LIBRARIES}
                      )
 
 SET_TARGET_PROPERTIES(digikamdatabase PROPERTIES VERSION 1.0.0 SOVERSION 1 )
diff -ruN old/libs/CMakeLists.txt new/libs/CMakeLists.txt
--- old/libs/CMakeLists.txt	2009-12-21 07:21:03.000000000 -0200
+++ new/libs/CMakeLists.txt	2009-12-24 02:15:23.757769111 -0200
@@ -21,8 +21,10 @@
                      ${JPEG_INCLUDE_DIR}
                      ${TIFF_INCLUDE_DIR}
                      ${PNG_INCLUDE_DIR}
+		     ${PGF_INCLUDE_DIRS}
                      ${JASPER_INCLUDE_DIR}
                    )
+
 ADD_SUBDIRECTORY( curves )
 ADD_SUBDIRECTORY( levels )
 ADD_SUBDIRECTORY( histogram )

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to