[Slackbuilds-users] [FYI]SlackBuild for python modules should be architecture dependent

Dragon Wisard dragonwisard at gmail.com
Thu May 28 14:09:43 UTC 2009


Since they bytecode is itself, platform independent, wouldn't it make sense
to just use one directory (eg. /usr/lib/python2.6/site-packages/xxx) and
symlink the /usr/lib64/... to the that directory? Assuming you have both
32-bit and 64-bit builds of Python installed, there is no sense in having to
install the same exact modules twice in two different locations.

I would opt to install everything in /usr/lib/... since that will always be
present, and then create a symlink from doit.sh if x86_64 is detected.

Just my 2 cents.

On Thu, May 28, 2009 at 9:48 AM, Grissiom <chaos.proton at gmail.com> wrote:

> Hi folks,
>
> While I was taking train this afternoon, a thought came up in my mind --
> SlackBuilds for python modules and many programs that written in pure python
> (say, decorator, pysetuptools, logilab-common etc) should be arch
> dependent. Maybe most of them are installed via "distutils", if you see
> something like "python setup.py install --root=$PKG", it will be the case.
>
> I think setup.py just do what "./configure && make && make install" do --
> detect the python installation structure, compile .py files to .pyc
> bytecodes. The bytecodes is platorm independent but the installation
> structure is not. So in slackware64, things will be installed into
> /usr/lib64/python2.6/site-packages/xxx but in slackware, things will be
> installed into /usr/lib/python2.6/site-packages/xxx. The conclusion is the
> files in the package in arch indenpendent but the direcory structure is arch
> dependent.
>
> After some hack, I found a solution for this: write the SlackBuilds like
> this:
> ....
> if [ "$ARCH" = "i486" ]; then
>   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
>   LIBDIRSUFFIX=""
> elif [ "$ARCH" = "i686" ]; then
>   SLKCFLAGS="-O2 -march=i686 -mtune=i686"
>   LIBDIRSUFFIX=""
> elif [ "$ARCH" = "x86_64" ]; then
>   SLKCFLAGS="-O2 -fPIC"
>   LIBDIRSUFFIX="64"
> fi
> ....
> ....
> python setup.py install --prefix=/usr
> --install-lib=/usr/lib${LIBDIRSUFFIX}/python2.6/site-packages/ --root=$PKG
> ....
>
> Thus the package will install files to /usr/lib for 32bit slack and
> /usr/lib64 for slackware64.(note python in slackware12.2 is still 2.5.x you
> may need to adjust the install command for 12.2)
>
> Saying so much, I hope I have expressed my idea clearly and it will do some
> help.
>
> --
> Cheers,
> Grissiom
>
> _______________________________________________
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> http://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - http://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - http://slackbuilds.org/faq/
>
>
>


-- 
http://www.dragonwisard.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20090528/03add93f/attachment.htm>


More information about the SlackBuilds-users mailing list