Commit 698f69d5 authored by Jérome Perrin's avatar Jérome Perrin

component/glib: put slapos python3 in PATH

On old debian (9) where python3 is python3.5 this component fails to
build with an error like:

    Configuring gdbus-example-objectmanager-visibility.h with command
    Running command: /opt/slapgrid/shared/glib/60e920f1feec2451d51bb344cfcad9ab/.build/glib-2.76.3/tools/gen-visibility-macros.py 2.0 visibility-macros GDBUS_OBJECT_MANAGER_EXAMPLE /opt/slapgrid/shared/glib/60e920f1feec2451d51bb344cfcad9ab/.build/glib-2.76.3/builddir/gio/tests/gdbus-object-manager-example/gdbus-example-objectmanager-visibility.h
    --- stdout ---
    --- stderr ---
      File "/opt/slapgrid/shared/glib/60e920f1feec2451d51bb344cfcad9ab/.build/glib-2.76.3/tools/gen-visibility-macros.py", line 37
        """
        ^
    SyntaxError: invalid syntax

This is because this gen-visibility-macros.py script is executable with
a shebang:

    #!/bin/env python3

for python 3 softwares, this is slapos python, because the python
section from component/defaults.cfg injects the slapos' python in PATH,
but for python 2 software, slapos' python 2 is injected in path and
`python3` resolves to system python, which in that case fails because
f-strings are SyntaxError but more generally this showed a dependency
to system python, but we can not rely on system python here.
parent 87b81684
...@@ -7,6 +7,7 @@ extends = ...@@ -7,6 +7,7 @@ extends =
../patch/buildout.cfg ../patch/buildout.cfg
../pcre2/buildout.cfg ../pcre2/buildout.cfg
../perl/buildout.cfg ../perl/buildout.cfg
../python3/buildout.cfg
../pkgconfig/buildout.cfg ../pkgconfig/buildout.cfg
../xz-utils/buildout.cfg ../xz-utils/buildout.cfg
../zlib/buildout.cfg ../zlib/buildout.cfg
...@@ -27,7 +28,7 @@ make-binary = ninja -C builddir ...@@ -27,7 +28,7 @@ make-binary = ninja -C builddir
pkg_config_depends = ${pcre2:location}/lib/pkgconfig:${libffi:location}/lib/pkgconfig:${zlib:location}/lib/pkgconfig pkg_config_depends = ${pcre2:location}/lib/pkgconfig:${libffi:location}/lib/pkgconfig:${zlib:location}/lib/pkgconfig
environment = environment =
PKG_CONFIG_PATH=${:pkg_config_depends} PKG_CONFIG_PATH=${:pkg_config_depends}
PATH=${ninja:location}/bin:${pkgconfig:location}/bin:${patch:location}/bin:${perl:location}/bin:${xz-utils:location}/bin:%(PATH)s PATH=${python3:location}/bin:${ninja:location}/bin:${pkgconfig:location}/bin:${patch:location}/bin:${perl:location}/bin:${xz-utils:location}/bin:%(PATH)s
CFLAGS=-I${gettext:location}/include CFLAGS=-I${gettext:location}/include
LDFLAGS=-L${gettext:location}/lib -lintl -Wl,-rpath=${gettext:location}/lib -Wl,-rpath=${libffi:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=@@LOCATION@@/lib -Wl,-rpath=${pcre2:location}/lib LDFLAGS=-L${gettext:location}/lib -lintl -Wl,-rpath=${gettext:location}/lib -Wl,-rpath=${libffi:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=@@LOCATION@@/lib -Wl,-rpath=${pcre2:location}/lib
post-install = rm %(location)s/bin/gtester-report post-install = rm %(location)s/bin/gtester-report
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment