Re: autotools gives autopain



On 1/3/06, Stanislav Brabec <sbrabec suse cz> wrote:
>
> I have to package a few packages using scons. Creating an RPM package
> from scons based project became my nightmare. Prepare a working lprof
> package for SuSE AMD64 took me about 6 hours of editing and debugging of
> scons files and finally it was impossible without patching many files
> and scons itself.

Stanislav, I have to agree 101% with this. A few months ago I attempted
to package gscore as RPM, and it took me several hours as well in order
to trace 64-bit arch problem and fix DESTDIR as well, though not as serious
as modifying scons itself.

If it is as BJörn said, that all these problems are caused by bad SConstruct
file, then probably most (if not all) software contains badly written
SConstruct files. Indeed from my limited experience with scons enabled
packages, quite a lot of SConstruct files contain many hardwired paths.

Abel


>
> Maybe I am doing something incorrectly. If you can advice on creating a
> distribution packages from scons based projects, I will be glad.
>
>
> 1) SCons intentionally ignores most standard *FLAGS (documentation says
> so). You have to edit one or more SConstruct files to force flags you
> want for your platform (it's a SuSE packaging convention), not flags
> decided by somebody for it. This is the simplest solution, working only
> in some projects:
>
> export CFLAGS="$RPM_OPT_FLAGS"
> if test -z "$CFLAGS" ; then
>   export CSCFLAGS=
> else
>   CSCFLAGS="${CFLAGS// /', '}"
>   export CSCFLAGS="'$CSCFLAGS'"
> fi
> echo "env.Append(CCFLAGS = [$CSCFLAGS])" >>SConstruct
>
>
> > 2. Scons is simple to learn, Autotools is not.
>
> 2) It is hard to change hardwired default paths and change, say /usr/lib
> to /usr/lib64 for all packages. It took me about 4 hours of debugging to
> get rid all of -L/usr/lib causing build failures. This covers only most
> common problems:
>
> (
>   find -name SConstruct
>   find -name SConscript
>   echo package.pro build_config.py
>   find -name Makefile
> ) | while read ; do
>   sed -i "
> s:/lib:/%_lib:g
> s:src/%_lib:src/lib:g
> " $REPLY
> done
>
> > 1. Scons is simply technically superior to GNU Autotools - with a big
> >    margin.
>
> 3) It is hard to provide custom path for libraries. One again one needs
> to to platform dependent editing of SConstruct file to do it.
>
> patch <<EOF
> --- SConstruct
> +++ SConstruct
> @@ -79,20 +79,20 @@
>         extra_includes = []
>         # z library information
>         z_lib = ['z']
> -       z_libpath = ['/usr/lib']
> +       z_libpath = ['/usr/%_lib']
>         z_include = ['/usr/include']
>         # png library information
>         png_lib = ['png']
> -       png_libpath = ['/usr/lib']
> +       png_libpath = ['/usr/%_lib']
>         png_include = ['/usr/include']
>         # jpeg library information
>         jpeg_lib = ['jpeg']
> -       jpeg_libpath = ['/usr/lib']
> +       jpeg_libpath = ['/usr/%_lib']
>         jpeg_include = ['/usr/include']
>         # OpenGL library information
>         opengl_lib = ['GL', 'GLU']
> -       opengl_static = ['/usr/lib/libGL.a', '/usr/lib/libGLU.a']
> -       opengl_libpath = ['/usr/lib', '/usr/X11R6/lib']
> +       opengl_static = ['/usr/%_lib/libGL.a', '/usr/%_lib/libGLU.a']
> +       opengl_libpath = ['/usr/%_lib', '/usr/X11R6/%_lib']
>         opengl_include = ['/usr/include', '/usr/X11R6/include']
>         # SDL library information
>         sdl_env.ParseConfig ('sdl-config --cflags --libs')
> EOF
>
>
> 4) I did not find any DESTDIR support, needed for comfortable packaging
> without root privileges. One has to go back 10 years and use:
>
> scons PREFIX=$RPM_BUILD_ROOT/usr install
>
> Sometimes you have to explicitly add more variables or even edit
> SConstruct before calling "scons install".
>
> --
> Best Regards / S pozdravem,
>
> Stanislav Brabec
> software developer
> ---------------------------------------------------------------------
> SuSE CR, s. r. o.                             e-mail: sbrabec suse cz
> Drahobejlova 27                               tel: +420 296 542 382
> 190 00 Praha 9                                fax: +420 296 542 374
> Czech Republic                                http://www.suse.cz/
>
> _______________________________________________
> desktop-devel-list mailing list
> desktop-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/desktop-devel-list
>


--
Abel Cheung   (GPG Key: 0xC67186FF)
Key fingerprint: 671C C7AE EFB5 110C D6D1  41EE 4152 E1F1 C671 86FF
--------------------------------------------------------------------
* GNOME Hong Kong - http://www.gnome.hk/
* Opensource Application Knowledge Assoc. - http://oaka.org/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]