[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-buildsystem
Subject:    [PATCH] bug 174806 (another one)
From:       Marcos Dione <mdione () grulic ! org ! ar>
Date:       2009-04-11 18:55:04
Message-ID: 20090411185504.GC22687 () mustang ! grulicueva ! net
[Download RAW message or body]

this is actually a forward from kde-core-devel. I think this
approach is simpler than the one proposed. I think we could tackle the
advantages of python2.6 later, and only if python2.6 gives us the
'local-to-user' path somehow, not guessing it.

    I'm reattaching the patches here. I repeat the WARNING: as I have
problems guessing the base diff path for reviewboard, the second patch (-2)
is based on /trunk/KDE/kdelibs, while the first one is based on /trunk/KDE.

----- Forwarded message from Marcos Dione <mdione@grulic.org.ar> -----

Date: Sat, 11 Apr 2009 15:31:15 -0300
From: Marcos Dione <mdione@grulic.org.ar>
Subject: Re: Review Request: allow PYTHON_SITE_PACKAGES_DIR be set from
	cmake's command line
To: Thiago Macieira <thiago@kde.org>
Cc: kde-core-devel@kde.org

On Sat, Apr 11, 2009 at 09:42:17AM +0200, Thiago Macieira wrote:
> Marcos Dione wrote:
> >Summary
> >-------
> >
> >this small patch allows to specify the PYTHON_SITE_PACKAGES_DIR path
> > from the cmake's command line via a -DPYTHON_SITE_PACKAGES_DIR option.
> > I already tested it and works with kdebase and kdebindings modules.
> >
> >
> >Diffs
> >-----
> >
> >  /trunk/KDE/kdelibs/cmake/modules/FindPythonLibrary.cmake 952067
> >
> >Diff: http://reviewboard.kde.org/r/553/diff
> 
> Can you please post the diffs?

    attached, it's really simple, as it doesn't try to do all the magic
found in [1]. WARNING: as I have problems guessing the base diff path
for reviewboard, the second patch is based on /trunk/KDE/kdelibs, while
the first one is based on /trunk/KDE.

> The link above doesn't work.

    yeah, it's because I couldn't figure out the proper base diff path
for the review board. see my mail in kde-devel.

> Also, please make the default be 
> ${LIB_INSTALL_DIR}/python${PYTHON_SHORT_VERSION}/site-packages/PyKDE4. 
> (Since I can't see the diff, I can't tell if you made this already the 
> default)

    I could complicate it a bit, at least for a first shot. still not
trying to do all the magic in [1], I could make it install in:

    * python's site-packages.
    * your proposed path, except for the PyKDE4 part (this also applies
to plasma stuff).
    * the one specified using -DPYTHON_SITE_PACKAGES_DIR.

    we could make the first the default, making the work of packagers
easier, and enabling the second with something like
-DPYTHON_LIBS_WITH_KDE_LIBS. or we could make the second the default,
more obvious for those setting the CMAKE_PREFIX_DIR and specting it to
be honored by the whole install process, and enabling the fisrt with
-DPYTHON_LIBS_IN_PYTHON_SITE_PACKAGES. and the third as told. all this
with the proper doc somewhere in kdelibs, kdebase *and* kdebindings; the
latter two the only (as of today) affected modules.

    I realize that if both python and kde4 are installed in a system
wide dir, like /usr, both the first and second paths are the same, but
this way we not only tackle the problem of installing kde4 somewhere
else, but also a kde4 using a non standard python, like one installed in
/usr/local.

    attached, then, are both patches, the original and simpler one, and
the other one proposed here, using the second variant as per your
suggestion, but with the first one commented out just for revission in
case we think it's better. I tested it with the kdebindings module.

    maybe later I could make another patch targeting python >=2.6.

--
[1] http://lists.kde.org/?t=123722894700003&r=1&w=2&n=6
-- 
(Not so) Random fortune:
Este día siempre me da una sensación medio feliz, medio triste. Los
domingos son el Chaplin de la semana.
	    -- Liniers

----- End forwarded message -----

-- 
(Not so) Random fortune:
18:55 < m4rgin4l> el tipo tiene un grupo de ayuda al paranoico
18:56 < m4rgin4l> se persiguen entre ellos para no sentirse solos

["kdelibs-python_site-packages_dir-2.diff" (text/x-diff)]

Index: cmake/modules/FindPythonLibrary.cmake
===================================================================
--- cmake/modules/FindPythonLibrary.cmake	(revision 952067)
+++ cmake/modules/FindPythonLibrary.cmake	(working copy)
@@ -43,7 +43,16 @@ else(EXISTS PYTHON_LIBRARY)
       STRING(REGEX REPLACE ".*\nshort_version:([^\n]+).*$" "\\1" \
                PYTHON_SHORT_VERSION ${python_config})
       STRING(REGEX REPLACE ".*\nlong_version:([^\n]+).*$" "\\1" PYTHON_LONG_VERSION \
                ${python_config})
       STRING(REGEX REPLACE ".*\npy_inc_dir:([^\n]+).*$" "\\1" PYTHON_INCLUDE_PATH \
${python_config}) +      if(NOT PYTHON_SITE_PACKAGES_DIR)
+        if (PYTHON_LIBS_IN_PYTHON_SITE_PACKAGES)
+        # if(NOT PYTHON_LIBS_WITH_KDE_LIBS) # second version
       STRING(REGEX REPLACE ".*\nsite_packages_dir:([^\n]+).*$" "\\1" \
PYTHON_SITE_PACKAGES_DIR ${python_config}) +        \
else(PYTHON_LIBS_IN_PYTHON_SITE_PACKAGES) +        # else(NOT \
PYTHON_LIBS_WITH_KDE_LIBS) # second version +          set(PYTHON_SITE_PACKAGES_DIR \
${KDE4_LIB_INSTALL_DIR}/python${PYTHON_SHORT_VERSION}/site-packages) +        \
endif(PYTHON_LIBS_IN_PYTHON_SITE_PACKAGES) +        # endif(NOT \
PYTHON_LIBS_WITH_KDE_LIBS) # second version +      endif(NOT \
                PYTHON_SITE_PACKAGES_DIR)
       STRING(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1\\2" PYTHON_SHORT_VERSION_NO_DOT \
                ${PYTHON_SHORT_VERSION})
       set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} \
python${PYTHON_SHORT_VERSION_NO_DOT})  if(WIN32)


["kdelibs-python_site-packages_dir.diff" (text/x-diff)]

Index: kdelibs/cmake/modules/FindPythonLibrary.cmake
===================================================================
--- kdelibs/cmake/modules/FindPythonLibrary.cmake	(revision 952067)
+++ kdelibs/cmake/modules/FindPythonLibrary.cmake	(working copy)
@@ -43,7 +43,9 @@ else(EXISTS PYTHON_LIBRARY)
       STRING(REGEX REPLACE ".*\nshort_version:([^\n]+).*$" "\\1" \
                PYTHON_SHORT_VERSION ${python_config})
       STRING(REGEX REPLACE ".*\nlong_version:([^\n]+).*$" "\\1" PYTHON_LONG_VERSION \
                ${python_config})
       STRING(REGEX REPLACE ".*\npy_inc_dir:([^\n]+).*$" "\\1" PYTHON_INCLUDE_PATH \
${python_config}) +      if(NOT PYTHON_SITE_PACKAGES_DIR)
       STRING(REGEX REPLACE ".*\nsite_packages_dir:([^\n]+).*$" "\\1" \
PYTHON_SITE_PACKAGES_DIR ${python_config}) +      endif(NOT PYTHON_SITE_PACKAGES_DIR)
       STRING(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1\\2" PYTHON_SHORT_VERSION_NO_DOT \
                ${PYTHON_SHORT_VERSION})
       set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} \
python${PYTHON_SHORT_VERSION_NO_DOT})  if(WIN32)



_______________________________________________
Kde-buildsystem mailing list
Kde-buildsystem@kde.org
https://mail.kde.org/mailman/listinfo/kde-buildsystem


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic